|
@@ -1,5 +1,7 @@
|
1
|
1
|
import { login, logout, getInfo } from '@/api/login'
|
2
|
2
|
import { getToken, setToken, removeToken } from '@/utils/auth'
|
|
3
|
+import {cyptoTool} from '@/utils/cryptoJSMi';
|
|
4
|
+
|
3
|
5
|
|
4
|
6
|
const user = {
|
5
|
7
|
state: {
|
|
@@ -48,9 +50,11 @@ const user = {
|
48
|
50
|
// 登录
|
49
|
51
|
Login({ commit }, userInfo) {
|
50
|
52
|
const username = userInfo.username.trim()
|
51
|
|
- const password = userInfo.password
|
|
53
|
+ const password = cyptoTool.methods.encrypt(userInfo.password)
|
|
54
|
+ // const password = userInfo.password
|
52
|
55
|
const code = userInfo.code
|
53
|
56
|
const uuid = userInfo.uuid
|
|
57
|
+
|
54
|
58
|
return new Promise((resolve, reject) => {
|
55
|
59
|
login(username, password, code, uuid).then(res => {
|
56
|
60
|
setToken(res.token)
|