Commit a761c755 authored by chenkai1's avatar chenkai1
parents eb1d9ebf ded041db
......@@ -52,7 +52,9 @@ const globalStore = useGlobalStore()
// 登录获取 cuk
const wxAutoLogin = async () => {
await userStore.wxAutoLogin()
await new Promise(resolve => {
userStore.wxAutoLogin(resolve)
})
}
// 接收webview消息
......
......@@ -236,16 +236,17 @@ export const useUserStore = defineStore("userInfo", {
}
},
/**
/**
* 用户自动登录
*/
async wxAutoLogin() {
async wxAutoLogin(cb=null) {
uni.login({
provider: "weixin",
success: async (res) => {
console.log("wxAutoLogin", res);
if (res.errMsg === "login:ok") {
await this.autoLoginByCode(res.code);
cb && cb();
} else {
uni.showToast({
title: res.errMsg,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment