|
@@ -29,7 +29,8 @@ if (query.code) {
|
|
|
.then((res: any) => {
|
|
.then((res: any) => {
|
|
|
wx.config({
|
|
wx.config({
|
|
|
...res,
|
|
...res,
|
|
|
- jsApiList: ['chooseWXPay', 'updateAppMessageShareData', 'updateTimelineShareData']
|
|
|
|
|
|
|
+ jsApiList: ['chooseWXPay', 'updateAppMessageShareData', 'updateTimelineShareData'],
|
|
|
|
|
+ debug: true
|
|
|
})
|
|
})
|
|
|
wx.ready(function () {
|
|
wx.ready(function () {
|
|
|
// fetchPay(openid).then((params: any) => {
|
|
// fetchPay(openid).then((params: any) => {
|
|
@@ -56,7 +57,7 @@ if (query.code) {
|
|
|
})
|
|
})
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
console.log(e)
|
|
console.log(e)
|
|
|
- if (e.message.indexOf('code been used') !== -1) {
|
|
|
|
|
|
|
+ if (e.message.indexOf('code been used') !== -1 || e.message.indexOf('invalid code') !== -1) {
|
|
|
if (isWechat) {
|
|
if (isWechat) {
|
|
|
fetchRedirectUrl().then(res => {
|
|
fetchRedirectUrl().then(res => {
|
|
|
const str = String(res).replace(
|
|
const str = String(res).replace(
|