fix: 打手端每次进入均向后端校验手机号认证
This commit is contained in:
@@ -3,6 +3,7 @@ const app = getApp();
|
||||
import request from '../../utils/request.js';
|
||||
import PopupService from '../../services/popupService.js';
|
||||
import { reconnectForRole } from '../../utils/role-tab-bar.js';
|
||||
import { ensurePhoneAuth } from '../../utils/phone-auth.js';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@@ -58,7 +59,10 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
async onShow() {
|
||||
const phoneOk = await ensurePhoneAuth({ redirect: true, role: 'dashou' });
|
||||
if (!phoneOk) return;
|
||||
|
||||
this.registerNotificationComponent();
|
||||
this.loadGlobalStatus();
|
||||
if (wx.getStorageSync('uid')) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// pages/dashou-chongzhi/index.js
|
||||
import request from '../../utils/request';
|
||||
// 引入弹窗服务(路径根据实际调整)
|
||||
import PopupService from '../../services/popupService.js';
|
||||
import { ensurePhoneAuth } from '../../utils/phone-auth.js';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@@ -83,7 +83,10 @@ onHide() {
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
async onShow() {
|
||||
const phoneOk = await ensurePhoneAuth({ redirect: true, role: 'dashou' });
|
||||
if (!phoneOk) return;
|
||||
|
||||
// 每次显示页面都刷新数据
|
||||
this.registerNotificationComponent();
|
||||
this.loadFromGlobalData();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { createPage, request, isRoleStatusActive, isCenterPageActive, syncRoleStatuses, syncProfileFields, syncGroupFields, ensureRoleOnCenterPage, clearCacheAndEnterNormal, lockPrimaryRole, migrateLegacyCenterRole, enterLockedRole, parseSceneOptions } from '../../utils/base-page.js'
|
||||
import { resolveAvatarUrl } from '../../utils/avatar.js'
|
||||
import { openPrivateChat, buildInviterPeerId } from '../../utils/im-user.js'
|
||||
import { ensurePhoneAuth } from '../../utils/phone-auth.js'
|
||||
|
||||
const PLATFORM_INVITE_CODE = '0000008RffVgKHMj7kQC'
|
||||
|
||||
@@ -171,7 +172,10 @@ Page(createPage({
|
||||
this.checkColdStartPopup('dashouduan');
|
||||
},
|
||||
|
||||
onShow() {
|
||||
async onShow() {
|
||||
const phoneOk = await ensurePhoneAuth({ redirect: true, role: 'dashou' });
|
||||
if (!phoneOk) return;
|
||||
|
||||
migrateLegacyCenterRole(getApp());
|
||||
lockPrimaryRole('dashou', getApp());
|
||||
wx.setStorageSync('isJinpai', 0);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { submit } from '../../utils/phone-auth';
|
||||
import { submit, getPhoneAuthReturnPage } from '../../utils/phone-auth';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@@ -27,8 +27,7 @@ Page({
|
||||
wx.showLoading({ title: '认证中...', mask: true });
|
||||
await submit(phoneCode, avatarFile);
|
||||
wx.hideLoading();
|
||||
// 成功,重启小程序,此时check返回false,用户无感进入
|
||||
wx.reLaunch({ url: '/pages/index/index' });
|
||||
wx.reLaunch({ url: getPhoneAuthReturnPage() });
|
||||
} catch (e) {
|
||||
wx.hideLoading();
|
||||
wx.showToast({ title: e.message, icon: 'none' });
|
||||
@@ -37,4 +36,4 @@ Page({
|
||||
exit() {
|
||||
wx.exitMiniProgram();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user