fix: 根据用户类型跳转对应主页避免强制重定向

This commit is contained in:
yangzhe 2025-12-16 15:37:48 +08:00
parent 38154d6306
commit 2fb1afed4a
1 changed files with 29 additions and 0 deletions

29
App.vue
View File

@ -53,6 +53,35 @@ export default {
return; return;
} }
//
const userType = that.vuex_userType || 0;
const currentPath = that._route.path;
// "/" "/pages/home/index/index""/pages/consultation/index"
//
const isRootPath =
currentPath === "/" ||
currentPath === "/pages/home/index/index" ||
currentPath === "/pages/consultation/index";
if (isRootPath) {
if (userType === 1) {
//
if (currentPath !== "/pages/consultation/index") {
uni.reLaunch({
url: "/pages/consultation/index",
});
}
} else {
//
if (currentPath !== "/pages/home/index/index") {
uni.reLaunch({
url: "/pages/home/index/index",
});
}
}
}
return; return;
if (!that.vuex_user.isFill) { if (!that.vuex_user.isFill) {
this.$u.vuex("vuex_msgList", ""); this.$u.vuex("vuex_msgList", "");