diff --git a/src/api/modules/sys.user.api.js b/src/api/modules/sys.user.api.js index ded639c..f066f38 100644 --- a/src/api/modules/sys.user.api.js +++ b/src/api/modules/sys.user.api.js @@ -1,7 +1,7 @@ -import { find, assign } from 'lodash' +import { assign } from 'lodash' const users = [ - { username: 'admin', password: '123456', uuid: 'admin-uuid', name: 'Admin' }, + { username: 'admin', password: 'admin', uuid: 'admin-uuid', name: 'Admin' }, { username: 'editor', password: 'editor', uuid: 'editor-uuid', name: 'Editor' }, { username: 'user1', password: 'user1', uuid: 'user1-uuid', name: 'User1' } ] @@ -12,20 +12,7 @@ export default ({ service, request, serviceForMock, requestForMock, mock, faker, * @param {Object} data 登录携带的信息 */ SYS_USER_LOGIN (data = {}) { - // 模拟数据 - mock - .onAny('/login') - .reply(config => { - const user = find(users, tools.parse(config.data)) - return user - ? tools.responseSuccess(assign({}, user, { token: faker.random.uuid() })) - : tools.responseError({}, '账号或密码不正确') - }) - // 接口请求 - return requestForMock({ - url: '/login', - method: 'post', - data - }) + const currentUser = users.find(f => f.username === data.username) + return assign({}, currentUser, { token: faker.random.uuid() }) } }) diff --git a/src/menu/index.js b/src/menu/index.js index c876b99..e1aa9b5 100644 --- a/src/menu/index.js +++ b/src/menu/index.js @@ -41,5 +41,5 @@ export const menuAside = supplementPath([ // ] // } { path: '/resolveRecord', title: '解析记录', icon: 'fa-solid fa-compass' }, - { path: '/versionRecord', title: '版本记录', icon: 'fa-solid fa-compass' }, + { path: '/versionRecord', title: '版本记录', icon: 'fa-solid fa-compass' } ]) diff --git a/src/views/system/login/page.vue b/src/views/system/login/page.vue index a9d1477..37a1472 100644 --- a/src/views/system/login/page.vue +++ b/src/views/system/login/page.vue @@ -95,7 +95,7 @@ export default { // 表单 formLogin: { username: 'admin', - password: '123456' + password: 'admin' }, // 表单校验 rules: {