Skip to content

Commit

Permalink
fix: tokenRequired validate
Browse files Browse the repository at this point in the history
  • Loading branch information
fzlins committed Jan 28, 2025
1 parent d9e66c0 commit 9944fd4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/interface/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,12 @@ export interface Site {
// siteGroups?: string[];
// token in headers
authToken?: string;
tokenRequired? : boolean;
tokenTip?: string;
apiCdn?: string[];
getInfoAjaxCache?: boolean;


}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/options/views/settings/Sites/Add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default Vue.extend({
},
next(step: number) {
if (this.selectedSite && this.selectedSite.name) {
this.valid = true;
this.valid = !this.selectedSite.tokenRequired;
this.haveError = false;
this.step++;
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/options/views/settings/Sites/Editor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-card class="mb-5" :color="$vuetify.dark ? '' : 'grey lighten-4'">
<v-card-text>
<v-form v-model="valid">
<v-form v-model="valid" ref="form">
<!-- 站点名称 -->
<v-text-field
ref="name"
Expand Down Expand Up @@ -405,7 +405,7 @@ export default Vue.extend({
}
this.$emit("change", {
data: this.site,
valid: this.valid
valid: (this.$refs.form as any).validate()
});
},
deep: true
Expand Down Expand Up @@ -461,7 +461,7 @@ export default Vue.extend({
initData() {
if (this.initData) {
this.site = Object.assign({}, this.initData);
this.valid = this.site.name && this.site.host ? true : false;
this.valid = (this.$refs.form as any).validate();
}
}
},
Expand Down

0 comments on commit 9944fd4

Please sign in to comment.