|
@@ -16,16 +16,16 @@ const jsApiList = [
|
16
|
16
|
|
17
|
17
|
function initSDK (url) {
|
18
|
18
|
request(`/api/wx/jssdk?url=${encodeURIComponent(url)}`)
|
19
|
|
- .then((res) => {
|
20
|
|
- window.wx.config({
|
21
|
|
- debug: process.env.NODE_ENV === 'development', // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
22
|
|
- appId: res.appId, // 必填,公众号的唯一标识
|
23
|
|
- timestamp: res.timestamp, // 必填,生成签名的时间戳
|
24
|
|
- nonceStr: res.nonceStr, // 必填,生成签名的随机串
|
25
|
|
- signature: res.signature, // 必填,签名
|
26
|
|
- jsApiList // 必填,需要使用的JS接口列表
|
|
19
|
+ .then((res) => {
|
|
20
|
+ window.wx.config({
|
|
21
|
+ debug: process.env.NODE_ENV === 'development', // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
22
|
+ appId: res.appId, // 必填,公众号的唯一标识
|
|
23
|
+ timestamp: res.timestamp, // 必填,生成签名的时间戳
|
|
24
|
+ nonceStr: res.nonceStr, // 必填,生成签名的随机串
|
|
25
|
+ signature: res.signature, // 必填,签名
|
|
26
|
+ jsApiList // 必填,需要使用的JS接口列表
|
|
27
|
+ })
|
27
|
28
|
})
|
28
|
|
- })
|
29
|
29
|
}
|
30
|
30
|
// Vue.use(Vuex)
|
31
|
31
|
|
|
@@ -87,7 +87,7 @@ export function Login () {
|
87
|
87
|
console.error(error)
|
88
|
88
|
}
|
89
|
89
|
|
90
|
|
- hideLoading()
|
|
90
|
+ // hideLoading()
|
91
|
91
|
|
92
|
92
|
return;
|
93
|
93
|
})
|
|
@@ -102,7 +102,7 @@ function hideLoading () {
|
102
|
102
|
* 获取 code
|
103
|
103
|
* @returns
|
104
|
104
|
*/
|
105
|
|
- export function getCode () {
|
|
105
|
+export function getCode () {
|
106
|
106
|
const matched = /[?&]*code=([^&]+)/.exec(location.search)
|
107
|
107
|
if (matched) {
|
108
|
108
|
return decodeURIComponent(matched[1])
|
|
@@ -118,7 +118,7 @@ export function redirect (force) {
|
118
|
118
|
const originCode = localStorage.getItem('wxcode');
|
119
|
119
|
const wxfirst = localStorage.getItem('wxfirst') === null;
|
120
|
120
|
const queryCode = getCode();
|
121
|
|
-
|
|
121
|
+
|
122
|
122
|
localStorage.setItem('wxcode', queryCode)
|
123
|
123
|
localStorage.setItem('wxfirst', 'not');
|
124
|
124
|
|