| | |
| | | import request, { CommonListResponse, IListWorkspaceResponse, IPage, IWorkspaceResponse } from '/@/api/http/request' |
| | | import { Device } from '/@/types/device' |
| | | |
| | | const HTTP_PREFIX = '/manage/api/v1' |
| | | const HTTP_PREFIX = '/system/auth' |
| | | |
| | | // login |
| | | export interface LoginBody { |
| | | username: string, |
| | | password: string, |
| | | flag: number, |
| | | } |
| | | export interface BindBody { |
| | | device_sn: string, |
| | |
| | | } |
| | | |
| | | export const login = async function (body: LoginBody): Promise<IWorkspaceResponse<any>> { |
| | | const url = `${HTTP_PREFIX}/login` |
| | | const url = `${HTTP_PREFIX}/login/password` |
| | | const result = await request.post(url, body) |
| | | return result.data |
| | | } |
| | | |
| | | export const loginOut = async function (): Promise<IWorkspaceResponse<any>> { |
| | | const url = `${HTTP_PREFIX}/logout` |
| | | const result = await request.delete(url) |
| | | return result.data |
| | | } |
| | | |
| | | // Refresh Token |
| | | export const refreshToken = async function (body: {}): Promise<IWorkspaceResponse<any>> { |
| | | const url = `${HTTP_PREFIX}/token/refresh` |