mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-27 03:33:25 +08:00
feat:重构请求模块-大更新
This commit is contained in:
65
Yi.BBS.Vue3/src/apis/auth.js
Normal file
65
Yi.BBS.Vue3/src/apis/auth.js
Normal file
@@ -0,0 +1,65 @@
|
||||
import request from "@/config/axios/service";
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* @param {*} data 账号密码
|
||||
*/
|
||||
export function userLogin(data) {
|
||||
return request({
|
||||
url: `/account/login`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户注册
|
||||
* @param {*} data 账号密码
|
||||
*/
|
||||
export function userRegister(data) {
|
||||
return request({
|
||||
url: `/account/register`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户详细信息
|
||||
*/
|
||||
export function getUserDetailInfo() {
|
||||
return request({
|
||||
url: `/account`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户退出
|
||||
*/
|
||||
export function userLogout() {
|
||||
return request({
|
||||
url: `/account/logout`,
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
export function getCodeImg() {
|
||||
return request({
|
||||
url: `/account/captcha-image`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取短信验证码
|
||||
*/
|
||||
export function getCodePhone(data) {
|
||||
return request({
|
||||
url: `/account/captcha-phone`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import myaxios from '@/utils/request'
|
||||
import request from "@/config/axios/service";
|
||||
|
||||
//获取配置
|
||||
export function getAll(){
|
||||
return myaxios({
|
||||
url: '/config',
|
||||
method: 'get'
|
||||
})
|
||||
};
|
||||
export function getAll() {
|
||||
return request({
|
||||
url: "/config",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user