1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import {
- HTTP
- } from './Http.js'
- class ApiModel extends HTTP {
- devicevaluecheck(data) {
- data.accesstoken = wx.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 = wx.getStorageSync('userMsg').token;
- return this.request({
- url: "/index",
- data,
- loading
- })
- }
- /* 无状态 */
- base(data, loading = true) {
- return this.request({
- url: "/index",
- data,
- loading
- })
- }
- /* 退出登录 */
- logout() {
- let data = {
- accesstoken: wx.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
- }
|