生产监控前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

157 lines
7.2 KiB

// import Mock from 'mockjs';
import { resultSuccess } from '../_util';
// const Random = Mock.Random;
// const token = Random.string('upper', 32, 32);
// const adminInfo = {
// userId: '1',
// username: 'admin',
// realName: 'Admin',
// avatar: Random.image(),
// desc: 'manager',
// password: Random.string('upper', 4, 16),
// token,
// permissions: [
// {
// label: '主控台',
// value: 'dashboard_console',
// },
// {
// label: '监控页',
// value: 'dashboard_monitor',
// },
// {
// label: '工作台',
// value: 'dashboard_workplace',
// },
// {
// label: '基础列表',
// value: 'basic_list',
// },
// {
// label: '基础列表删除',
// value: 'basic_list_delete',
// },
// ],
// };
const imgCode = {
msg: '操作成功',
img: '/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAA8AKADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnL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tkAjHHzVMq0bMUqsbM/9k=',
code: 200,
captchaEnabled: true,
uuid: 'e0f32b7395a44b67b71f8b2c1a590476',
};
const loginData = {
msg: '操作成功',
code: 200,
token:
'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImMyNWQ3ZTBiLWZiZjMtNDAwNy1hNzk2LWM0ZWM5NjI4ZDI2NSJ9.N7U3awYhe6bNedmYRE0ZXO7cvqjqbF7Zd94LMAVZwR866mOvngJ2dRMSx2vcTqjqk25CBafZgIdoZk5ETooyAA',
};
const userData = {
msg: '操作成功',
code: 200,
permissions: ['*:*:*'],
roles: ['admin'],
user: {
createBy: 'admin',
createTime: '2021-05-26 18:56:28',
updateBy: null,
updateTime: null,
remark: '管理员',
userId: 1,
deptId: 100,
userName: 'admin',
nickName: '系统管理员',
email: 'ry@163.com',
phonenumber: '15888888888',
sex: '1',
avatar: '',
password: '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2',
status: '0',
delFlag: '0',
loginIp: '127.0.0.1',
loginDate: '2023-08-16T08:33:10.356+08:00',
dept: {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
deptId: 100,
parentId: 0,
ancestors: '0',
deptName: '联美节能环保集团',
orderNum: 0,
leader: '联美',
phone: null,
email: null,
status: '0',
delFlag: null,
parentName: null,
children: [],
},
roles: [
{
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
roleId: 1,
roleName: '超级管理员',
roleKey: 'admin',
roleSort: 1,
dataScope: '1',
menuCheckStrictly: false,
deptCheckStrictly: false,
status: '0',
delFlag: null,
flag: false,
menuIds: null,
deptIds: null,
permissions: null,
admin: true,
},
],
roleIds: null,
postIds: null,
roleId: null,
admin: true,
},
};
export default [
{
url: '/api/captchaImage',
timeout: 1000,
method: 'get',
response: () => {
// const token = getRequestToken(request);
// if (!token) return resultError('Invalid token');
return resultSuccess(imgCode);
},
},
{
url: '/api/login',
timeout: 1000,
method: 'post',
response: () => {
return resultSuccess(loginData);
},
},
{
url: '/api/getInfo',
timeout: 1000,
method: 'get',
response: () => {
// const token = getRequestToken(request);
// if (!token) return resultError('Invalid token');
return resultSuccess(userData);
},
},
];