浏览代码

合并分支

yanj 2 天之前
父节点
当前提交
f40f8f19e3
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      utils/request.js

+ 8 - 2
utils/request.js

@@ -156,7 +156,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)
 }
 
@@ -165,7 +168,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)
 }