Commit d3e9ec5e authored by 纪泽龙's avatar 纪泽龙

默认值换成你

parent 6d61c297
......@@ -36,7 +36,7 @@
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.21.0",
"clipboard": "2.0.6",
"core-js": "3.8.1",
"core-js": "^3.19.1",
"echarts": "4.9.0",
"element-ui": "2.15.0",
"file-saver": "2.0.4",
......@@ -80,5 +80,6 @@
"browserslist": [
"> 1%",
"last 2 versions"
]
],
"main": "index.js"
}
......@@ -7,7 +7,8 @@ const user = {
name: '',
avatar: '',
roles: [],
permissions: []
permissions: [],
systemSetting:{},
},
mutations: {
......@@ -25,6 +26,9 @@ const user = {
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
},
SET_SYSTEMSETTING: (state, systemSetting) => {
state.systemSetting = systemSetting
}
},
......@@ -52,6 +56,7 @@ const user = {
getInfo().then(res => {
const user = res.user
const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
console.log("getInfo")
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
......@@ -60,6 +65,9 @@ const user = {
}
commit('SET_NAME', user.userName)
commit('SET_AVATAR', avatar)
// 默认配置
commit('SET_SYSTEMSETTING', res.systemSetting)
console.log(res.systemSetting)
resolve(res)
}).catch(error => {
reject(error)
......
......@@ -569,6 +569,10 @@ export default {
version: "3.5.0",
};
},
created(){
// 默认配置
console.log(this.$store.state.settings)
},
methods: {
goTarget(href) {
window.open(href, "_blank");
......
......@@ -280,7 +280,6 @@ export default {
this.open = false;
this.getList();
//刷新运行参数缓存
this.refreshSystemSetting();
});
}
}
......@@ -297,7 +296,9 @@ export default {
return delSetting(systemIds);
}).then(() => {
this.getList();
this.refreshSystemSetting();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
......@@ -320,6 +321,9 @@ export default {
console.log(response,"fdsfsdfdsfd")
if(response.code != 200){
this.message("运行参数缓存刷新失败,请重新刷新缓存!");
}else{
this.$store.commit("SET_SYSTEMSETTING",response.data)
console.log(this.$store.state.user.systemSetting)
}
});
}
......
......@@ -34,7 +34,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
target: `http://192.168.2.28:8080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment