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
 <template>
1
 <template>
2
   <div class="container">
2
   <div class="container">
3
-
4
     <div class="newLogin">
3
     <div class="newLogin">
5
       <div class="login">
4
       <div class="login">
6
         <div class="logo">
5
         <div class="logo">
38
             :disabled="loginDisable"
37
             :disabled="loginDisable"
39
           >登录</button>
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
           <!-- </router-link> -->
43
           <!-- </router-link> -->
45
           <!-- <div class="forget">
44
           <!-- <div class="forget">
46
           <a href="">免密码登录</a>
45
           <a href="">免密码登录</a>
47
           <a href="">忘记密码?</a>
46
           <a href="">忘记密码?</a>
48
           </div>-->
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
         </div>
52
         </div>
63
       </div>
53
       </div>
64
     </div>
54
     </div>
65
-
66
   </div>
55
   </div>
67
 </template>
56
 </template>
68
 
57
 
154
 
143
 
155
       loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
144
       loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
156
         var resp = rs.data;
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
           cacheLoginInfo(this.form.mobile, this.form.pwd);
151
           cacheLoginInfo(this.form.mobile, this.form.pwd);
160
           console.log(resp);
152
           console.log(resp);
161
 
153
 
219
     //清除cookie
211
     //清除cookie
220
     clearCookie: function() {
212
     clearCookie: function() {
221
       this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
213
       this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
222
-    }, agree() {
214
+    },
215
+    agree() {
223
       this.$router.push({ path: "/privacy" });
216
       this.$router.push({ path: "/privacy" });
224
-
225
     }
217
     }
226
   }
218
   }
227
 };
219
 };

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

35
 
35
 
36
 
36
 
37
 <script>
37
 <script>
38
-    export default {
39
-        name: "privacy"
40
-
41
-    }
38
+export default {
39
+  name: "privacy"
40
+};
42
 </script>
41
 </script>
43
 
42
 
44
 <style lang="scss" scoped>
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
   > div:last-child {
51
   > div:last-child {
53
     flex: 1;
52
     flex: 1;
54
     overflow-y: auto;
53
     overflow-y: auto;
57
     font-size: 0.45rem;
56
     font-size: 0.45rem;
58
     padding: 0.3rem 0.37rem;
57
     padding: 0.3rem 0.37rem;
59
     color: $title-color;
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
     background: #fff;
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
   .name {
78
   .name {
80
     margin-right: 1.3rem;
79
     margin-right: 1.3rem;
90
     width: 90%;
89
     width: 90%;
91
     margin: 0 auto;
90
     margin: 0 auto;
92
   }
91
   }
93
-  }
92
+}
94
 </style>
93
 </style>

+ 9 - 9
src/permission.js View File

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
 router.beforeEach((to, from, next) => {
6
 router.beforeEach((to, from, next) => {
7
   // 线上注释
7
   // 线上注释
8
-//   next()
9
-//   return
8
+  //   next()
9
+  //   return
10
 
10
 
11
   if (store.getters.user.user.id == 0) {
11
   if (store.getters.user.user.id == 0) {
12
     if (loginWhiteList.indexOf(to.path) !== -1) {
12
     if (loginWhiteList.indexOf(to.path) !== -1) {
13
-      next()
13
+      next();
14
     } else {
14
     } else {
15
-      next({ path: '/'})
15
+      next({ path: "/" });
16
     }
16
     }
17
   } else {
17
   } else {
18
-    next()
18
+    next();
19
   }
19
   }
20
-})
20
+});