2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-06 11:23:44 +08:00

feat: 实现安全登录

This commit is contained in:
耗子
2024-12-03 03:46:28 +08:00
parent 128f44ca55
commit 7bc716cff6
16 changed files with 322 additions and 105 deletions

View File

@@ -1,18 +1,18 @@
import type { AxiosResponse } from 'axios'
import { request } from '@/utils'
import { http } from '@/utils'
export default {
// 公钥
key: () => http.Get('/user/key'),
// 登录
login: (username: string, password: string): Promise<AxiosResponse<any>> =>
request.post('/user/login', {
login: (username: string, password: string) =>
http.Post('/user/login', {
username,
password
}),
// 登出
logout: (): Promise<AxiosResponse<any>> => request.post('/user/logout'),
logout: () => http.Post('/user/logout'),
// 是否登录
isLogin: (): Promise<AxiosResponse<any>> => request.get('/user/isLogin'),
isLogin: () => http.Get('/user/isLogin'),
// 获取用户信息
info: (): Promise<AxiosResponse<any>> => request.get('/user/info')
info: () => http.Get('/user/info')
}