功能变化: 新增前端获取系统配置功能
parent
177133726f
commit
9597addd61
|
@ -201,6 +201,10 @@ Vue.prototype.getDictionaryLabel = function (name, value) {
|
||||||
}
|
}
|
||||||
return store.state.d2admin.dictionary.data[name]
|
return store.state.d2admin.dictionary.data[name]
|
||||||
}
|
}
|
||||||
|
// 获取系统配置
|
||||||
|
Vue.prototype.systemConfig = function (name) {
|
||||||
|
return store.state.d2admin.settings.data[name]
|
||||||
|
}
|
||||||
// 默认Columns 结尾 showForm:显示在form中,showTable:显示在table中
|
// 默认Columns 结尾 showForm:显示在form中,showTable:显示在table中
|
||||||
Vue.prototype.commonEndColumns = function (param = {}) {
|
Vue.prototype.commonEndColumns = function (param = {}) {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,15 +6,7 @@ export const urlPrefix = '/api/init/settings/'
|
||||||
export default {
|
export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
siteName: '', // 网站名称
|
data: {}
|
||||||
siteLogo: '', // 网站logo地址
|
|
||||||
loginBackground: '', // 登录页背景图
|
|
||||||
copyright: '', // 版权
|
|
||||||
keepRecord: '', // 备案
|
|
||||||
helpUrl: '', // 帮助地址
|
|
||||||
privacyUrl: '', // 隐私
|
|
||||||
clauseUrl: '', // 条款
|
|
||||||
captchaState: true // 是否开启验证码
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
/**
|
/**
|
||||||
|
@ -42,22 +34,13 @@ export default {
|
||||||
* @param {Object} context
|
* @param {Object} context
|
||||||
*/
|
*/
|
||||||
async load ({ state, dispatch, commit }) {
|
async load ({ state, dispatch, commit }) {
|
||||||
const res = await dispatch('d2admin/db/get', {
|
// store 赋值
|
||||||
|
state.data = await dispatch('d2admin/db/get', {
|
||||||
dbName: 'sys',
|
dbName: 'sys',
|
||||||
path: 'settings.init',
|
path: 'settings.init',
|
||||||
defaultValue: {},
|
defaultValue: {},
|
||||||
user: true
|
user: true
|
||||||
}, { root: true })
|
}, { root: true })
|
||||||
// store 赋值
|
|
||||||
state.siteName = res.site_name
|
|
||||||
state.siteLogo = res.site_logo
|
|
||||||
state.loginBackground = res.login_background
|
|
||||||
state.copyright = res.copyright
|
|
||||||
state.keepRecord = res.keep_record
|
|
||||||
state.helpUrl = res.help_url
|
|
||||||
state.privacyUrl = res.privacy_url
|
|
||||||
state.clauseUrl = res.clause_url
|
|
||||||
state.captchaState = res.captcha_state
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<el-col :span="12">变量值</el-col>
|
<el-col :span="12">变量值</el-col>
|
||||||
<el-col :span="4" :offset="4">变量名</el-col>
|
<el-col :span="4" :offset="4">变量名</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form ref="form" :model="form" label-width="100px" label-position="left" style="margin-top: 20px">
|
<el-form ref="form" :model="form" label-width="140px" label-position="left" style="margin-top: 20px">
|
||||||
<el-form-item :label="item.title" :prop="['array'].indexOf(item.form_item_type_label) >-1?'':item.key"
|
<el-form-item :label="item.title" :prop="['array'].indexOf(item.form_item_type_label) >-1?'':item.key"
|
||||||
:key="index" :rules="item.rule"
|
:key="index" :rules="item.rule"
|
||||||
v-for="(item,index) in formList"
|
v-for="(item,index) in formList"
|
||||||
|
|
Loading…
Reference in New Issue