PixelAI-admin/src/api/login/index.ts
2024-10-31 09:56:55 +08:00

45 lines
945 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '/@/utils/request';
import { baseUrlHost } from '../baseUrlHost';
/**
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
* 注意在写get请求时参数是params而不是data要标注好
* 登录api接口集合
* @method signIn 用户登录
* @method signOut 用户退出登录
* @method login 登录
* @method loginOut 登出
*/
export function useLoginApi() {
return {
signIn: (data: object) => {
return request({
url: '/user/signIn',
method: 'post',
data,
});
},
signOut: (data: object) => {
return request({
url: '/user/signOut',
method: 'post',
data,
});
},
login: (data: object) => {
return request({
url: baseUrlHost+'/acUser/login',
method: 'post',
data,
});
},
loginOut: () => {
return request({
url: baseUrlHost+'/acUser/logout',
method: 'get',
});
}
};
}