From 5d62f0a16c8475aff2103f476fe827ec3e16046c Mon Sep 17 00:00:00 2001 From: zhangc <zc@123> Date: 星期一, 24 三月 2025 19:49:17 +0800 Subject: [PATCH] 1 --- pages/home/menuHome.vue | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/pages/home/menuHome.vue b/pages/home/menuHome.vue index 3ef7711..21cc225 100644 --- a/pages/home/menuHome.vue +++ b/pages/home/menuHome.vue @@ -90,12 +90,15 @@ }, ], + menu: [], colorList: ['cyan','blue','purple','mauve','pink','brown','red','orange','yellow','olive','olive','grey' ] }; }, onShow() { this.baseUrl = uni.getStorageSync('baseUrl'); this.token = uni.getStorageSync('token'); + this.menu = uni.getStorageSync('menu'); + // console.log(this.menu); this.getAuth() // this.backGroundRepeat() }, @@ -110,6 +113,27 @@ this.elements2[k].color = this.colorList[i] i++ } + }, + getAuth2() { + this.elements = [] + for (let i in this.menu) { + this.getIcon(this.menu[i].title) + this.elements.unshift({ + title: this.menu[i].name, + name: this.menu[i].title, + color: this.colorList[i], + cuIcon: this.icon, + id: this.menu[i].id, + url: `${this.menu[i].code}` + }) + } + this.elements.push({ + title: '閫�鍑虹櫥褰�', + name: 'logOut', + color: 'grey', + cuIcon: 'exit', + url: '/login/logOut' + }) }, getAuth() { let that = this @@ -140,7 +164,6 @@ url: `${res.data[i].code}` }) } - console.log(that.elements); that.elements.push({ title: '閫�鍑虹櫥褰�', name: 'logOut', -- Gitblit v1.9.1