import http from "@/http/http.js";
// let baseUrl = "/api/web/auth/accessAuth/springBoard";

let baseURL = "";
if (process.env.NODE_ENV == 'development') {//开发环境
    baseURL = '/api/web/auth/accessAuth/springBoard';
} else if (process.env.NODE_ENV == 'production') {//生产环境
    baseURL = '/web/auth/accessAuth/springBoard';
}

//获取短信验证码
export function getVerifyCode(phone) {
    return http.post(baseURL, {
        actionType: "getVerifyCode",
        actionBody: {
            mobile: phone // Y 手机号
        }
    });
}

//验证码登录
export function userPinByLgoinVcode(params) {
    return http.post(baseURL, {
        actionType: "userPinByLgoinVcode",
        actionBody: params
    });
}

//账号密码登录
export function userPinByLgoin(params) {
    return http.post(baseURL, {
        actionType: "userPinByLgoin",
        actionBody: params
    });
}

//用户注册
export function userPinByRegister(params) {
    return http.post(baseURL, {
        actionType: "userPinByRegister",
        actionBody: params
    });
}

//按照手机号和验证码修改密码
export function putUserPwdByMobile(params) {
    return http.post(baseURL, {
        actionType: "putUserPwdByMobile",
        actionBody: params
    });
}

//退出
export function logout(userpin) {
    return http.post(baseURL, {
        actionType: "logout",
        actionBody: {
            userpin: userpin //  Y 用户登录凭证key
        }
    });
}