fix: 打手端每次进入均向后端校验手机号认证
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
/** 三端固定:normal | dashou | shangjia,认证后不可回退 */
|
||||
|
||||
import { ensurePhoneAuth } from './phone-auth.js';
|
||||
|
||||
const VALID = ['normal', 'dashou', 'shangjia'];
|
||||
const LEGACY_CENTER_ROLES = ['guanshi', 'zuzhang', 'kaoheguan'];
|
||||
|
||||
@@ -87,8 +89,7 @@ export const PRIMARY_DEFAULT_PAGES = {
|
||||
};
|
||||
|
||||
/** 锁定主端并跳转到该端默认首页,同时建立 IM 长连接 */
|
||||
export function enterLockedRole(role, app) {
|
||||
if (!VALID.includes(role) || role === 'normal') return false;
|
||||
function finishEnterLockedRole(role, app) {
|
||||
app = app || getApp();
|
||||
lockPrimaryRole(role, app);
|
||||
wx.reLaunch({ url: PRIMARY_DEFAULT_PAGES[role] });
|
||||
@@ -103,3 +104,14 @@ export function enterLockedRole(role, app) {
|
||||
}, 600);
|
||||
return true;
|
||||
}
|
||||
|
||||
export function enterLockedRole(role, app) {
|
||||
if (!VALID.includes(role) || role === 'normal') return false;
|
||||
if (role === 'dashou') {
|
||||
ensurePhoneAuth({ redirect: true, role: 'dashou' }).then((ok) => {
|
||||
if (ok) finishEnterLockedRole(role, app);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return finishEnterLockedRole(role, app);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user