2023.11.1修改

This commit is contained in:
2023-11-01 00:33:57 +08:00
parent 11cecc737f
commit 22c039a8eb
18 changed files with 497 additions and 88 deletions

View File

@@ -3,19 +3,22 @@ import net from './request.js';
// import store from '../store';
const API = {
//微信登录
getToken: data => net.POST('/login/token',data), // 获取token
getToken: data => net.POST('/login/token',data,true,{"Content-Type":"application/x-www-form-urlencoded"}), // 获取token
wx_login: (data,userId) => net.POST('/user/binding/wechat',data,true,{"userId":userId}), // 微信登录
// upload: (data) => net.POST('/user/upload',data), // 文件上传
userinfoUpdae:data => net.PUT('/user/info',data), // 更新用户信息
userinfoUpdae:data => net.PUT('/user/info',data,true,{"Content-Type":"application/x-www-form-urlencoded"}), // 更新用户信息
// 首页
getHospitalList:data => net.GET('/hospital/list',data), // 获取医院信息
saveVision:data => net.POST("/vision",data),// 保存视力测试结果
getLbtList:data => net.GET("/banner/list",data),// 获取轮播图
hospital:data => net.PUT("/user/hospital",data),// 修改医院信息
getTodoist:data => net.GET("/user/todo",data),// 获取待办事项
getVisionList:data => net.GET("/vision",data),// 获取测试记录
// 百科
getArticleList:data => net.GET("/article/list",data),// 百科列表
getArticleDetail:data => net.GET("/article/"+data.id),// 百科列表
getArticleDetail:data => net.GET("/article/"+data.id),// 文章详情
// 我的
getStarList:data => net.GET("/favorite/list",data),// 收藏列表
/*
首页信息
*/
@@ -407,7 +410,7 @@ const API = {
transfer: data => net.POST('/api/v1/wxpay/transfer', data),
// 获取我的收藏分页列表
getStarList: data => net.POST('/api/v1/favorite/get', data),
// getStarList: data => net.POST('/api/v1/favorite/get', data),
// 取消收藏
cancelStar: data => net.DELETE('/api/v1/favorite',data),
//添加收藏

View File

@@ -19,21 +19,27 @@ export default {
let token = uni.getStorageSync('access_token') || 'Basic ZGV2OmRldjEyMw==';
const headers = {
// "Content-Type": "application/json",
"Content-Type": "application/x-www-form-urlencoded",
// "Content-Type": "application/x-www-form-urlencoded",
"Authorization": token,
"x-token": token,
"token":token,
// "X-Forwarded-For":'client_ip'
// 'Referer':'twzxjy.com'
}
if(!header) {
headers["Content-Type"] = "application/json"
}
if(header && !header["Content-Type"]) {
header["Content-Type"] = "application/x-www-form-urlencoded"
}
var pages = getCurrentPages();
var page = pages[pages.length - 1];
return uni.request({
url: config.baseUrl + url,
method,
header: {
...header,
...headers
...headers,
...header
},
data
}).then(res => {