更新大理市民卡app
diff --git a/static/js/http.interceptor.js b/static/js/http.interceptor.js
new file mode 100644
index 0000000..89d1562
--- /dev/null
+++ b/static/js/http.interceptor.js
@@ -0,0 +1,100 @@
+const install = (Vue, vm) => {
+	// 此为自定义配置参数,具体参数见上方说明
+	Vue.prototype.$u.http.setConfig({
+		// baseUrl: 'https://yy.dlsmk.cn/payapi/mobileapi', // 大理智警域名 
+		baseUrl:'https://yy.dlsmk.cn/portal/mobileapi', //正式地址
+		// baseUrl:'http://yy.dlsmk.cn:8080/portal/mobileapi', //测试地址
+		// baseUrl: "http://172.28.43.20:8089/portal/mobileapi",//本地地址
+		// method: 'POST',
+		// 设置为json,返回后会对数据进行一次JSON.parse()
+		dataType: 'json',
+		// sslVerify:false,
+		showLoading: true, // 是否显示请求中的loading
+		loadingText: '请求中...', // 请求loading中的文字提示
+		loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
+		originalData: true, // 是否在拦截器中返回服务端的原始数据
+		loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
+		// 配置请求头信息
+		header: {
+			'content-type': 'application/x-www-form-urlencoded'
+		},
+	});
+	// 请求拦截部分,如配置,每次请求前都会执行
+	Vue.prototype.$u.http.interceptor.request = (config) => {
+		const token = uni.getStorageSync('token');
+		const tenantid = uni.getStorageSync('tenantid');
+		if (token) {
+			config.header['Authorization'] = "Bearer " + token;
+		}else{
+			config.header['Authorization'] = ''
+		}
+		//console.log(config.url,config.header['Authorization'])
+		config.header["X-TENANT-ID"] = tenantid;
+		if (config.url == "/i/activity" || config.url == "/v1/feedback/release" || config.url == '/medicineapi/medicalcard/add') {
+			config.header['content-type'] = "application/json";
+		} else {
+			config.header['content-type'] = "application/x-www-form-urlencoded";
+		}
+		return config;
+	}
+	// 响应拦截,如配置,每次请求结束都会执行本方法
+	Vue.prototype.$u.http.interceptor.response = (res) => {
+		// console.log(res)
+		if (res.statusCode == 200) {
+			// res为服务端返回值,可能有code,result等字段
+			// 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到
+			// 如果配置了originalData为true,请留意这里的返回值
+			if (res.data.code == 200) {
+				return res.data
+			} else if(res.data.code == 500){
+				uni.showModal({
+					title: "提示",
+					content: res.data.code + ":" + res.data.msg,
+					showCancel: false,
+				})
+				return false;
+			} else {
+				uni.showModal({
+					title: "错误",
+					content: res.data.code + ":" + res.data.msg,
+					showCancel: false,
+				})
+				return false;
+			}
+		} else if (res.statusCode == 401) {
+			uni.showToast({
+				title: "登录状态失效,请重新登录",
+				icon: "none",
+				mask:true,
+				duration: 1500,
+				complete(res) {
+					setTimeout(() => {
+						uni.reLaunch({
+							url: "/pages/sub_basic/login/index"
+						})
+					}, 1500)
+				}
+			})
+
+			return false;
+		} else {
+			// 如果返回false,则会调用Promise的reject回调,
+			// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
+			if(res.errMsg.indexOf('fail') == -1){
+				uni.showModal({
+					title: "错误",
+					content: res.data.status + ":" + res.data.message,
+					// content: `${res.data.status}:${res.data.message}`,
+					showCancel: false,
+				})
+			}
+			return false;
+		}
+	}
+
+}
+
+
+// export default install
+module.exports = install
+