feat:登录密码md5传输

This commit is contained in:
不做码农 2023-05-07 10:38:25 +08:00
parent 1217f1abdc
commit bce4daa01d
2 changed files with 3 additions and 3 deletions

View File

@ -28,6 +28,7 @@
"fuse.js": "6.4.6", "fuse.js": "6.4.6",
"highlight.js": "^11.5.1", "highlight.js": "^11.5.1",
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"js-md5": "^0.7.3",
"jsencrypt": "3.2.1", "jsencrypt": "3.2.1",
"md-editor-v3": "^1.11.11", "md-editor-v3": "^1.11.11",
"nprogress": "0.2.0", "nprogress": "0.2.0",

View File

@ -1,8 +1,7 @@
import { login, logout, getInfo, oauthCallback } from '@/api/system/login' import { login, logout, getInfo, oauthCallback } from '@/api/system/login'
import { getToken, setToken, removeToken } from '@/utils/auth' import { getToken, setToken, removeToken } from '@/utils/auth'
import defAva from '@/assets/images/profile.jpg' import defAva from '@/assets/images/profile.jpg'
import Cookies from 'js-cookie' import md5 from 'js-md5'
import { encrypt } from '@/utils/jsencrypt'
const useUserStore = defineStore('user', { const useUserStore = defineStore('user', {
state: () => ({ state: () => ({
userInfo: '', userInfo: '',
@ -22,7 +21,7 @@ const useUserStore = defineStore('user', {
// 登录 // 登录
login(userInfo) { login(userInfo) {
const username = userInfo.username.trim() const username = userInfo.username.trim()
const password = userInfo.password const password = md5(userInfo.password)
const code = userInfo.code const code = userInfo.code
const uuid = userInfo.uuid const uuid = userInfo.uuid
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {