Quellcode durchsuchen

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

csx vor 4 Jahren
Ursprung
Commit
4c2267a47a
3 geänderte Dateien mit 50 neuen und 60 gelöschten Zeilen
  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 Datei anzeigen

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.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
         </div>
52
         </div>
62
       </div>
53
       </div>
63
     </div>
54
     </div>
64
-
65
   </div>
55
   </div>
66
 </template>
56
 </template>
67
 
57
 
134
       });
124
       });
135
     },
125
     },
136
     to: function() {
126
     to: function() {
137
-      this.$router.push({ path: "/forgetPassword" });
127
+      this.$router.push({ path: "/privacy" });
138
     },
128
     },
139
     submitForm() {
129
     submitForm() {
140
       const self = this;
130
       const self = this;
153
 
143
 
154
       loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
144
       loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
155
         var resp = rs.data;
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
           cacheLoginInfo(this.form.mobile, this.form.pwd);
151
           cacheLoginInfo(this.form.mobile, this.form.pwd);
159
           console.log(resp);
152
           console.log(resp);
160
 
153
 
220
       this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
213
       this.setCookie("", "", -1); //修改2值都为空,天数为负1天就好了
221
     },
214
     },
222
     agree() {
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 Datei anzeigen

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 Datei anzeigen

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