| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import FetchRequest from "@/api/FetchRequest";
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore
- import packageJson from '/package.json'
- const version = packageJson.version
- interface loginBody {
- username: string;
- password: string;
- code: string;
- uuid: string;
- }
- interface rePasswBody {
- username: string;
- password: string;
- code: string;
- }
- // 登录方法
- export const login = (
- username: string,
- password: string,
- code: string,
- uuid: string
- ) => {
- const data: loginBody = {
- username,
- password,
- code,
- uuid,
- };
- return FetchRequest.post("/login", JSON.stringify(data), false);
- };
- // 安全登录方法
- export const savelogin = (
- username: string,
- password: string,
- code: string,
- uuid: string
- ) => {
- const data: loginBody = {
- username,
- password,
- code,
- uuid,
- };
- return FetchRequest.post("/security/safeLogin", JSON.stringify(data), false);
- };
- //获取邮箱验证码 /getcode?email=${email}
- export const getEmailcode = (
- email: string,
- ) => {
- return FetchRequest.get(`/getcode?email=${email}`, false);
- };
- //用户重置密码获取邮箱验证码
- export const getcodeByUsername = (
- username: string,
- ) => {
- return FetchRequest.get(`/getcodeByUsername?username=${username}`, false);
- };
- //clearVoipTk
- export const clearVoipTk = (data: string) => {//参数{voipTk:***}
- return FetchRequest.post("/system/user/clearVoipTk",data, false);
- };
- //用户重置密码
- export const resetPassword = (data: rePasswBody) => {
- return FetchRequest.post("/resetPwd",JSON.stringify(data), false);
- };
- //注销账号
- export const zhuxiaozhanghao = (data:any) => {
- return FetchRequest.post("/delUser",JSON.stringify(data), false);
- };
- // 注册方法
- export const register = (data: loginBody) => FetchRequest.post('/register', JSON.stringify(data), false)
- // 获取用户详细信息
- export const getInfo = () => {
- return FetchRequest.get("/getInfo", false);
- };
- // 退出方法
- export const logout = () => FetchRequest.post("/logout", "", true);
- // 获取验证码
- export const getCodeImg = () => FetchRequest.get(`/captchaImage?version=${version}`, false)
|