chore(style): allow case declarations and ban var (#987)

* chore(style): allow case declarations

* chore(style): ban `var` and prefer `const`
This commit is contained in:
q1anx1
2022-08-08 23:35:24 +08:00
committed by GitHub
parent 802995ed16
commit deed857788
65 changed files with 187 additions and 182 deletions

View File

@ -61,7 +61,7 @@ class ProviderEditPage extends React.Component {
updateProviderField(key, value) {
value = this.parseProviderField(key, value);
let provider = this.state.provider;
const provider = this.state.provider;
provider[key] = value;
this.setState({
provider: provider,
@ -148,11 +148,11 @@ class ProviderEditPage extends React.Component {
}
loadSamlConfiguration() {
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(this.state.provider.metadata, "text/xml");
var cert = xmlDoc.getElementsByTagName("ds:X509Certificate")[0].childNodes[0].nodeValue;
var endpoint = xmlDoc.getElementsByTagName("md:SingleSignOnService")[0].getAttribute("Location");
var issuerUrl = xmlDoc.getElementsByTagName("md:EntityDescriptor")[0].getAttribute("entityID");
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(this.state.provider.metadata, "text/xml");
const cert = xmlDoc.getElementsByTagName("ds:X509Certificate")[0].childNodes[0].nodeValue;
const endpoint = xmlDoc.getElementsByTagName("md:SingleSignOnService")[0].getAttribute("Location");
const issuerUrl = xmlDoc.getElementsByTagName("md:EntityDescriptor")[0].getAttribute("entityID");
this.updateProviderField("idP", cert);
this.updateProviderField("endpoint", endpoint);
this.updateProviderField("issuerUrl", issuerUrl);
@ -717,7 +717,7 @@ class ProviderEditPage extends React.Component {
}
submitProviderEdit(willExist) {
let provider = Setting.deepCopy(this.state.provider);
const provider = Setting.deepCopy(this.state.provider);
ProviderBackend.updateProvider(this.state.provider.owner, this.state.providerName, provider)
.then((res) => {
if (res.msg === "") {