import network from "@/utils/network";

export const login = (data) => network({
    url: "/login",
    method: "post",
    data
});
export const smsLogin = (data) => network({
    url: "/smsLogin",
    method: "post",
    data
});
export const validateSmsCode = (data) => network({
    url: "/sms/validateSmsCode?phone=" + data.phone + "&code=" + data.code,
    method: "get",
    data
});
export const validateCaptcha = (data) => network({
    url: "/validateCaptcha?uuid=" + data.uuid + "&code=" + data.code,
    method: "get",
});
export const forgotPassword = (data) => network({
    url: "/forgotPassword",
    method: "post",
    data
});
export const captchaImage = () => network({
    url: "/captchaImage",
    method: "get",
});
export const checkUser = (data) => network({
    url: "/checkUser",
    method: "post",
    data
});

export const loginApi = (data) => network({
    url: "/login",
    method: "post",
    data
});

export const loginOutApi = () => network({
    url: "",
    method: "post",
});

export const getUserInfoApi = () => network({
    url: "/getInfo",
    method: "get"
});
export const getCategoryList = (data) => network({
    url: "/category/list/tree",
    method: "post",
    data
});

export const uploadFile = (data) => network({
    url: "/file/uploadFile",
    method: "post",
    data,
    headers: {
        'Content-Type': 'multipart/form-data'
    },
});

export const register = (data) => network({
    url: "/register",
    method: "post",
});
