Browse Source

隐私服务协议

See999 4 years ago
parent
commit
1bfdfe44f0
3 changed files with 50 additions and 59 deletions
  1. 13 21
      src/pages/home/login.vue
  2. 28 29
      src/pages/privacy/index.vue
  3. 9 9
      src/permission.js

+ 13 - 21
src/pages/home/login.vue View File

@@ -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,31 +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="agree()">《隐私服务协议》</span>
60
-
61
-
48
+          <div class="agree">
49
+            <el-checkbox v-model="agreement">我已阅读并同意</el-checkbox>
50
+            <span class="agreeText" @click="agree()">《隐私服务协议》</span>
51
+          </div>
62 52
         </div>
63 53
       </div>
64 54
     </div>
65
-
66 55
   </div>
67 56
 </template>
68 57
 
@@ -154,8 +143,11 @@ export default {
154 143
 
155 144
       loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
156 145
         var resp = rs.data;
146
+        if (this.agreement != true) {
147
+          Toast("请同意隐私服务协议");
148
+        }
157 149
 
158
-        if (resp.state == 1) {
150
+        if (resp.state == 1 && this.agreement == true) {
159 151
           cacheLoginInfo(this.form.mobile, this.form.pwd);
160 152
           console.log(resp);
161 153
 
@@ -219,9 +211,9 @@ export default {
219 211
     //清除cookie
220 212
     clearCookie: function() {
221 213
       this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
222
-    }, agree() {
214
+    },
215
+    agree() {
223 216
       this.$router.push({ path: "/privacy" });
224
-
225 217
     }
226 218
   }
227 219
 };

+ 28 - 29
src/pages/privacy/index.vue View File

@@ -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 View File

@@ -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
+});