Add user manager. Optimize code.

This commit is contained in:
2023-11-01 18:21:05 +08:00
parent b548fb8083
commit e68cff4612
11 changed files with 127 additions and 24 deletions

10
src/services/auth.tsx Normal file
View File

@@ -0,0 +1,10 @@
import request from '@/services'
import { URL_API_LOGIN, URL_API_LOGOUT } from '@/constants/urls.constants'
export const r_login = (username: string, password: string) =>
request.post<TokenVo>(URL_API_LOGIN, {
username,
password
})
export const r_logout = () => request.post(URL_API_LOGOUT)

6
src/services/user.tsx Normal file
View File

@@ -0,0 +1,6 @@
import request from '@/services'
import { URL_API_USER_INFO, URL_API_USER_LIST } from '@/constants/urls.constants'
export const r_getInfo = () => request.get<UserWithPowerInfoVo>(URL_API_USER_INFO)
export const r_getUserList = () => request.get<UserWithRoleInfoVo[]>(URL_API_USER_LIST)