优化
This commit is contained in:
@@ -50,7 +50,10 @@ import { loginSuccess } from '../utils/jwt';
|
||||
// }
|
||||
// )
|
||||
|
||||
// 获取验证码
|
||||
/**
|
||||
* 获取验证码
|
||||
* @returns {Promise<any>} 返回一个包含验证码信息的Promise对象
|
||||
*/
|
||||
export const getCaptcha = async () => {
|
||||
try {
|
||||
const response = await axiosInstance.get('/captcha');
|
||||
@@ -60,7 +63,14 @@ export const getCaptcha = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 用户登录
|
||||
/**
|
||||
* 用户登录
|
||||
* @param {string} username - 用户名
|
||||
* @param {string} password - 密码
|
||||
* @param {string} token - 验证码token
|
||||
* @param {string} captcha - 用户输入的验证码
|
||||
* @returns {Promise<any>} 返回一个包含登录结果信息的Promise对象
|
||||
*/
|
||||
export const userLogin = async (username, password, token, captcha) => {
|
||||
try {
|
||||
const response = await axiosInstance.post('/user/login', {
|
||||
@@ -80,7 +90,14 @@ export const userLogin = async (username, password, token, captcha) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 用户注册
|
||||
/**
|
||||
* 用户注册
|
||||
* @param {string} qq_code - QQ号
|
||||
* @param {string} password - 密码
|
||||
* @param {string} token - 验证码token
|
||||
* @param {string} captcha - 用户输入的验证码
|
||||
* @returns {Promise<any>} 返回一个包含注册结果信息的Promise对象
|
||||
*/
|
||||
export const userRegister = async (qq_code, password, token, captcha) => {
|
||||
try {
|
||||
const response = await axiosInstance.post('/user/register', {
|
||||
|
||||
Reference in New Issue
Block a user