Przeglądaj źródła

fix: 接口封装增加terminal参数

carver 2 lat temu
rodzic
commit
c899970a7c

+ 1 - 0
antbuilder/core/utils/constants.js

@@ -37,6 +37,7 @@ export const { debugNoCache } = globalExt;
 export const { ywtUrl: ywtHost } = globalExt;
 export const { ywtPrefix: ywtEnvVersionPrefix } = globalExt;
 export const { gwAppId } = globalExt;
+export const { terminal } = globalExt;
 
 export const universeUrl = host.replace("ab-saas-api", "universe");
 

+ 3 - 2
antbuilder/core/utils/request.js

@@ -1,8 +1,7 @@
 import { getIn } from "herculex/dist/utils/manipulate";
-import { host, getTicketUrl, ywtRequestUrl } from "./constants";
+import { host, getTicketUrl, ywtRequestUrl, terminal } from "./constants";
 import { getSilentAuthCode, getAppId, getServerTime } from "./jsapi";
 import { joinUrl } from "./format";
-import { getStorage } from "./index";
 
 function showErrorMessgage({ isShowError, error }) {
 	if (isShowError) {
@@ -41,6 +40,7 @@ export function _request({
 			data: Object.assign(data, {
 				userId: app.globalData.ywtUserIdToken || "",
 				appId: app.globalData.appId || "",
+				terminal,
 			}),
 			headers: {
 				"content-type": "application/x-www-form-urlencoded",
@@ -118,6 +118,7 @@ export function _ywtRequest({
 			data: Object.assign(data, {
 				userId: app.globalData.ywtUserIdToken || "",
 				appId: app.globalData.appId || "",
+				terminal,
 			}),
 			headers: {
 				...headers,

+ 0 - 4
antbuilder/core/utils/service.js

@@ -80,10 +80,6 @@ export async function checkUserInfo() {
 	if (userInfo) {
 		const [ywtErr, ywtResult] = await ywtAuth({ ticket, gwAppId });
 		if (!ywtErr && ywtResult && ywtResult.token) {
-			my.setStorageSync({
-				key: "YWT_TOKEN",
-				data: "Bearer " + ywtResult.token,
-			});
 			app.globalData.ywtToken = "Bearer " + ywtResult.token;
 			app.globalData.ywtUserIdToken = ywtResult.userId;
 		}

+ 2 - 1
config.by.prod.json

@@ -12,7 +12,8 @@
 			"openNewVersion": true,
 			"debugNoCache": true,
 			"debugTemplateUuid": "",
-			"env": "prod"
+			"env": "prod",
+			"terminal": 24
 		}
 	}
 }

+ 2 - 1
config.by.qa.json

@@ -12,7 +12,8 @@
 			"openNewVersion": true,
 			"debugNoCache": true,
 			"debugTemplateUuid": "",
-			"env": "qa"
+			"env": "qa",
+			"terminal": 24
 		}
 	}
 }

+ 2 - 1
config.json

@@ -12,7 +12,8 @@
 			"openNewVersion": true,
 			"debugNoCache": true,
 			"debugTemplateUuid": "",
-			"env": "qa"
+			"env": "qa",
+			"terminal": 24
 		}
 	}
 }