Browse Source

修改注册流程

master
王健 4 years ago
parent
commit
3e0c101af1
  1. 7
      utils/api.js

7
utils/api.js

@ -10,7 +10,7 @@ const DELETE = 'DELETE';
function request(method, url, data, hasToke = true) {
let token = wx.getStorageSync('access_token')
let Authorization = token && hasToke ? `Bearer ${token}` : null;
let Authorization = token && hasToke ? `Bearer ${token}` : 'Basic YXBwOmFwcA==';
if (method.toUpperCase() === GET) {
let city = wx.getStorageSync('city')
city = city ? city : defaultCity
@ -24,10 +24,9 @@ function request(method, url, data, hasToke = true) {
return new Promise(function (resolve, reject) {
let header = {
'content-type': 'application/json',
'Authorization': Authorization
};
if (Authorization) {
header['Authorization'] = Authorization
}
wx.request({
url: baseURL + url,
method: method,

Loading…
Cancel
Save