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

默认值换成你

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