You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
661 B
30 lines
661 B
1 year ago
|
import type { LoginParams, LoginResult, UserInfo } from './types'
|
||
|
import { defHttp } from '@/utils/http/axios'
|
||
|
import type { ErrorMessageMode } from '@/types/axios'
|
||
|
|
||
|
export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal') {
|
||
|
return defHttp.post<LoginResult>({
|
||
|
url: '/auth/login',
|
||
|
params,
|
||
|
headers: {
|
||
|
'tenant-id': '000000',
|
||
|
},
|
||
|
}, {
|
||
|
errorMessageMode: mode,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function getUserInfo() {
|
||
|
return defHttp.get<UserInfo>({
|
||
|
url: '/system/permission/get-permission-info',
|
||
|
}, {
|
||
|
errorMessageMode: 'none',
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function doLogout() {
|
||
|
return defHttp.post({
|
||
|
url: '/auth/logout',
|
||
|
})
|
||
|
}
|