|
@@ -21,28 +21,31 @@ function initData(params) {
|
|
|
|
|
|
let project = host.PROJECT;
|
|
|
|
|
|
+
|
|
|
export default async (url = '', baseUrl = '', data = {}, dataType = 'JSON', type = 'GET', pathArr = [], method = 'fetch') => {
|
|
|
type = type.toUpperCase();
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
baseUrl = baseUrl;
|
|
|
} else if (process.env.NODE_ENV === 'production') {
|
|
|
if (baseUrl) {
|
|
|
+ let buildUrl = "https://pms.hajwy.com/"
|
|
|
+ // let buildUrl = "https://test.hajwy.com/"
|
|
|
switch (baseUrl) {
|
|
|
case '/landcrm':
|
|
|
// baseUrl = 'https://test.hajwy.com/landcrm';
|
|
|
- baseUrl = 'https://pms.hajwy.com/landcrm';
|
|
|
+ baseUrl = buildUrl + 'landcrm';
|
|
|
break;
|
|
|
case '/purchase': //
|
|
|
// baseUrl = "https://test.hajwy.com/purchase";
|
|
|
- baseUrl = 'https://pms.hajwy.com/purchase';
|
|
|
+ baseUrl = buildUrl + 'purchase';
|
|
|
break;
|
|
|
case '/hajwy': //
|
|
|
// baseUrl = "https://test.hajwy.com/qpi/rest";
|
|
|
- baseUrl = 'https://pms.hajwy.com/qpi/rest';
|
|
|
+ baseUrl = buildUrl + 'qpi/rest';
|
|
|
break;
|
|
|
case '/mkf': //
|
|
|
// baseUrl = "https://test.hajwy.com/landcrm";
|
|
|
- baseUrl = 'https://pms.hajwy.com/landcrm';
|
|
|
+ baseUrl = buildUrl + 'landcrm';
|
|
|
break;
|
|
|
default:
|
|
|
baseUrl = "";
|