feat(修改ico,logo,菜单管理crud基本功能完成): 🐛 修复登录未使用MD5

This commit is contained in:
H0nGzA1
2023-02-05 14:03:54 +08:00
parent c12fe56808
commit 4046bd0d0c
15 changed files with 609 additions and 8380 deletions

View File

@@ -73,6 +73,7 @@ import { formatAxis } from '/@/utils/formatTime';
import { NextLoading } from '/@/utils/loading';
import * as loginApi from '/@/views/system/login/api';
import { useUserInfo } from '/@/stores/userInfo';
import { Md5 } from 'ts-md5';
export default defineComponent({
name: 'loginAccount',
@@ -114,10 +115,9 @@ export default defineComponent({
});
};
const loginClick = async () => {
loginApi.login(state.ruleForm).then((ret: any) => {
console.log(ret);
Session.set('token', ret.access);
Cookies.set('username', ret.name);
loginApi.login({ ...state.ruleForm, password: Md5.hashStr(state.ruleForm.password) }).then((ret: any) => {
Session.set('token', ret.data.access);
Cookies.set('username', ret.data.name);
if (!themeConfig.value.isRequestRoutes) {
// 前端控制路由2、请注意执行顺序
initFrontEndControlRoutes();
@@ -132,10 +132,7 @@ export default defineComponent({
});
};
const getUserInfo = () => {
loginApi.getUserInfo().then((ret: any) => {
console.log('getUserInfo');
console.log(ret);
});
useUserInfo().setUserInfos();
};
// 登录成功后的跳转
const loginSuccess = () => {