import request from "@/utils/request";

/**
 * 获取验证码图片
 */
export function getCaptchaImage() {
    return request({
        url: '/bis/insp/getCaptchaImage',
        method: 'GET',
    })
}

/**
 * 发送验证码邮件
 * @param {*} phoneNumber 手机号
 */
export function sendMessage(phoneNumber, imgCodeId, code) {
    return request({
        url: '/bis/insp/sendMessage',
        method: 'POST',
        data: {
            'phone': phoneNumber,
            'imgCodeId': imgCodeId,
            'code': code,
        },
        params: {
            'phone': phoneNumber,
            'imgCodeId': imgCodeId,
            'code': code,
        }
    })
}

/**
 * 验证码登录
 * @param {*} code 验证码
 * @param {*} message 短信验证码
 * 
 */
export function loginWithMessage(phone, code, message) {
    return request({
        url: '/bis/insp/loginByCode',
        method: 'POST',
        data: { "account": phone, "code": code, "password": message, "phone": phone }
    })
}

/**
 * 登出
 */
export function logout() {
    return request({
        url: '/bis/insp/logOut',
        method: 'GET',
    })
}