|
|
@@ -216,9 +216,7 @@ export default {
|
|
|
data: res.result,
|
|
|
success: function () {
|
|
|
setTimeout(() => {
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/tabBar/home/home'
|
|
|
- });
|
|
|
+ that.redirectAfterLogin();
|
|
|
}, 1000);
|
|
|
}
|
|
|
});
|
|
|
@@ -241,9 +239,7 @@ export default {
|
|
|
},
|
|
|
() => {
|
|
|
setTimeout(() => {
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/tabBar/home/home'
|
|
|
- });
|
|
|
+ that.redirectAfterLogin();
|
|
|
}, 1000);
|
|
|
}
|
|
|
);
|
|
|
@@ -745,9 +741,7 @@ export default {
|
|
|
let TIMInfo = Cache.get('TIMInfo') || {};
|
|
|
if (TIMInfo.loginStatus !== 'Y') {
|
|
|
messageUtil.loginTim(() => {
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/tabBar/home/home'
|
|
|
- });
|
|
|
+ that.redirectAfterLogin();
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
@@ -860,9 +854,7 @@ export default {
|
|
|
},
|
|
|
() => {
|
|
|
setTimeout(() => {
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/tabBar/home/home'
|
|
|
- });
|
|
|
+ that.redirectAfterLogin();
|
|
|
}, 1000);
|
|
|
}
|
|
|
);
|
|
|
@@ -964,6 +956,26 @@ export default {
|
|
|
console.log(e.detail.encryptedData);
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * 登录成功后根据 groupID 跳转
|
|
|
+ * 有 groupID 跳工作台(workbench),其余跳主页(home)
|
|
|
+ */
|
|
|
+ redirectAfterLogin: function () {
|
|
|
+ let userData = Cache.get('userData') || {};
|
|
|
+ let targetUrl = (userData.groupID == 352) ? '/pages/staticPages/workbench/workbench' : '/pages/tabBar/home/home';
|
|
|
+ if (userData.groupID) {
|
|
|
+ // workbench 非 tabBar 页面,使用 reLaunch 跳转
|
|
|
+ uni.reLaunch({
|
|
|
+ url: targetUrl
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // home 为 tabBar 页面,使用 switchTab 跳转
|
|
|
+ uni.switchTab({
|
|
|
+ url: targetUrl
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
hidePage: function (e, _dataset) {
|
|
|
/* ---处理dataset begin--- */
|
|
|
this.handleDataset(e, _dataset);
|