移除md5包

This commit is contained in:
不做码农 2023-06-18 21:56:19 +08:00
parent 57a2564bda
commit 67916c5a9e
2 changed files with 7 additions and 4 deletions

View File

@ -22,13 +22,13 @@
"@wangeditor/editor-for-vue": "^5.1.11",
"axios": "^0.27.2",
"countup.js": "^2.1.0",
"crypto-js": "^4.1.1",
"echarts": "5.2.2",
"element-plus": "^2.3.6",
"file-saver": "2.0.5",
"fuse.js": "6.4.6",
"highlight.js": "^11.5.1",
"js-cookie": "3.0.1",
"js-md5": "^0.7.3",
"jsencrypt": "3.2.1",
"md-editor-v3": "^1.11.11",
"nprogress": "0.2.0",
@ -51,4 +51,4 @@
"vite-plugin-svg-icons": "1.0.5",
"vite-plugin-vue-setup-extend": "^0.4.0"
}
}
}

View File

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