Files
qnc-webview-v3/src/api/user.js
2025-12-16 12:33:02 +08:00

32 lines
821 B
JavaScript
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 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")}`,
},
});
}