|
@@ -43,7 +43,7 @@ export default {
|
|
|
mounted() {
|
|
|
window.onload=function() {
|
|
|
this.name = localStorage.getItem('username');
|
|
|
- },
|
|
|
+ }
|
|
|
this.getMenu();
|
|
|
},
|
|
|
computed: {
|
|
@@ -54,14 +54,22 @@ export default {
|
|
|
...mapMutations("user", ["SET_NAME"]),
|
|
|
// 获取菜单
|
|
|
getMenu() {
|
|
|
- // this.API.requestData({
|
|
|
- // subUrl: "admin/usermenu",
|
|
|
- // success (res) {
|
|
|
- // console.log("getMenu", res);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // return;
|
|
|
- this.menu = menuData.menu;
|
|
|
+ var digital1 = new URLSearchParams();
|
|
|
+ digital1.append('authToken', localStorage.getItem('authToken'));
|
|
|
+ this.API.get("admin/usermenu", digital1).then((res) => {
|
|
|
+ let { children } = res.data[0];
|
|
|
+ let menu = [];
|
|
|
+ for (let i = 0; i < Object.keys(children).length; i++) {
|
|
|
+ menu.push(children[i]);
|
|
|
+ }
|
|
|
+ this.$store.commit('setMenu', menu);
|
|
|
+ this.menu = this.$store.getters.menu;
|
|
|
+ }).catch(console.log("3333333333333333333"));
|
|
|
+ //this.menu = menuData.menu;
|
|
|
+ //this.menu = localStorage.getItem('menu')
|
|
|
+ //this.$store.commit('setMenu', )
|
|
|
+
|
|
|
+
|
|
|
this.API.get("/powercompare/windfarmAjax").then((res) => {
|
|
|
console.log(res);
|
|
|
if (res.code === 200) {
|