配置全局变量
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import http from './http.js'
|
||||
let baseUrl = http.baseUrl
|
||||
let URL_CONFIG = http.URL_CONFIG
|
||||
import { baseUrl, URL_CONFIG } from '../project.config'
|
||||
|
||||
/* 配置路径 */
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ let apiUrl = {
|
||||
}
|
||||
|
||||
export default {
|
||||
baseUrl,
|
||||
URL_CONFIG,
|
||||
//微信账号密码登陆--1
|
||||
wxLoginByUserName(option, success, error) {
|
||||
http.post1(baseUrl + apiUrl.wxLoginByUserName, option).then(res => {
|
||||
@@ -39,8 +37,3 @@ export default {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export{
|
||||
baseUrl,
|
||||
URL_CONFIG
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
import { baseUrl } from '../project.config'
|
||||
let headerDefault = {
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
@@ -6,8 +6,6 @@ let headerDefault1 = {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
let TokenKey = 'X-Access-Token'
|
||||
let baseUrl = 'http://bxxt.hzwlsoft.com:1015'
|
||||
let URL_CONFIG = '/jero-boot/'
|
||||
|
||||
const http = (method, url, data, header= headerDefault) => {
|
||||
let Authorization = wx.getStorageSync(TokenKey) ? wx.getStorageSync(TokenKey) : '';
|
||||
@@ -39,8 +37,6 @@ const http = (method, url, data, header= headerDefault) => {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
baseUrl,
|
||||
URL_CONFIG,
|
||||
get: (url, data, header) => http('GET', url, data, header),
|
||||
post: (url, data, header) => http('POST', url, data, header),
|
||||
post1: (url, data, header) => http('POST', url, data, headerDefault1),
|
||||
|
||||
Reference in New Issue
Block a user