修复订阅授权返回后生成中断
生成动作先进入拼图进度页并立即发起生成 订阅授权改为非阻塞尝试,避免闪回卡住提交 移除订阅结果回写 web-view URL 导致回首页的逻辑 更新小程序订阅消息授权与发送边界文档
This commit is contained in:
@@ -15,7 +15,6 @@ const MINI_PROGRAM_CLIENT_TYPE = 'mini_program';
|
||||
const MINI_PROGRAM_CLIENT_RUNTIME = 'wechat_mini_program';
|
||||
const CLIENT_INSTANCE_STORAGE_KEY = 'genarrative:mini-program-client-instance-id';
|
||||
const PAY_RESULT_STORAGE_KEY = 'genarrative:wechat-pay-result';
|
||||
const SUBSCRIBE_RESULT_STORAGE_KEY = 'genarrative:wechat-subscribe-result';
|
||||
const AUTH_RESULT_STORAGE_KEY = 'genarrative:mini-program-auth-result';
|
||||
const AUTH_ACTION_LOGIN = 'login';
|
||||
const PAY_RESULT_RECHECK_DELAY_MS = 120;
|
||||
@@ -606,10 +605,8 @@ Page({
|
||||
}
|
||||
|
||||
this.consumePayResult();
|
||||
this.consumeSubscribeResult();
|
||||
setTimeout(() => {
|
||||
this.consumePayResult();
|
||||
this.consumeSubscribeResult();
|
||||
}, PAY_RESULT_RECHECK_DELAY_MS);
|
||||
},
|
||||
|
||||
@@ -625,18 +622,6 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
consumeSubscribeResult() {
|
||||
const result = wx.getStorageSync(SUBSCRIBE_RESULT_STORAGE_KEY);
|
||||
if (result && this.data.webViewUrl) {
|
||||
wx.removeStorageSync(SUBSCRIBE_RESULT_STORAGE_KEY);
|
||||
this.setData({
|
||||
webViewUrl: appendHashParams(this.data.webViewUrl, {
|
||||
wx_subscribe_result: result,
|
||||
}),
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
async handleGetPhoneNumber(event) {
|
||||
if (!this.data.authResult || !this.data.authResult.token) {
|
||||
this.handleRetryLogin();
|
||||
|
||||
Reference in New Issue
Block a user