| | |
| | | method: method || "GET", |
| | | url: this.serverUrl + url, |
| | | data: data || "", |
| | | // header: this.getHeader(), |
| | | success: (res) => { |
| | | if (typeof resFunction === 'function') { |
| | | resFunction.call(that, res) |
| | |
| | | method: method || "GET", |
| | | url: this.serverUrl + url, |
| | | data: data || "", |
| | | // header: this.getHeader(), |
| | | success: (res) => { |
| | | if (typeof resFunction === 'function') { |
| | | resFunction.call(that, res) |
| | |
| | | method: method || "GET", |
| | | url: this.serverUrl + url, |
| | | data: data || "", |
| | | // header: this.getHeader(), |
| | | success: (res) => { |
| | | resolve(res) |
| | | }, |
| | |
| | | method: method || "GET", |
| | | url: this.serverUrl + url, |
| | | data: data || "", |
| | | // header: this.getHeader(), |
| | | success: (res) => { |
| | | resolve(res) |
| | | }, |
| | |
| | | return httpUrl |
| | | } |
| | | |
| | | getHeader() { |
| | | let header = {} |
| | | let Token = uni.getStorageSync("Token") |
| | | |
| | | if (Token) { |
| | | header['Authorization'] = `Bearer ${uni.getStorageSync("Token")}` |
| | | } |
| | | |
| | | return header |
| | | } |
| | | } |
| | | |
| | | export const CommonUtils = new commonUtils() |