10.18前的开发

This commit is contained in:
2023-10-18 21:00:42 +08:00
parent 4fa658db18
commit aa47166ae7
70 changed files with 9936 additions and 172 deletions

View File

@@ -5,6 +5,11 @@ const API = {
//微信登录
getToken: data => net.POST('/login/token',data), // 获取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), // 更新用户信息
// 首页
getHospitalList:data => net.GET('/hospital/list',data), // 获取医院信息
/*
首页信息
*/

View File

@@ -3,13 +3,23 @@ import config from '../config'
// import store from '../store'
const loginUrl = 'pages/user/login';
// function JSON_to_URLEncoded(element,key,list){
// var list = list || [];
// if(typeof(element)=='object'){
// for (var idx in element)
// JSON_to_URLEncoded(element[idx],key?key+'['+idx+']':idx,list);
// } else {
// list.push(key+'='+encodeURIComponent(element));
// }
// return list.join('&');
// }
export default {
REQUEST(url, method = 'GET', data, checkLogin = true, header) {
let token = uni.getStorageSync('access_token') || 'Basic ZGV20mRldjEyMw==';
let token = uni.getStorageSync('access_token') || 'Basic ZGV2OmRldjEyMw==';
const headers = {
"Content-Type": "application/json",
// "Content-Type": "application/x-www-form-urlencoded",
// "Content-Type": "application/json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": token,
"x-token": token,
"token":token,
@@ -18,10 +28,6 @@ export default {
}
var pages = getCurrentPages();
var page = pages[pages.length - 1];
if(!header) {
headers["Content-Type"] = 'application/x-www-form-urlencode'
}
console.log("headers :",headers)
return uni.request({
url: config.baseUrl + url,
method,