Browse Source

Merge branch 'master' of http://git.ycjcjy.com/dianyang/colmo-h5

李志伟 3 years ago
parent
commit
a04eb809bf
2 changed files with 6 additions and 3 deletions
  1. 1
    1
      src/main.js
  2. 5
    2
      src/utils/initial.js

+ 1
- 1
src/main.js View File

23
 redirect()
23
 redirect()
24
 
24
 
25
 
25
 
26
-Login().then(e => {
26
+Login(getCode()).then(e => {
27
 
27
 
28
 
28
 
29
   new Vue({
29
   new Vue({

+ 5
- 2
src/utils/initial.js View File

67
 export function Login () {
67
 export function Login () {
68
   console.log(store);
68
   console.log(store);
69
 
69
 
70
-  return LoginUser('123',).then(e => {
70
+  const code = node.process.NODE_ENV === 'development' ? '123' : getCode()
71
+
72
+  return LoginUser(code).then(e => {
71
     // PVsum
73
     // PVsum
72
     console.log(e);
74
     console.log(e);
73
     let userInfo = {
75
     let userInfo = {
98
  * 获取 code
100
  * 获取 code
99
  * @returns 
101
  * @returns 
100
  */
102
  */
101
-function getCode () {
103
+ export function getCode () {
102
   const matched = /[?&]*code=([^&]+)/.exec(location.search)
104
   const matched = /[?&]*code=([^&]+)/.exec(location.search)
103
   if (matched) {
105
   if (matched) {
104
     return decodeURIComponent(matched[1])
106
     return decodeURIComponent(matched[1])
105
   }
107
   }
106
 }
108
 }
109
+
107
 /**
110
 /**
108
  * 跳转授权页面
111
  * 跳转授权页面
109
  */
112
  */