import axios from 'axios';
import global from '../Global.js'
// 基础方法进行封装
function getApiBasic(url, postdata) {
    return  axios.post(url, postdata).then(function(data){
        let json = data.data;
        return json
    },function(response){
        console.info(response);
    })
}

// 调用的api改写成方法
export function worldDetail(postdata) {
        let url = headapi + 'worldDetail';
        return getApiBasic(url,postdata);
}



export function editbasicinfo(postdata) {
    let url = headapi + 'editbasicinfo';
    return getApiBasic(url,postdata);
}
export function modPwd(postdata) {
    let url = headapi + 'modPwd';
    return getApiBasic(url,postdata);
}
export function logout(postdata) {
    let url = headapi + 'logout';
    return getApiBasic(url,postdata);
}

// 调用的api改写成方法
export function testTable(postdata) {
    let url = headapi + 'testTable';
    return getApiBasic(url,postdata);
}
export function testSelect(postdata) {
    let url = headapi + 'testSelect';
    return getApiBasic(url,postdata);
}

export function testPic(postdata) {
    let url = headapi + 'testPic';
    return getApiBasic(url,postdata);
}


// 正式接口

// 获取验证图片
export function GenVerifyPic(postdata) {
    let url = headapi + '/v1/Auth/GenVerifyPic';
    return getApiBasic(url, postdata);
}

// 手机获取验证码
export function GetPhoneVFCode(postdata) {
    let url = headapi + '/v1/Auth/GetPhoneVFCode';
    return getApiBasic(url, postdata);
}

export function SignIn(postdata) {
    let url = headapi + '/v1/Auth/SignIn';
    return getApiBasic(url,postdata);
}
// 手机登录
export function PhoneSignIn(postdata) {
    let url = headapi + '/v1/Auth/PhoneSignIn';
    return getApiBasic(url,postdata);
}

// 用户微信绑定
export function WXBind(postdata) {
    let url = headapi + '/v1/Auth/WXBind';
    return getApiBasic(url,postdata);
}



