login中的一些问题
This commit is contained in:
parent
d895f05b15
commit
2ec21ba4ad
|
|
@ -89,7 +89,9 @@ export async function loginWechatMp<ED extends EntityDict, Cxt extends GeneralRu
|
||||||
entity: 'wechatUser',
|
entity: 'wechatUser',
|
||||||
entityId: wechatUser2.id,
|
entityId: wechatUser2.id,
|
||||||
},
|
},
|
||||||
}, context);
|
}, context, {
|
||||||
|
omitTrigger: true,
|
||||||
|
});
|
||||||
if (token && isEqual(token.env, env)) {
|
if (token && isEqual(token.env, env)) {
|
||||||
await rowStore.operate('token', {
|
await rowStore.operate('token', {
|
||||||
action: 'update',
|
action: 'update',
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export class Token<ED extends EntityDict, Cxt extends GeneralRuntimeContext<ED>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Action
|
@Action
|
||||||
async loginWechatMp(scene: string) {
|
async loginWechatMp() {
|
||||||
await this.rwLock.acquire('X');
|
await this.rwLock.acquire('X');
|
||||||
try {
|
try {
|
||||||
const { code } = await wx.login();
|
const { code } = await wx.login();
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ OakPage({
|
||||||
async onLoginClicked(options: WechatMiniprogram.Touch) {
|
async onLoginClicked(options: WechatMiniprogram.Touch) {
|
||||||
const { code } = await wx.login();
|
const { code } = await wx.login();
|
||||||
const env = await wx.getSystemInfo();
|
const env = await wx.getSystemInfo();
|
||||||
await this.features.token.loginWechatMp('token:login');
|
await this.features.token.loginWechatMp();
|
||||||
},
|
},
|
||||||
|
|
||||||
onReturnClicked() {
|
onReturnClicked() {
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ OakPage(
|
||||||
refreshing: true,
|
refreshing: true,
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await this.features.token.loginWechatMp('token:me');
|
await this.features.token.loginWechatMp();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue