1Panel/frontend/src/api/modules/auth.ts
John Bro 3e3f0d9452
feat: 未认证设置状态下系统跳转页面功能实现 (#4444)
#### What this PR does / why we need it?

#### Summary of your change

#### Please indicate you've done the following:

- [ ] Made sure tests are passing and test coverage is added if needed.
- [ ] Made sure commit message follow the rule of [Conventional Commits specification](https://www.conventionalcommits.org/).
- [ ] Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
2024-04-09 14:46:09 +00:00

34 lines
873 B
Go

import { Login } from '@/api/interface/auth';
import http from '@/api';
export const loginApi = (params: Login.ReqLoginForm) => {
return http.post<Login.ResLogin>(`/auth/login`, params);
};
export const mfaLoginApi = (params: Login.MFALoginForm) => {
return http.post<Login.ResLogin>(`/auth/mfalogin`, params);
};
export const getCaptcha = () => {
return http.get<Login.ResCaptcha>(`/auth/captcha`);
};
export const logOutApi = () => {
return http.post<any>(`/auth/logout`);
};
export const checkIsSafety = (code: string) => {
return http.get<string>(`/auth/issafety?code=${code}`);
};
export const getResponsePage = () => {
return http.get<string>(`/auth/respagecode`);
};
export const checkIsDemo = () => {
return http.get<boolean>('/auth/demo');
};
export const getLanguage = () => {
return http.get<string>(`/auth/language`);
};