import { request } from './request'

const baseUri = ''
const auth = '/wx/auth'
const user = '/wx/user'
const frameUser = '/wx/frameUser'
const code = '/wx/homeCode'

export function getReadInfoByUserId(data) {
    return request({
        url: baseUri + auth + '/getReadInfoByUserId',
        method: 'post',
        data: data
    })
}
export function updateReadInfoByUserId(data) {
    return request({
        url: baseUri + auth + '/updateReadInfoByUserId',
        method: 'post',
        data: data
    })
}
export function login(data) {
    return request({
        url: baseUri + user + '/login_by_app_main',
        method: 'post',
        data: data
    })
}

export function authLogin(data) {
    return request({
        url: baseUri + auth + '/login_by_app_main',
        method: 'post',
        data: data
    })
}

export function userMainLogin(data) {
    return request({
        url: baseUri + auth + '/login_by_user_main',
        method: 'post',
        data: data
    })
}

export function editBizPwd(data) {
    return request({
        url: baseUri + auth + '/editBizPwd',
        method: 'post',
        data: data
    })
}
export function editBizPwdById(data) {
    return request({
        url: baseUri + auth + '/editBizPwdById',
        method: 'post',
        data: data
    })
}

export function editPwd(data) {
    return request({
        url: baseUri + auth + '/editAdminPwd',
        method: 'post',
        data: data
    })
}

export function myInfo(data) {
    return request({
        url: baseUri + frameUser + '/getById',
        method: 'post',
        data: data
    })
}

export function editPassword(data) {
    return request({
        url: baseUri + frameUser + '/editPassword',
        method: 'post',
        data: data
    })
}

export function send(data) {
    return request({
        url: baseUri + user + '/send',
        method: 'post',
        data: data
    })
}

export function register_by_account(data) {
    return request({
        url: baseUri + auth + '/register_by_account',
        method: 'post',
        data: data
    })
}

export function register_by_app_account(data) {
    return request({
        url: baseUri + user + '/register_by_app_account',
        method: 'post',
        data: data
    })
}

export function authorize() {
    return request({
        url: baseUri + auth + '/authorize',
        method: 'get'
    })
}

export function getInfo(userId) {
    return request({
        url: baseUri + user + '/userInfo/' + userId,
        method: 'post'
    })
}

export function bizInfo(bId) {
    return request({
        url: baseUri + user + '/bizInfo/' + bId,
        method: 'post'
    })
}

export function getMobileRoleById(roleId) {
    return request({
        url: baseUri + user + '/getMobileRoleById/' + roleId,
        method: 'post'
    })
}

export function updatePassword(data) {
    return request({
        url: baseUri + user + '/updatePassword',
        method: 'post',
        data: data
    })
}

// 判断用户账号状态
export function checkUserState(data) {
    return request({
        url: baseUri + frameUser + '/checkUserState',
        method: 'post',
        data: data
    })
}

// 发送手机验证码
export function sendCode(data) {
    return request({
        url: baseUri + code + '/send',
        method: 'post',
        data: data
    })
}

// 发送手机验证码
export function registerSend(data) {
    return request({
        url: baseUri + code + '/registerSend',
        method: 'post',
        data: data
    })
}
// 验证手机验证码
export function checkPhoneCode(data) {
    return request({
        url: baseUri + code + '/checkPhoneCode',
        method: 'post',
        data: data
    })
}

