Commit d1600036 by 胡悦

修复

1 parent 3111b7b0
Showing 1 changed file with 11 additions and 11 deletions
...@@ -27,6 +27,7 @@ App({ ...@@ -27,6 +27,7 @@ App({
}, },
login(returnResponse) { login(returnResponse) {
let _this = this let _this = this
let openId = null
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wx.login({ wx.login({
success({ success({
...@@ -38,7 +39,7 @@ App({ ...@@ -38,7 +39,7 @@ App({
}).then(res => { }).then(res => {
wx.$authStatus = res.code != 0 wx.$authStatus = res.code != 0
util.setSessionId(res.data.sessionId) util.setSessionId(res.data.sessionId)
const openId = res.data.openId openId = res.data.openId
util.setStorageSync('openId', openId) util.setStorageSync('openId', openId)
ssoApi.getUserInfo({ ssoApi.getUserInfo({
openId openId
...@@ -54,20 +55,19 @@ App({ ...@@ -54,20 +55,19 @@ App({
resolve(result) resolve(result)
} }
}) })
if (wx.$trackData.scene) {
_this.getScene(wx.$trackData.scene).then(res => {
wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, openId)
})
}
}).catch(() => { }).catch(() => {
wx.$authStatus = true wx.$authStatus = true
reject() reject()
}) })
if (wx.$trackData.scene) {
_this.getScene(wx.$trackData.scene).then(res => {
wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId
const systemInfo = JSON.parse(wx.getStorageSync('aicard_system_info'))
wx.$trackData.type = systemInfo.environment ? 2 : 1
wx.$Track.sendTrack(trackData.COMPANY, openId)
})
}
} }
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!