修改公众号微信登录授权未保存token的问题

This commit is contained in:
Gaoxs
2020-08-19 20:03:28 +08:00
parent 0c50a9ebb2
commit 48e073d573
8 changed files with 117 additions and 36 deletions

31
main.js
View File

@ -84,17 +84,46 @@ Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
// #ifdef H5
// H5编译的代码
import { wechat, oAuth } from '@/libs/wechat'
import {
wechat,
clearAuthStatus,
oAuth,
auth,
toAuth,
pay,
openAddress,
openShareAll,
openShareAppMessage,
openShareTimeline,
wechatEvevt,
ready,
wxShowLocation,
} from '@/libs/wechat'
import { isWeixin } from '@/utils'
// 判断是否是微信浏览器
if (isWeixin()) {
Vue.prototype.$deviceType = 'weixin'
store.commit('updateDevicetype', 'weixin')
// wechat().then(() => oAuth());
} else {
Vue.prototype.$deviceType = 'weixinh5'
store.commit('updateDevicetype', 'weixinh5')
}
Vue.prototype.wechat = wechat
Vue.prototype.clearAuthStatus = clearAuthStatus
Vue.prototype.oAuth = oAuth
Vue.prototype.auth = auth
Vue.prototype.toAuth = toAuth
Vue.prototype.pay = pay
Vue.prototype.openAddress = openAddress
Vue.prototype.openShareAll = openShareAll
Vue.prototype.openShareAppMessage = openShareAppMessage
Vue.prototype.openShareTimeline = openShareTimeline
Vue.prototype.wechatEvevt = wechatEvevt
Vue.prototype.ready = ready
Vue.prototype.wxShowLocation = wxShowLocation
// #endif
// #ifdef APP-PLUS