Commit 0734857c by liang ce

去掉OrgId

parent 2df7cb65
...@@ -72,15 +72,16 @@ axios.interceptors.response.use(res => { ...@@ -72,15 +72,16 @@ axios.interceptors.response.use(res => {
const $http = { const $http = {
post: (url, data) => { post: (url, data) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let postData // let postData
if (data === undefined) { // if (data === undefined) {
postData = { // postData = {
orgId: localStorage.getItem('orgId') // orgId: localStorage.getItem('orgId')
} // }
} else { // } else {
postData = data // postData = data
postData.orgId = localStorage.getItem('orgId') // postData.orgId = localStorage.getItem('orgId')
} // }
let postData = data === undefined ? data : ''
axios.post(`${BASE_URL}${url}`, postData, { axios.post(`${BASE_URL}${url}`, postData, {
headers: { headers: {
'Content-Type': 'application/json; charset=UTF-8' 'Content-Type': 'application/json; charset=UTF-8'
...@@ -92,16 +93,16 @@ const $http = { ...@@ -92,16 +93,16 @@ const $http = {
}, },
get: (url, data) => { get: (url, data) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let getData // let getData
if (data === undefined) { // if (data === undefined) {
getData = { // getData = {
orgId: localStorage.getItem('orgId') // orgId: localStorage.getItem('orgId')
} // }
} else { // } else {
getData = data // getData = data
getData.orgId = localStorage.getItem('orgId') // getData.orgId = localStorage.getItem('orgId')
} // }
getData = qs.stringify(getData) let getData = data ? qs.stringify(data) : ''
axios.get(`${BASE_URL}${url}?${getData}`).then((res) => { axios.get(`${BASE_URL}${url}?${getData}`).then((res) => {
return resolve(res) return resolve(res)
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment