forked from AkkomaGang/admin-fe
Fix parsing values that can be both strings and arrays
This commit is contained in:
parent
05615cddf5
commit
070db1235a
2 changed files with 3 additions and 4 deletions
|
@ -10,10 +10,6 @@
|
|||
<setting :setting-group="corsPlug" :data="corsPlugData"/>
|
||||
</el-form>
|
||||
<el-divider v-if="corsPlug" class="divider thick-line"/>
|
||||
<el-form ref="httpSignatures" :model="httpSignaturesData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="httpSignatures" :data="httpSignaturesData"/>
|
||||
</el-form>
|
||||
<el-divider v-if="httpSignatures" class="divider thick-line"/>
|
||||
<el-form ref="httpSecurityData" :model="httpSecurityData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="httpSecurity" :data="httpSecurityData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -228,6 +228,9 @@ export default {
|
|||
return this.data.value ? this.data.value[this.setting.key] : []
|
||||
} else if (this.setting.type === 'atom') {
|
||||
return this.data[this.setting.key] && this.data[this.setting.key][0] === ':' ? this.data[this.setting.key].substr(1) : this.data[this.setting.key]
|
||||
} else if (Array.isArray(this.setting.type) &&
|
||||
this.setting.type.find(el => Array.isArray(el) && el.includes('list'))) {
|
||||
return typeof this.data[this.setting.key] === 'string' ? [this.data[this.setting.key]] : this.data[this.setting.key]
|
||||
} else {
|
||||
return this.data[this.setting.key]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue