import qs from 'qs'
const axios = require('@/common/axios').default
// 手机号密码方式登录
export function usernameLogin(data) {
    return axios({
        url: '/api-auth/usernameLogin',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 发送登录短信验证码
export function sendSms(data) {
    return axios({
        url: '/api-auth/code/sendSms',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 校验短信验证码
export function verifySmsCode(data) {
    return axios({
        url: '/api-auth/code/verifySmsCode',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 短信验证码的方式登录
export function smsLogin(data) {
    return axios({
        url: '/api-auth/smsLogin',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 检查手机号
export function queryUserByPhone (data) {
    return axios({
        url: '/api-auth/user/noAuth/queryUserByPhone',
        method: 'get',
        params: data
    })
}

// 获取考级报名信息
export function examinationBasicInfo (data) {
    return axios({
        url: '/api-student/examinationBasic/getInfo',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 获取学生信息
export function getStudent (data) {
    return axios({
        url: '/api-student/student/getStudent',
        method: 'get',
        params: data
    })
}

// 更新学员基本信息
export function updateStudentInfo (data) {
    return axios({
        url: '/api-student/student/updateInfo',
        method: 'post',
        data: qs.stringify(data)
    })
}

// ocr
export function ocr (data) {
    return axios({
        url: '/api-student/examRegistration/ocr',
        method: 'post',
        data: data
    })
}

// 上传文件
export function uploadFile (data) {
    return axios({
        url: '/api-student/uploadFile',
        method: 'post',
        data: data
    })
}

// 获取考试项目专业
export function getExamSubjects (data) {
    return axios({
        url: '/api-student/examSubject/getStudentExamSubjects',
        method: 'get',
        params: data
    })
}

// 获取考级专业相应级别列表-报名
export function getExamSubjectLevel (data) {
    return axios({
        url: '/api-student/examSubjectSong/getExamSubjectLevel',
        method: 'get',
        params: data
    })
}

// 获取考级专业相应级别的曲目-报名
export function getExamSubjectSong (data) {
    return axios({
        url: '/api-student/examSubjectSong/getExamSubjectSong',
        method: 'get',
        params: data
    })
}

// 报名
export function examRegistrationAdd (data) {
    return axios({
        url: '/api-student/examRegistration/add',
        method: 'post',
        data: data
    })
}

// 修改学员报名信息
export function examRegistrationUpdate (data) {
    return axios({
        url: '/api-student/examRegistration/update',
        method: 'post',
        data: data
    })
}

// 修改学员报名信息
export function getTheoryLevelList (data) {
    return axios({
        url: '/api-student/examMusicTheory/getTheoryLevelList',
        method: 'get',
        params: data
    })
}

// 获取用户项目未支付的订单
export function getExamIngOrder (data) {
    return axios({
        url: '/api-student/examOrder/getExamIngOrder',
        method: 'get',
        params: data
    })
}

// 获取报名信息
export function getExamRegistration (data) {
    return axios({
        url: '/api-student/examRegistration/getExamRegistration',
        method: 'get',
        params: data
    })
}

// 重新支付
export function repay (data) {
    return axios({
        url: '/api-student/examRegistration/repay',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 关闭订单
export function closeOrder (data) {
    return axios({
        url: '/api-student/examOrder/closeOrder',
        method: 'post',
        data: qs.stringify(data)
    })
}