Commit 918cdd60 authored by 耿迪迪's avatar 耿迪迪
parents aa2d07a7 ef560896
......@@ -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");
......
......@@ -297,6 +297,7 @@ export default {
return delSetting(systemIds);
}).then(() => {
this.getList();
this.refreshSystemSetting();
this.msgSuccess("删除成功");
//刷新运行参数缓存
this.refreshSystemSetting();
......@@ -322,6 +323,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