|
|
@@ -15,7 +15,9 @@
|
|
15
|
15
|
display: inline-block;
|
|
16
|
16
|
"
|
|
17
|
17
|
/>-->
|
|
18
|
|
- <img src="../../assets/wisdom_images/qhLoginLogo.png"/>
|
|
|
18
|
+ <!-- <img src="../../assets/wisdom_images/qhLoginLogo.png"/> -->
|
|
|
19
|
+ <!-- logins -->
|
|
|
20
|
+ <img style="width: 100%" src="../../assets/wisdom_images/logins.png" />
|
|
19
|
21
|
</div>
|
|
20
|
22
|
</div>
|
|
21
|
23
|
<div class="login_main">
|
|
|
@@ -186,9 +188,9 @@
|
|
186
|
188
|
// import Cookies from 'js-cookie'
|
|
187
|
189
|
// import axios from "axios";
|
|
188
|
190
|
import { getVerify, getCurrUserDetails } from "@/api/login/login";
|
|
189
|
|
-import {getFunc, getFuncByUserId} from "@/api/user";
|
|
|
191
|
+import { getFunc, getFuncByUserId } from "@/api/user";
|
|
190
|
192
|
// @TODO 假 token 目前以 session 方式验证用户,后期改为 token
|
|
191
|
|
-const MOCK_TOKEN = "123"
|
|
|
193
|
+const MOCK_TOKEN = "123";
|
|
192
|
194
|
export default {
|
|
193
|
195
|
components: {},
|
|
194
|
196
|
name: "login",
|
|
|
@@ -257,17 +259,14 @@ export default {
|
|
257
|
259
|
// }
|
|
258
|
260
|
},
|
|
259
|
261
|
async getVerifyFn() {
|
|
260
|
|
- const data = await getVerify()
|
|
261
|
|
- const base64 = data.file
|
|
262
|
|
- this.img = `data:image/png;base64,${base64}`
|
|
|
262
|
+ const data = await getVerify();
|
|
|
263
|
+ const base64 = data.file;
|
|
|
264
|
+ this.img = `data:image/png;base64,${base64}`;
|
|
263
|
265
|
},
|
|
264
|
266
|
keyupEnter() {
|
|
265
|
267
|
document.onkeydown = (e) => {
|
|
266
|
268
|
let body = document.getElementsByTagName("body")[0];
|
|
267
|
|
- if (
|
|
268
|
|
- (e.keyCode === 13) &&
|
|
269
|
|
- this.$route.path == "/login"
|
|
270
|
|
- ) {
|
|
|
269
|
+ if (e.keyCode === 13 && this.$route.path == "/login") {
|
|
271
|
270
|
console.log("enter");
|
|
272
|
271
|
this.handleLogin();
|
|
273
|
272
|
}
|
|
|
@@ -280,56 +279,68 @@ export default {
|
|
280
|
279
|
this.loading = true;
|
|
281
|
280
|
let password = this.loginForm.password;
|
|
282
|
281
|
const data = {
|
|
283
|
|
- ... this.loginForm
|
|
284
|
|
- }
|
|
|
282
|
+ ...this.loginForm,
|
|
|
283
|
+ };
|
|
285
|
284
|
data.password = this.$md5(this.loginForm.password);
|
|
286
|
285
|
this.$store
|
|
287
|
286
|
.dispatch("Login", data)
|
|
288
|
287
|
.then((response) => {
|
|
289
|
288
|
sessionStorage.menuIdx = 0;
|
|
290
|
|
- if (response.status) { // 登录成功
|
|
291
|
|
- sessionStorage.setItem('TOKENL', MOCK_TOKEN)
|
|
292
|
|
- this.$store.dispatch('GetInfo').then(_ => {
|
|
293
|
|
- this.loading = false;
|
|
294
|
|
- this.$systemUtils.updateUserNamePwd(this.loginForm.name, this.loginForm.password)
|
|
|
289
|
+ if (response.status) {
|
|
|
290
|
+ // 登录成功
|
|
|
291
|
+ sessionStorage.setItem("TOKENL", MOCK_TOKEN);
|
|
|
292
|
+ this.$store
|
|
|
293
|
+ .dispatch("GetInfo")
|
|
|
294
|
+ .then((_) => {
|
|
|
295
|
+ this.loading = false;
|
|
|
296
|
+ this.$systemUtils.updateUserNamePwd(
|
|
|
297
|
+ this.loginForm.name,
|
|
|
298
|
+ this.loginForm.password
|
|
|
299
|
+ );
|
|
295
|
300
|
|
|
296
|
|
- getFunc({}).then(all => {
|
|
297
|
|
- const allTree = this.$systemUtils.buildFuncTree(all)
|
|
298
|
|
- const setting = allTree.find(d => d.funcName == '系统管理')
|
|
299
|
|
- console.log('系统管理', allTree, setting)
|
|
300
|
|
- getFuncByUserId().then(resp => {
|
|
301
|
|
- const tree = this.$systemUtils.buildFuncTree(resp)
|
|
302
|
|
- tree.push(setting)
|
|
303
|
|
- console.log('aaaaaaa', resp, tree)
|
|
304
|
|
- sessionStorage.setItem('FUN_RAW', JSON.stringify(resp))
|
|
305
|
|
- sessionStorage.setItem('FUN_TREE', JSON.stringify(tree))
|
|
306
|
|
- this.$router.push({
|
|
307
|
|
- path: "/home",
|
|
|
301
|
+ getFunc({}).then((all) => {
|
|
|
302
|
+ const allTree = this.$systemUtils.buildFuncTree(all);
|
|
|
303
|
+ const setting = allTree.find(
|
|
|
304
|
+ (d) => d.funcName == "系统管理"
|
|
|
305
|
+ );
|
|
|
306
|
+ console.log("系统管理", allTree, setting);
|
|
|
307
|
+ getFuncByUserId().then((resp) => {
|
|
|
308
|
+ const tree = this.$systemUtils.buildFuncTree(resp);
|
|
|
309
|
+ tree.push(setting);
|
|
|
310
|
+ console.log("aaaaaaa", resp, tree);
|
|
|
311
|
+ sessionStorage.setItem("FUN_RAW", JSON.stringify(resp));
|
|
|
312
|
+ sessionStorage.setItem(
|
|
|
313
|
+ "FUN_TREE",
|
|
|
314
|
+ JSON.stringify(tree)
|
|
|
315
|
+ );
|
|
|
316
|
+ this.$router.push({
|
|
|
317
|
+ path: "/home",
|
|
|
318
|
+ });
|
|
308
|
319
|
});
|
|
309
|
|
- })
|
|
310
|
|
- })
|
|
|
320
|
+ });
|
|
311
|
321
|
|
|
312
|
|
- // getFuncByUserId().then(resp => {
|
|
313
|
|
- // const tree = this.$systemUtils.buildFuncTree(resp)
|
|
314
|
|
- // console.log('aaaaaaa', resp, tree)
|
|
315
|
|
- // sessionStorage.setItem('FUN_RAW', JSON.stringify(resp))
|
|
316
|
|
- // sessionStorage.setItem('FUN_TREE', JSON.stringify(tree))
|
|
317
|
|
- // this.$router.push({
|
|
318
|
|
- // path: "/home",
|
|
319
|
|
- // });
|
|
320
|
|
- // })
|
|
321
|
|
-
|
|
322
|
|
- }).catch(_ => {
|
|
323
|
|
- this.getVerifyFn()
|
|
324
|
|
- this.$message({
|
|
325
|
|
- type: "warning",
|
|
326
|
|
- message: '无法获取用户信息,请重新登录',
|
|
|
322
|
+ // getFuncByUserId().then(resp => {
|
|
|
323
|
+ // const tree = this.$systemUtils.buildFuncTree(resp)
|
|
|
324
|
+ // console.log('aaaaaaa', resp, tree)
|
|
|
325
|
+ // sessionStorage.setItem('FUN_RAW', JSON.stringify(resp))
|
|
|
326
|
+ // sessionStorage.setItem('FUN_TREE', JSON.stringify(tree))
|
|
|
327
|
+ // this.$router.push({
|
|
|
328
|
+ // path: "/home",
|
|
|
329
|
+ // });
|
|
|
330
|
+ // })
|
|
|
331
|
+ })
|
|
|
332
|
+ .catch((_) => {
|
|
|
333
|
+ this.getVerifyFn();
|
|
|
334
|
+ this.$message({
|
|
|
335
|
+ type: "warning",
|
|
|
336
|
+ message: "无法获取用户信息,请重新登录",
|
|
|
337
|
+ });
|
|
|
338
|
+ this.loading = false;
|
|
327
|
339
|
});
|
|
328
|
|
- this.loading = false;
|
|
329
|
|
- })
|
|
330
|
340
|
this.rememberPasswordFn(password);
|
|
331
|
341
|
this.showDialog = true;
|
|
332
|
|
- } else { // 登录失败
|
|
|
342
|
+ } else {
|
|
|
343
|
+ // 登录失败
|
|
333
|
344
|
this.getVerifyFn();
|
|
334
|
345
|
this.$message({
|
|
335
|
346
|
type: "warning",
|
|
|
@@ -339,10 +350,10 @@ export default {
|
|
339
|
350
|
}
|
|
340
|
351
|
})
|
|
341
|
352
|
.catch((err) => {
|
|
342
|
|
- console.log('login error:', err)
|
|
|
353
|
+ console.log("login error:", err);
|
|
343
|
354
|
this.$message({
|
|
344
|
355
|
type: "warning",
|
|
345
|
|
- message: '未知异常 -1',
|
|
|
356
|
+ message: "未知异常 -1",
|
|
346
|
357
|
});
|
|
347
|
358
|
this.loading = false;
|
|
348
|
359
|
});
|
|
|
@@ -440,7 +451,7 @@ export default {
|
|
440
|
451
|
},
|
|
441
|
452
|
loadAll() {
|
|
442
|
453
|
// return JSON.parse(unescape(this.getCookie("companyloginHistory")));
|
|
443
|
|
- return null
|
|
|
454
|
+ return null;
|
|
444
|
455
|
},
|
|
445
|
456
|
querySearch(queryString, cb) {
|
|
446
|
457
|
var restaurants = this.restaurants;
|
|
|
@@ -557,7 +568,8 @@ h3 {
|
|
557
|
568
|
@include relative;
|
|
558
|
569
|
height: 100vh;
|
|
559
|
570
|
min-height: 600px;
|
|
560
|
|
- background: url(../../assets/wisdom_images/bg.png) no-repeat center center;
|
|
|
571
|
+ // background: url(../../assets/wisdom_images/bg.png) no-repeat center center;
|
|
|
572
|
+ background: url(../../assets/wisdom_images/bj.png) no-repeat center center;
|
|
561
|
573
|
background-size: 100% 100%;
|
|
562
|
574
|
background-color: #2d3a4b;
|
|
563
|
575
|
input:-webkit-autofill {
|
|
|
@@ -631,7 +643,8 @@ h3 {
|
|
631
|
643
|
margin-top: 5%;
|
|
632
|
644
|
float: left;
|
|
633
|
645
|
height: 433px;
|
|
634
|
|
- background: url(../../assets/wisdom_images/cicle.png) top left no-repeat;
|
|
|
646
|
+ // background: url(../../assets/wisdom_images/cicle.png) top left no-repeat;
|
|
|
647
|
+ background: url(../../assets/wisdom_images/zuo.png) top left no-repeat;
|
|
635
|
648
|
background-size: 80%;
|
|
636
|
649
|
}
|
|
637
|
650
|
|