Ver Fonte

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

xiaokuang há 3 semanas atrás
pai
commit
550df3c4d1
1 ficheiros alterados com 8 adições e 2 exclusões
  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)
 }