初始化 ui.

This commit is contained in:
lijiahang
2023-07-27 18:48:15 +08:00
parent ee53ec6486
commit 5be2c7fda2
185 changed files with 1107 additions and 17815 deletions

View File

@@ -5,21 +5,6 @@ import './message-box';
import '@/views/dashboard/workplace/mock';
import '@/views/dashboard/monitor/mock';
import '@/views/list/card/mock';
import '@/views/list/search-table/mock';
import '@/views/form/step/mock';
import '@/views/profile/basic/mock';
import '@/views/visualization/data-analysis/mock';
import '@/views/visualization/multi-dimension-data-analysis/mock';
import '@/views/user/info/mock';
import '@/views/user/setting/mock';
Mock.setup({
timeout: '600-1000',
});

View File

@@ -10,7 +10,7 @@ const getMessageList = () => {
title: '郑曦月',
subTitle: '的私信',
avatar:
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/8361eeb82904210b4f55fab888fe8416.png~tplv-uwbnlip3yd-webp.webp',
'123123',
content: '审批请求已发送,请查收',
time: '今天 12:30:01',
},

View File

@@ -16,8 +16,9 @@ setupMock({
if (isLogin()) {
const role = window.localStorage.getItem('userRole') || 'admin';
return successResponseWrap({
id: '1',
name: '王立群',
avatar:
username:
'//lf1-xgcdn-tos.pstatp.com/obj/vcloud/vadmin/start.8e0e4855ee346a46ccff8ff3e24db27b.png',
email: 'wangliqun@email.com',
job: 'frontend',
@@ -38,35 +39,6 @@ setupMock({
return failResponseWrap(null, '未登录', 50008);
});
// 登录
Mock.mock(new RegExp('/api/user/login'), (params: MockParams) => {
const { username, password } = JSON.parse(params.body);
if (!username) {
return failResponseWrap(null, '用户名不能为空', 50000);
}
if (!password) {
return failResponseWrap(null, '密码不能为空', 50000);
}
if (username === 'admin' && password === 'admin') {
window.localStorage.setItem('userRole', 'admin');
return successResponseWrap({
token: '12345',
});
}
if (username === 'user' && password === 'user') {
window.localStorage.setItem('userRole', 'user');
return successResponseWrap({
token: '54321',
});
}
return failResponseWrap(null, '账号或者密码错误', 50000);
});
// 登出
Mock.mock(new RegExp('/api/user/logout'), () => {
return successResponseWrap(null);
});
// 用户的服务端菜单
Mock.mock(new RegExp('/api/user/menu'), () => {
const menuList = [
@@ -82,7 +54,7 @@ setupMock({
children: [
{
path: 'workplace',
name: 'Workplace',
name: 'workplace',
meta: {
locale: 'menu.server.workplace',
requiresAuth: true,
@@ -98,6 +70,33 @@ setupMock({
},
],
},
{
name: 'User',
meta: {
locale: '1',
requiresAuth: true,
icon: 'icon-dashboard',
order: 1,
},
children: [
{
path: '/user/userChild',
name: 'userChild',
meta: {
locale: 'userChild',
requiresAuth: true,
},
},
{
path: '/user/userChild1',
name: 'userChild1',
meta: {
locale: 'userChild1',
requiresAuth: true,
},
},
],
},
];
return successResponseWrap(menuList);
});