32 lines
821 B
JavaScript
32 lines
821 B
JavaScript
import axios from "axios";
|
||
import useApiFetch from "@/composables/useApiFetch";
|
||
|
||
// 获取API基础URL(与生产规则一致:VITE_API_URL)
|
||
const baseURL = import.meta.env.VITE_API_URL;
|
||
|
||
// 手机号验证码登录
|
||
export function mobileCodeLogin(params) {
|
||
return useApiFetch("/user/mobileCodeLogin").post(params).json();
|
||
}
|
||
|
||
// 统一认证
|
||
export function unifiedAuth(params) {
|
||
return useApiFetch("/user/auth").post(params).json();
|
||
}
|
||
|
||
// 绑定手机号
|
||
export function bindMobile(params) {
|
||
return useApiFetch("/user/bindMobile").post(params).json();
|
||
}
|
||
|
||
// 注销账号API
|
||
export function cancelAccount() {
|
||
return axios({
|
||
method: "post",
|
||
url: `${baseURL}/api/user/cancel`,
|
||
headers: {
|
||
Authorization: `Bearer ${localStorage.getItem("token")}`,
|
||
},
|
||
});
|
||
}
|