10.18前的开发
This commit is contained in:
@@ -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), // 获取医院信息
|
||||
|
||||
/*
|
||||
首页信息
|
||||
*/
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user