浏览代码

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

李志伟 3 年前
父节点
当前提交
a04eb809bf
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 1
    1
      src/main.js
  2. 5
    2
      src/utils/initial.js

+ 1
- 1
src/main.js 查看文件

@@ -23,7 +23,7 @@ Vue.component('swiper-slide', SwiperSlide)
23 23
 redirect()
24 24
 
25 25
 
26
-Login().then(e => {
26
+Login(getCode()).then(e => {
27 27
 
28 28
 
29 29
   new Vue({

+ 5
- 2
src/utils/initial.js 查看文件

@@ -67,7 +67,9 @@ export function share (opt) {
67 67
 export function Login () {
68 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 73
     // PVsum
72 74
     console.log(e);
73 75
     let userInfo = {
@@ -98,12 +100,13 @@ function hideLoading () {
98 100
  * 获取 code
99 101
  * @returns 
100 102
  */
101
-function getCode () {
103
+ export function getCode () {
102 104
   const matched = /[?&]*code=([^&]+)/.exec(location.search)
103 105
   if (matched) {
104 106
     return decodeURIComponent(matched[1])
105 107
   }
106 108
 }
109
+
107 110
 /**
108 111
  * 跳转授权页面
109 112
  */