Add user manager. Optimize code.
This commit is contained in:
10
src/services/auth.tsx
Normal file
10
src/services/auth.tsx
Normal 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
6
src/services/user.tsx
Normal 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)
|
||||
Reference in New Issue
Block a user