mirror of
https://github.com/fumiama/paper-manager.git
synced 2026-06-09 10:21:00 +08:00
add dashboard/account
This commit is contained in:
@@ -23,14 +23,12 @@ export type MenuParams = {
|
||||
}
|
||||
|
||||
export interface AccountListItem {
|
||||
id: string
|
||||
account: string
|
||||
email: string
|
||||
nickname: string
|
||||
id: number
|
||||
name: string
|
||||
nick: string
|
||||
role: number
|
||||
createTime: string
|
||||
remark: string
|
||||
status: number
|
||||
date: string
|
||||
desc: string
|
||||
}
|
||||
|
||||
export interface DeptListItem {
|
||||
@@ -52,12 +50,8 @@ export interface MenuListItem {
|
||||
}
|
||||
|
||||
export interface RoleListItem {
|
||||
id: string
|
||||
roleName: string
|
||||
roleValue: string
|
||||
status: number
|
||||
orderNo: string
|
||||
createTime: string
|
||||
value: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,13 +2,14 @@ import {
|
||||
AccountParams,
|
||||
DeptListItem,
|
||||
MenuParams,
|
||||
RoleParams,
|
||||
// RoleParams,
|
||||
RolePageParams,
|
||||
MenuListGetResultModel,
|
||||
DeptListGetResultModel,
|
||||
AccountListGetResultModel,
|
||||
RolePageListGetResultModel,
|
||||
RoleListGetResultModel,
|
||||
// RoleListGetResultModel,
|
||||
RoleListItem,
|
||||
} from './model/systemModel'
|
||||
import { defHttp } from '/@/utils/http/axios'
|
||||
|
||||
@@ -19,7 +20,7 @@ enum Api {
|
||||
setRoleStatus = '/system/setRoleStatus',
|
||||
MenuList = '/system/getMenuList',
|
||||
RolePageList = '/system/getRoleListByPage',
|
||||
GetAllRoleList = '/system/getAllRoleList',
|
||||
// GetAllRoleList = '/system/getAllRoleList',
|
||||
}
|
||||
|
||||
export const getAccountList = (params: AccountParams) =>
|
||||
@@ -34,8 +35,22 @@ export const getMenuList = (params?: MenuParams) =>
|
||||
export const getRoleListByPage = (params?: RolePageParams) =>
|
||||
defHttp.get<RolePageListGetResultModel>({ url: Api.RolePageList, params })
|
||||
|
||||
export const getAllRoleList = (params?: RoleParams) =>
|
||||
defHttp.get<RoleListGetResultModel>({ url: Api.GetAllRoleList, params })
|
||||
export const getAllRoleList = () => {
|
||||
return [
|
||||
{
|
||||
roleName: '课程组长',
|
||||
value: 'super',
|
||||
},
|
||||
{
|
||||
roleName: '归档代理',
|
||||
value: 'filemgr',
|
||||
},
|
||||
{
|
||||
roleName: '课程组员',
|
||||
value: 'user',
|
||||
},
|
||||
] as RoleListItem[]
|
||||
}
|
||||
|
||||
export const setRoleStatus = (id: number, status: string) =>
|
||||
defHttp.post({ url: Api.setRoleStatus, params: { id, status } })
|
||||
|
||||
@@ -102,3 +102,12 @@ export interface GetUserInfoModel {
|
||||
export interface GetLoginSaltModel {
|
||||
salt: string
|
||||
}
|
||||
|
||||
export interface GetUsersListModel {
|
||||
id: number
|
||||
name: string
|
||||
nick: string
|
||||
role: number
|
||||
date: string
|
||||
desc: string
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
ResetPasswordResultModel,
|
||||
RegisterResultModel,
|
||||
GetLoginSaltModel,
|
||||
GetUsersListModel,
|
||||
} from './model/userModel'
|
||||
|
||||
import { ErrorMessageMode } from '/#/axios'
|
||||
@@ -26,8 +27,8 @@ enum Api {
|
||||
Register = '/register',
|
||||
GetUserInfo = '/getUserInfo',
|
||||
GetUsersCount = '/getUsersCount',
|
||||
GetPermCode = '/getPermCode',
|
||||
TestRetry = '/testRetry',
|
||||
GetUsersList = '/getUsersList',
|
||||
IsNameExist = '/isNameExist',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,23 +142,23 @@ export function getUsersCount() {
|
||||
return defHttp.get<number>({ url: Api.GetUsersCount }, { errorMessageMode: 'none' })
|
||||
}
|
||||
|
||||
/*export function getPermCode() {
|
||||
return defHttp.get<string[]>({ url: Api.GetPermCode })
|
||||
}*/
|
||||
/**
|
||||
* @description: getUsersList
|
||||
*/
|
||||
export function getUsersList() {
|
||||
return defHttp.get<GetUsersListModel[]>({ url: Api.GetUsersList }, { errorMessageMode: 'none' })
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: isNameExist
|
||||
*/
|
||||
export function isNameExist(username: string) {
|
||||
return defHttp.get<boolean>(
|
||||
{ url: Api.IsNameExist, params: { username } },
|
||||
{ errorMessageMode: 'none' },
|
||||
)
|
||||
}
|
||||
|
||||
export function doLogout() {
|
||||
return defHttp.get({ url: Api.Logout }, { errorMessageMode: 'none' })
|
||||
}
|
||||
|
||||
/*export function testRetry() {
|
||||
return defHttp.get(
|
||||
{ url: Api.TestRetry },
|
||||
{
|
||||
retryRequest: {
|
||||
isOpenRetry: true,
|
||||
count: 5,
|
||||
waitTime: 1000,
|
||||
},
|
||||
},
|
||||
)
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user