login中的一些问题

This commit is contained in:
Xu Chang 2022-06-22 13:48:37 +08:00
parent d895f05b15
commit 2ec21ba4ad
4 changed files with 6 additions and 4 deletions

View File

@ -89,7 +89,9 @@ export async function loginWechatMp<ED extends EntityDict, Cxt extends GeneralRu
entity: 'wechatUser',
entityId: wechatUser2.id,
},
}, context);
}, context, {
omitTrigger: true,
});
if (token && isEqual(token.env, env)) {
await rowStore.operate('token', {
action: 'update',

View File

@ -38,7 +38,7 @@ export class Token<ED extends EntityDict, Cxt extends GeneralRuntimeContext<ED>,
}
@Action
async loginWechatMp(scene: string) {
async loginWechatMp() {
await this.rwLock.acquire('X');
try {
const { code } = await wx.login();

View File

@ -28,7 +28,7 @@ OakPage({
async onLoginClicked(options: WechatMiniprogram.Touch) {
const { code } = await wx.login();
const env = await wx.getSystemInfo();
await this.features.token.loginWechatMp('token:login');
await this.features.token.loginWechatMp();
},
onReturnClicked() {

View File

@ -101,7 +101,7 @@ OakPage(
refreshing: true,
});
try {
await this.features.token.loginWechatMp('token:me');
await this.features.token.loginWechatMp();
} catch (err) {
console.error(err);
}