|
@@ -138,32 +138,15 @@ export const useUserInfo = defineStore('userInfo', {
|
|
|
resolve(userInfos)
|
|
resolve(userInfos)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- async setOpenId(code: string) {
|
|
|
|
|
-
|
|
|
|
|
- if(this.openIdFlag || this.openId) return
|
|
|
|
|
- const openId = localStorage.getItem('openId')
|
|
|
|
|
- const unionId = localStorage.getItem('unionId')
|
|
|
|
|
-
|
|
|
|
|
- if(openId && unionId) {
|
|
|
|
|
- this.openId = openId
|
|
|
|
|
- this.unionId = unionId
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.openIdFlag = true
|
|
|
|
|
- const [err, res]: ToResponse = await to(sysApi.getOpenId({ code }))
|
|
|
|
|
- if (err) {
|
|
|
|
|
- this.openIdFlag = false
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- this.openId = res?.data?.openid || ''
|
|
|
|
|
- this.unionId = res?.data?.unionid || ''
|
|
|
|
|
-
|
|
|
|
|
- localStorage.setItem('openId', this.openId)
|
|
|
|
|
- localStorage.setItem('unionId', this.unionId)
|
|
|
|
|
- this.openIdFlag = false
|
|
|
|
|
|
|
+ async setOpenId(_code: string) {
|
|
|
|
|
+ // WeChat openid exchange is disabled.
|
|
|
|
|
+ return
|
|
|
},
|
|
},
|
|
|
async getSdkConfig() {
|
|
async getSdkConfig() {
|
|
|
- const [err, res]: ToResponse = await to(sysApi.getSDKTicket({ url: window.location.href }))
|
|
|
|
|
|
|
+ // WeChat JS SDK ticket initialization is disabled; do not call /wechat/ticket.
|
|
|
|
|
+ return
|
|
|
|
|
+ /*
|
|
|
|
|
+ const [err, res]: ToResponse = await to(Promise.resolve({ data: {} }))
|
|
|
if (err) return
|
|
if (err) return
|
|
|
this.sdkConfig = res?.data
|
|
this.sdkConfig = res?.data
|
|
|
wx.config({
|
|
wx.config({
|
|
@@ -189,6 +172,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|
|
// showCancelButton: false
|
|
// showCancelButton: false
|
|
|
// })
|
|
// })
|
|
|
// })
|
|
// })
|
|
|
|
|
+ */
|
|
|
},
|
|
},
|
|
|
scanCode(needResult:0 | 1 = 1) {
|
|
scanCode(needResult:0 | 1 = 1) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|