Files
lingji-work-fe/src/api/all/login.ts
2025-06-20 06:10:15 -04:00

41 lines
1.6 KiB
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 Http from '@/api';
// 导出一个函数,用于获取登录验证码
export const fetchLoginCaptCha = (params = {}) => {
return Http.post('/v1/sms/login-captcha', params);
};
// 导出一个函数,用于获取验证码
export const fetchAuthorizationsCaptcha = (params = {}) => {
// 使用Http.post方法发送POST请求请求地址为'/v1/authorizations/captcha'请求参数为params
return Http.post('/v1/authorizations/captcha', params);
};
// 导出一个函数,用于获取授权信息
export const fetchAuthorizations = (params = {}) => {
// 使用Http.put方法向服务器发送PUT请求获取授权信息
return Http.put('/v1/authorizations', params);
};
// 导出一个名为fetchLogOut的函数用于注销用户
export const fetchLogOut = (params = {}) => {
// 使用Http.put方法向'/v1/authorizations'接口发送put请求参数为params
return Http.put('/v1/authorizations', params);
};
// 导出一个名为fetchProfileInfo的函数用于获取用户信息
export const fetchProfileInfo = (params = {}) => {
// 使用Http.put方法向/v1/me接口发送put请求并将params作为参数传递
return Http.put('/v1/me', params);
};
// 导出一个函数,用于获取编辑手机号的验证码
export const fetchEditPhoneCaptcha = (params = {}) => {
// 使用Http.put方法向服务器发送PUT请求获取编辑手机号的验证码
return Http.put('/v1/sms/update-mobile-captcha', params);
};
export const fetchBindPhone = (params = {}) => {
return Http.put('/v1/me/mobile', params);
};