weizong song 1 week ago
parent 3ccced9c01
commit 9d39f58d25

@ -6,6 +6,11 @@
// #endif
export default {
data() {
return {
h5LoginInFlight: false
}
},
onLaunch: function() {
console.log('App Launch')
//
@ -153,6 +158,11 @@
// H5
wxH5AuthLogin() {
if (this.h5LoginInFlight) {
console.log('[App] 登录流程进行中,跳过重复调用')
return
}
//
const isWeixinBrowser = /MicroMessenger/i.test(navigator.userAgent)
if (!isWeixinBrowser) {
@ -202,6 +212,8 @@
console.log('[App] 提取到的 code:', code)
if (code) {
this.h5LoginInFlight = true
// URL code
try {
const url = new URL(link)
@ -238,6 +250,9 @@
fail: (err) => {
console.error('[App] 获取 token 失败:', err)
uni.showToast({ title: '网络错误,请重试', icon: 'none' })
},
complete: () => {
this.h5LoginInFlight = false
}
})
} else {

Loading…
Cancel
Save