From 31e6b27fc0b7fb2ae715efa4287d8f5539f33d78 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 27 Oct 2023 15:10:53 +0800
Subject: [PATCH] 角色切换,保存菜单至store

---
 subPackage/user/role/index.vue |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/subPackage/user/role/index.vue b/subPackage/user/role/index.vue
index 853c0ea..837cb40 100644
--- a/subPackage/user/role/index.vue
+++ b/subPackage/user/role/index.vue
@@ -66,6 +66,8 @@
 			},
 
 			async submit() {
+				const that = this
+
 				//保存当前激活的角色
 				store.commit("setActiveRoleId", this.selectRole.id)
 
@@ -76,9 +78,23 @@
 				let data = res.data
 				const appMenu = data.filter(e => e.name == 'app')[0]
 				console.log("菜单:", appMenu)
+				store.commit("SET_MENU", appMenu)
 
 
-				this.$u.func.showToast("切换角色成功")
+
+				uni.showToast({
+					title: "切换身份成功",
+					icon: "success",
+					duration: data.duration || 1500,
+					success: () => {
+						setTimeout(() => {
+							this.$u.func.globalNavigator("/pages/home/index", "switchTab")
+						}, data.duration || 1500)
+					}
+				})
+
+
+
 			}
 		}
 	}

--
Gitblit v1.9.3