登录
This commit is contained in:
@@ -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}), // 微信登录
|
||||
/*
|
||||
首页信息
|
||||
*/
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user