1.增加谷歌验证器
This commit is contained in:
14
web/src/api/backend/auth/admin.ts
Normal file
14
web/src/api/backend/auth/admin.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import createAxios from '/@/utils/axios'
|
||||
|
||||
export function resetTotp(id: number) {
|
||||
return createAxios(
|
||||
{
|
||||
url: '/admin/auth.Admin/resetTotp',
|
||||
method: 'post',
|
||||
data: { id },
|
||||
},
|
||||
{
|
||||
showSuccessMessage: true,
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -20,6 +20,35 @@ export function login(method: 'get' | 'post', params: object = {}) {
|
||||
})
|
||||
}
|
||||
|
||||
export function totpVerify(params: object = {}) {
|
||||
return createAxios({
|
||||
url: url + 'totpVerify',
|
||||
data: params,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
||||
export function totpBindInit(params: object = {}) {
|
||||
return createAxios({
|
||||
url: url + 'totpBindInit',
|
||||
data: params,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
||||
export function totpBindConfirm(params: object = {}) {
|
||||
return createAxios(
|
||||
{
|
||||
url: url + 'totpBindConfirm',
|
||||
data: params,
|
||||
method: 'post',
|
||||
},
|
||||
{
|
||||
showSuccessMessage: true,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
const adminInfo = useAdminInfo()
|
||||
return createAxios({
|
||||
|
||||
Reference in New Issue
Block a user