Browse Source

Merge branch 'zhaosm' of http://120.26.79.179/luxf/mp_exhibitor_miniprog into zhaosm

xiaokuang 3 weeks ago
parent
commit
550df3c4d1
1 changed files with 8 additions and 2 deletions
  1. 8 2
      utils/request.js

+ 8 - 2
utils/request.js

@@ -155,7 +155,10 @@ export default request
  * @param {Object} url
  * @param {Object} params
  */
-export const get = (url) => (params) => {
+export const get = (url) => (params,baseUrl=null) => {
+	if (baseUrl) {
+		request.baseUrl = baseUrl
+	}
 	return request.get(url, params)
 }
 
@@ -164,7 +167,10 @@ export const get = (url) => (params) => {
  * @param {Object} url
  * @param {Object} params
  */
-export const post = (url) => (params) => {
+export const post = (url) => (params,baseUrl=null) => {
+	if (baseUrl) {
+		request.baseUrl = baseUrl
+	}
 	return request.post(url, params)
 }