|
@@ -11,6 +11,7 @@
|
|
|
></el-button>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
+ <el-button @click="loadPublicConfig" icon="el-icon-refresh" style="margin-right:30px;" circle></el-button>
|
|
|
<span class="warp">
|
|
|
<el-dropdown @command="onLogOut">
|
|
|
<span class="el-dropdown-link">
|
|
@@ -104,6 +105,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { menuData } from "./mencCofig.js";
|
|
|
+import { mapActions, mapMutations } from "vuex";
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -121,8 +124,13 @@ export default {
|
|
|
];
|
|
|
this.menuCollapse = JSON.parse(localStorage.getItem("menuCollapse"));
|
|
|
this.tags = JSON.parse(localStorage.getItem("tagsNavList")) || [];
|
|
|
+
|
|
|
+ //加载公共配置 到vuex中
|
|
|
+ this.loadPublicConfig()
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapActions(["fetch"]),
|
|
|
+ ...mapMutations(["savaPublicConfig"]),
|
|
|
// 收取菜单按钮
|
|
|
onMenuCollapse() {
|
|
|
this.menuCollapse = !this.menuCollapse;
|
|
@@ -209,7 +217,22 @@ export default {
|
|
|
},
|
|
|
onLogOut() {
|
|
|
this.$router.push('login')
|
|
|
- }
|
|
|
+ },
|
|
|
+ //加载公共配置 到vuex中
|
|
|
+ loadPublicConfig() {
|
|
|
+ this.fetch({
|
|
|
+ api: "/publics/sysconf/list",
|
|
|
+ success: res => {
|
|
|
+ console.log(res);
|
|
|
+ // this.configList = res;
|
|
|
+ let temp = res.map(item => {
|
|
|
+ return JSON.parse(item.conf.data)
|
|
|
+ })
|
|
|
+ console.log(temp)
|
|
|
+ this.savaPublicConfig(temp)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|