Przeglądaj źródła

Merge branch 'new_pad_branch' of http://git.shengws.com/zhangbj/xt_pad into new_pad_branch

csx 4 lat temu
rodzic
commit
4c2267a47a
3 zmienionych plików z 50 dodań i 60 usunięć
  1. 13 22
      src/pages/home/login.vue
  2. 28 29
      src/pages/privacy/index.vue
  3. 9 9
      src/permission.js

+ 13 - 22
src/pages/home/login.vue Wyświetl plik

@@ -1,6 +1,5 @@
1 1
 <template>
2 2
   <div class="container">
3
-
4 3
     <div class="newLogin">
5 4
       <div class="login">
6 5
         <div class="logo">
@@ -38,30 +37,21 @@
38 37
             :disabled="loginDisable"
39 38
           >登录</button>
40 39
 
41
-          <!-- <router-link to="/forgetPassword"> -->
42
-          <div class="newForget" style="display:none">忘记密码</div>
43
-          <!-- </router-link> -->
40
+          <!-- <router-link to="/forgetPassword">
41
+            <div class="newForget">忘记密码</div>
42
+          </router-link>-->
44 43
           <!-- </router-link> -->
45 44
           <!-- <div class="forget">
46 45
           <a href="">免密码登录</a>
47 46
           <a href="">忘记密码?</a>
48 47
           </div>-->
49
-          <!--<div class="agree">-->
50
-            <!--<el-checkbox v-model="agreement">-->
51
-              <!--我已阅读并同意-->
52
-              <!--&lt;!&ndash; <router-link to="/privacyPolicy"> &ndash;&gt;-->
53
-
54
-              <!--&lt;!&ndash; </router-link> &ndash;&gt;-->
55
-            <!--</el-checkbox>-->
56
-            <!--&lt;!&ndash; <router-link to="/privacyPolicy"> &ndash;&gt;-->
57
-            <!--&lt;!&ndash; </router-link> &ndash;&gt;-->
58
-          <!--</div>-->
59
-            <span  class="agreeText" @click.native="agree">《隐私服务协议》</span>
60
-
48
+          <div class="agree">
49
+            <el-checkbox v-model="agreement">我已阅读并同意</el-checkbox>
50
+            <span class="agreeText" @click="agree()">《隐私服务协议》</span>
51
+          </div>
61 52
         </div>
62 53
       </div>
63 54
     </div>
64
-
65 55
   </div>
66 56
 </template>
67 57
 
@@ -134,7 +124,7 @@ export default {
134 124
       });
135 125
     },
136 126
     to: function() {
137
-      this.$router.push({ path: "/forgetPassword" });
127
+      this.$router.push({ path: "/privacy" });
138 128
     },
139 129
     submitForm() {
140 130
       const self = this;
@@ -153,8 +143,11 @@ export default {
153 143
 
154 144
       loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
155 145
         var resp = rs.data;
146
+        if (this.agreement != true) {
147
+          Toast("请同意隐私服务协议");
148
+        }
156 149
 
157
-        if (resp.state == 1) {
150
+        if (resp.state == 1 && this.agreement == true) {
158 151
           cacheLoginInfo(this.form.mobile, this.form.pwd);
159 152
           console.log(resp);
160 153
 
@@ -220,9 +213,7 @@ export default {
220 213
       this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
221 214
     },
222 215
     agree() {
223
-      this.$nextTick(() => {
224
-        this.$router.push({ path: "/privacy" });
225
-      })
216
+      this.$router.push({ path: "/privacy" });
226 217
     }
227 218
   }
228 219
 };

+ 28 - 29
src/pages/privacy/index.vue Wyświetl plik

@@ -35,20 +35,19 @@
35 35
 
36 36
 
37 37
 <script>
38
-    export default {
39
-        name: "privacy"
40
-
41
-    }
38
+export default {
39
+  name: "privacy"
40
+};
42 41
 </script>
43 42
 
44 43
 <style lang="scss" scoped>
45
-  .page_privacy {
46
-    width: 100%;
47
-    margin: 0 auto;
48
-    height: 100%;
49
-    overflow-y: auto;
50
-    display: flex;
51
-    flex-direction: column;
44
+.page_privacy {
45
+  width: 100%;
46
+  margin: 0 auto;
47
+  height: 100%;
48
+  overflow-y: auto;
49
+  display: flex;
50
+  flex-direction: column;
52 51
   > div:last-child {
53 52
     flex: 1;
54 53
     overflow-y: auto;
@@ -57,24 +56,24 @@
57 56
     font-size: 0.45rem;
58 57
     padding: 0.3rem 0.37rem;
59 58
     color: $title-color;
60
-  @include align-items-center;
61
-  @include display-flex;
62
-  @include justify-content-between;
63
-  @include text-align;
59
+    @include align-items-center;
60
+    @include display-flex;
61
+    @include justify-content-between;
62
+    @include text-align;
64 63
     background: #fff;
65
-  .GoBack {
66
-    color: $main-color;
67
-    font-size: 0.45rem;
68
-  @include display-flex;
69
-  .iconfont {
70
-    color: $main-color;
71
-    font-size: 0.5rem;
72
-    margin-top: 1px;
73
-  @media only screen and (min-width: 768px) {
74
-    margin-top: 3px;
75
-  }
76
-  }
77
-  }
64
+    .GoBack {
65
+      color: $main-color;
66
+      font-size: 0.45rem;
67
+      @include display-flex;
68
+      .iconfont {
69
+        color: $main-color;
70
+        font-size: 0.5rem;
71
+        margin-top: 1px;
72
+        @media only screen and (min-width: 768px) {
73
+          margin-top: 3px;
74
+        }
75
+      }
76
+    }
78 77
   }
79 78
   .name {
80 79
     margin-right: 1.3rem;
@@ -90,5 +89,5 @@
90 89
     width: 90%;
91 90
     margin: 0 auto;
92 91
   }
93
-  }
92
+}
94 93
 </style>

+ 9 - 9
src/permission.js Wyświetl plik

@@ -1,20 +1,20 @@
1
-import router from './router'
2
-import store from './store'
1
+import router from "./router";
2
+import store from "./store";
3 3
 
4
-const loginWhiteList = ['/'] // 登录验证白名单
4
+const loginWhiteList = ["/", "/privacy", "/forgetPassword"]; // 登录验证白名单
5 5
 
6 6
 router.beforeEach((to, from, next) => {
7 7
   // 线上注释
8
-//   next()
9
-//   return
8
+  //   next()
9
+  //   return
10 10
 
11 11
   if (store.getters.user.user.id == 0) {
12 12
     if (loginWhiteList.indexOf(to.path) !== -1) {
13
-      next()
13
+      next();
14 14
     } else {
15
-      next({ path: '/'})
15
+      next({ path: "/" });
16 16
     }
17 17
   } else {
18
-    next()
18
+    next();
19 19
   }
20
-})
20
+});