feat: 微信小程序登录改造(手机号授权 + API前缀改为/mp-api + 隐私协议检查)

This commit is contained in:
jacobxu666
2026-06-14 21:54:08 +08:00
parent 6ee484d8a3
commit 3af5f2850d
6 changed files with 60 additions and 29 deletions
+12
View File
@@ -3,6 +3,18 @@ import { onLaunch } from '@dcloudio/uni-app'
import { useUserStore } from './store/user'
onLaunch(() => {
// #ifdef MP-WEIXIN
wx.getPrivacySetting({
success: (res: any) => {
if (res.needAuthorization) {
uni.setStorageSync('needPrivacy', true)
} else {
uni.removeStorageSync('needPrivacy')
}
}
})
// #endif
const userStore = useUserStore()
// 如果有 token,尝试获取用户信息
if (userStore.isLogin) {