修改微信支付无法使用的问题
This commit is contained in:
41
main.js
41
main.js
@ -8,15 +8,8 @@ import dialog from './utils/dialog'
|
|||||||
import cookie from '@/utils/store/cookie'
|
import cookie from '@/utils/store/cookie'
|
||||||
import cuCustom from '@/components/colorui/components/cu-custom.vue'
|
import cuCustom from '@/components/colorui/components/cu-custom.vue'
|
||||||
|
|
||||||
import {
|
import { parseRoute, _router, parseQuery } from '@/utils'
|
||||||
parseRoute,
|
import { VUE_APP_RESOURCES_URL, VUE_APP_API_URL } from '@/config'
|
||||||
_router,
|
|
||||||
parseQuery
|
|
||||||
} from '@/utils'
|
|
||||||
import {
|
|
||||||
VUE_APP_RESOURCES_URL,
|
|
||||||
VUE_APP_API_URL
|
|
||||||
} from '@/config'
|
|
||||||
Vue.component('cu-custom', cuCustom)
|
Vue.component('cu-custom', cuCustom)
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.config.devtools = process.env.NODE_ENV !== 'production'
|
Vue.config.devtools = process.env.NODE_ENV !== 'production'
|
||||||
@ -71,25 +64,9 @@ deviceType = 'routine'
|
|||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// H5编译的代码
|
// H5编译的代码
|
||||||
|
|
||||||
import {
|
import { wechat, clearAuthStatus, oAuth, auth, toAuth, pay, openAddress, openShareAll, openShareAppMessage, openShareTimeline, wechatEvevt, ready, wxShowLocation } from '@/libs/wechat'
|
||||||
wechat,
|
|
||||||
clearAuthStatus,
|
|
||||||
oAuth,
|
|
||||||
auth,
|
|
||||||
toAuth,
|
|
||||||
pay,
|
|
||||||
openAddress,
|
|
||||||
openShareAll,
|
|
||||||
openShareAppMessage,
|
|
||||||
openShareTimeline,
|
|
||||||
wechatEvevt,
|
|
||||||
ready,
|
|
||||||
wxShowLocation
|
|
||||||
} from '@/libs/wechat'
|
|
||||||
|
|
||||||
import {
|
import { isWeixin } from '@/utils'
|
||||||
isWeixin
|
|
||||||
} from '@/utils'
|
|
||||||
const CACHE_KEY = 'clear_0.0.1'
|
const CACHE_KEY = 'clear_0.0.1'
|
||||||
|
|
||||||
if (!cookie.has(CACHE_KEY)) {
|
if (!cookie.has(CACHE_KEY)) {
|
||||||
@ -108,10 +85,9 @@ if (urlSpread) {
|
|||||||
// H5编译的代码
|
// H5编译的代码
|
||||||
// 判断是否是微信浏览器
|
// 判断是否是微信浏览器
|
||||||
async function init() {
|
async function init() {
|
||||||
|
|
||||||
if (isWeixin()) {
|
if (isWeixin()) {
|
||||||
deviceType = 'weixin'
|
deviceType = 'weixin'
|
||||||
let wechatInit = wechat();
|
let wechatInit = wechat()
|
||||||
if (wechatInit) {
|
if (wechatInit) {
|
||||||
await oAuth()
|
await oAuth()
|
||||||
}
|
}
|
||||||
@ -126,9 +102,7 @@ Vue.prototype.$deviceType = deviceType
|
|||||||
|
|
||||||
Vue.mixin({
|
Vue.mixin({
|
||||||
onLoad() {
|
onLoad() {
|
||||||
const {
|
const { $mp } = this.$root
|
||||||
$mp
|
|
||||||
} = this.$root
|
|
||||||
this._route = parseRoute($mp)
|
this._route = parseRoute($mp)
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
@ -140,9 +114,6 @@ Vue.mixin({
|
|||||||
$VUE_APP_RESOURCES_URL() {
|
$VUE_APP_RESOURCES_URL() {
|
||||||
return VUE_APP_RESOURCES_URL
|
return VUE_APP_RESOURCES_URL
|
||||||
},
|
},
|
||||||
$deviceType() {
|
|
||||||
return deviceType
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -508,6 +508,7 @@ export default {
|
|||||||
if (this.$deviceType == 'app') {
|
if (this.$deviceType == 'app') {
|
||||||
from.from = 'app'
|
from.from = 'app'
|
||||||
}
|
}
|
||||||
|
console.log(this.$deviceType)
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
subscribeMessage()
|
subscribeMessage()
|
||||||
// #endif
|
// #endif
|
||||||
|
Reference in New Issue
Block a user