This commit is contained in:
2023-10-11 22:20:34 +08:00
parent 60bf302119
commit 4fa658db18
70 changed files with 14216 additions and 23 deletions

View File

@@ -1,8 +1,10 @@
import net from './request.js';
// import store from '../store';
const API = {
//微信登录
getToken: data => net.POST('/login/token',data), // 获取token
wx_login: (data,userId) => net.POST('/user/binding/wechat',data,true,{"userId":userId}), // 微信登录
/*
首页信息
*/

View File

@@ -6,9 +6,10 @@ const loginUrl = 'pages/user/login';
export default {
REQUEST(url, method = 'GET', data, checkLogin = true, header) {
let token = uni.getStorageSync('access_token') || '';
let token = uni.getStorageSync('access_token') || 'Basic ZGV20mRldjEyMw==';
const headers = {
"Content-Type": "application/json",
// "Content-Type": "application/x-www-form-urlencoded",
"Authorization": token,
"x-token": token,
"token":token,
@@ -17,7 +18,10 @@ 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,