import {
    HTTP
} from './Http.js'
class ApiModel extends HTTP {
    devicevaluecheck(data) {
        data.accesstoken = uni.getStorageSync('userMsg').token || '';
        return this.request({
            url: "/simple/devicevaluecheck",
            data
        })
    }
    loginbywechat(data) {
        return this.request({
            url: "/index/loginbywechat",
            data
        })
    }
    /* 登录 */
    login(data) {
        return this.request({
            url: "/index/loginbyaccount",
            data
        })
    }
    /* 验证码登录 */
    plogin(data) {
        return this.request({
            url: "/index/login",
            data
        })
    }
    /* 获取验证码 */
    getpassword(data) {
        return this.request({
            url: "/index/getpassword",
            data
        })
    }
    /* 有状态通用 */
    basic(data, loading = true) {
        data.accesstoken = uni.getStorageSync('userMsg').token;
        return this.request({
            url: "/index",
            data,
            loading
        })
    }
    getClass(typename) {
        return this.basic({
            "classname": "sysmanage.develop.optiontype.optiontype",
            "method": "optiontypeselect",
            "content": {
                "typename": typename
            }
        })
    }
    /* 无状态 */
    base(data, loading = true) {
        return this.request({
            url: "/index",
            data,
            loading
        })
    }
    /* 退出登录 */
    logout() {
        let data = {
            accesstoken: uni.getStorageSync('userMsg').token
        }
        return this.request({
            url: "/index/logout",
            data
        })
    }
    /* 获取地区code */
    getLocationCode() {
        return this.request({
            url: "/index/getforward?url=" + encodeURIComponent("http://www.nmc.cn/rest/position"),
            data: {},
            method: "GET",
            header: {
                "Access-Control-Allow-Origin": "*"
            }
        })
    }
}
export {
    ApiModel
}