diff --git a/.gitignore b/.gitignore index b5e33a8..fac26af 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,4 @@ pnpm* #auto-imports.d.ts #components.d.ts stats.html +ts-out-dir diff --git a/eslintrc/.eslintrc-auto-import.json b/eslintrc/.eslintrc-auto-import.json index f840826..d09f22a 100644 --- a/eslintrc/.eslintrc-auto-import.json +++ b/eslintrc/.eslintrc-auto-import.json @@ -89,6 +89,7 @@ "useConfigStore": true, "useCssModule": true, "useCssVars": true, + "useDebuggerStore": true, "useElement": true, "useErrorLog": true, "useLink": true, diff --git a/mock/excel.ts b/mock/excel.ts index c5ca37b..b4631a7 100644 --- a/mock/excel.ts +++ b/mock/excel.ts @@ -44,7 +44,7 @@ export default [ { order_no: '@guid()', timestamp: +Mock.Random.date('T'), - userName: '@name()', + username: '@name()', price: '@float(1000, 15000, 0, 2)', 'status|1': ['success', 'pending'] } diff --git a/src/api/roleManagement.ts b/src/api/roleManagement.ts index 4704059..9a477f4 100644 --- a/src/api/roleManagement.ts +++ b/src/api/roleManagement.ts @@ -4,7 +4,7 @@ export function getList(data) { return request({ url: '/role/queryRoleByPage', method: 'post', - data, + data }) } @@ -12,14 +12,14 @@ export function doAdd(data) { return request({ url: '/role/create', method: 'post', - data, + data }) } export function doUpdate(data) { return request({ url: '/role/update', method: 'post', - data, + data }) } @@ -27,7 +27,7 @@ export function doDelete(data) { return request({ url: '/role/destroy', method: 'post', - data, + data }) } /** @@ -37,7 +37,7 @@ export function doDelete(data) { export function getRoleList() { return request({ url: '/role/list', - method: 'get', + method: 'post' }) } @@ -47,9 +47,9 @@ export function getRoleList() { export function getRoleByUserId(userId) { return request({ url: '/userRole/getByUserId', - method: 'get', - params: { - userId, - }, + method: 'post', + data: { + userId + } }) } diff --git a/src/api/user.ts b/src/api/user.ts index 21e82d9..eb5001e 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -1,5 +1,6 @@ //获取用户信息 import { post } from '@/utils/request' + export interface IUser { id: string userName: string @@ -36,3 +37,12 @@ export async function login(data): Promise { export async function logout(): Promise { return post('/logout') } + +/** + * 按照文本搜索前十条用户 + * @param keys + * @return {Promise} + */ +export function userSearching(keys) { + return post('user/searching', { keys }) +} diff --git a/src/api/userManagement.ts b/src/api/userManagement.ts new file mode 100644 index 0000000..34adc84 --- /dev/null +++ b/src/api/userManagement.ts @@ -0,0 +1,42 @@ +import request from '@/utils/request' + +export function getList(data) { + return request({ + url: '/user/list', + method: 'post', + data + }) +} + +export function doEdit(data) { + return request({ + url: '/user/edit', + method: 'post', + data + }) +} + +export function doCreate(data) { + return request({ + url: '/user/create', + method: 'post', + data + }) +} + +export function doDelete(data) { + return request({ + url: '/user/delete', + method: 'post', + data + }) +} + +// 查询学生信息 +export function getStudentInfoByStudentId(data) { + return request({ + url: '/user/getStudentInfoByStudentId', + method: 'post', + data + }) +} diff --git a/src/layout/app-main/Navbar.vue b/src/layout/app-main/Navbar.vue index cc3d802..31bae1a 100644 --- a/src/layout/app-main/Navbar.vue +++ b/src/layout/app-main/Navbar.vue @@ -30,14 +30,14 @@ -
+
用户头像