Commit 68155df3 by xinla

--no commit message

1 parent ddc1e70c
...@@ -59,14 +59,14 @@ export function getQueryValue(name) { ...@@ -59,14 +59,14 @@ export function getQueryValue(name) {
export async function getWxCode() { export async function getWxCode() {
let userinfo = localStorage.getItem('userinfo') let userinfo = localStorage.getItem('userinfo')
//取缓存中的用户信息 //取缓存中的用户信息
// if (userinfo) { if (userinfo) {
// try { try {
// userinfo = JSON.parse(userinfo) userinfo = JSON.parse(userinfo)
// } catch (error) { } catch (error) {
// alert(error) alert(error)
// } }
// return userinfo.openId return userinfo.openId
// } }
//缓存中没有用户信息,进入授权流程 //缓存中没有用户信息,进入授权流程
let appid = window.CONFIG.appId // 公众号appid let appid = window.CONFIG.appId // 公众号appid
......
...@@ -45,14 +45,18 @@ export default { ...@@ -45,14 +45,18 @@ export default {
duration: 0, duration: 0,
forbidClick: true, forbidClick: true,
}) })
getWxCode().then((openId) => { getWxCode()
.then((openId) => {
if (openId) { if (openId) {
this.openId = openId this.openId = openId
this.getRedPacketInfo() this.getRedPacketInfo()
} else { } else {
this.$toast('授权异常,请刷新重试') this.$toast.clear()
} }
}) })
.catch(() => {
this.$toast('授权异常,请刷新重试')
})
}, },
getRedPacketInfo() { getRedPacketInfo() {
getRedPacketInfo().then(({ data }) => { getRedPacketInfo().then(({ data }) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!