import request from '@/utils/request'

//发送短信
export function smsSend(data: any) {
    return request.post({ url: '/sms/sendCode', data: data })
}

//获取短信验证信息（接收手机号+随机码）
export function getVerifyInfo(data: any) {
    return request.post({ url: '/sms/getVerifyInfo', data: data })
}

export function getConfig() {
    return request.get({ url: '/index/config' })
}

export function getPolicy(data: any) {
    return request.get({ url: '/index/policy', data: data })
}

export function uploadImage(file: any, token?: string) {
    return request.uploadFile({
        url: '/upload/image',
        filePath: file,
        name: 'file',
        header: {
            token
        },
        fileType: 'image'
    })
}

export function wxJsConfig(data: any) {
    return request.get({ url: '/wechat/jsConfig', data })
}

// APP 版本检查
export function checkAppVersion(data: {
    platform: number
    version_code: number
    package_type?: number
}) {
    return request.get({ url: '/appVersion/check', data })
}
