import {
    HTTP
} from './Http.js'
class ApiModel extends HTTP {
    loginbywechat(data) {
        return this.request({
            url: "/loginbywechat",
            data
        })
    }
    /* 登录 */
    login(data) {
        return this.request({
            url: "/loginbyaccount",
            data
        })
    }
    /* 验证码登录 */
    plogin(data) {
        return this.request({
            url: "/login",
            data
        })
    }
    /* 获取验证码 */
    getpassword(data) {
        return this.request({
            url: "/getpassword",
            data
        })
    }
    /* 有状态通用 */
    basic(data, loading = true) {
        data.accesstoken = wx.getStorageSync('userMsg').token;
        return this.request({
            url: "",
            data,
            loading
        })
    }
    /* 无状态 */
    base(data, loading = true) {
        return this.request({
            url: "",
            data,
            loading
        })
    }
    /* 退出登录 */
    logout() {
        let data = {
            accesstoken: wx.getStorageSync('userMsg').token
        }
        return this.request({
            url: "/logout",
            data
        })
    }

}
export {
    ApiModel
}