request.js 481 字节
"use strict";const t=require("../common/vendor.js"),d="http://health.shs.broing.cn",c=a=>new Promise((o,n)=>{t.index.request({url:d+a.url,method:a.method||"GET",data:a.data||{},header:{token:t.index.getStorageSync("token")||""},success:e=>{console.log(e,t.index.getStorageSync("token")),e.data.code==1?o(e.data.data):(e.data.code==401&&(t.index.navigateTo({url:"/pages/login/login"}),t.index.clearStorageSync()),n(e.data.msg))},fail:e=>{console.log(e),n(e)}})});exports.request=c;