|
|
@@ -10,13 +10,17 @@ const WuBianConstKey = {
|
|
|
// 基础数据
|
|
|
UserInfo: 'WubianUserInfo',
|
|
|
Token: 'WubianProToken',
|
|
|
+ BrowserProxyUrl: 'WubianBrowserProxyUrl',
|
|
|
+ TenantId: 'WubianTenantId',
|
|
|
+ AllMarketGroupListData: 'WubianAllMarketGroupListData',
|
|
|
+
|
|
|
ActivityListData: 'WubianActivityListData',
|
|
|
ActivityGoodsList: 'WubianActivityGoodsList',
|
|
|
ActivityTaskCaptureEnabled: 'WubianActivityTaskCaptureEnabled',
|
|
|
ActivityTagName: 'WubianActivityActivityTagName',
|
|
|
ActivityIndexName: 'WubianActivityIndexName',
|
|
|
ActivityId: 'WubianActivityId',
|
|
|
- TenantId: 'WubianTenantId',
|
|
|
+
|
|
|
FirstOrderCaptureEnabled: 'WubianFirstOrderCaptureEnabled',
|
|
|
FirstArtListData: 'WubianFirstArtListData',
|
|
|
FirstGoodsId: 'WubianFirstGoodsId',
|
|
|
@@ -519,6 +523,35 @@ async function getUrlLocation(url) {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+async function openUrlByRemoteBrowser(url) {
|
|
|
+ let headers = gCommonHeaders;
|
|
|
+ let data = {
|
|
|
+ url: url,
|
|
|
+ headers: headers,
|
|
|
+ };
|
|
|
+ let proxyUrl = magicJS.data.read(WuBianConstKey.BrowserProxyUrl, 'http://127.0.0.1:5000/proxy');
|
|
|
+ let options = {
|
|
|
+ url: proxyUrl,
|
|
|
+ headers: headers,
|
|
|
+ body: JSON.stringify(data),
|
|
|
+ };
|
|
|
+ let result = await magicJS.http.post(options).then(response => {
|
|
|
+ try {
|
|
|
+ magicJS.logger.info(JSON.stringify(response));
|
|
|
+ const body = response.body;
|
|
|
+ magicJS.logger.info(body);
|
|
|
+ return body;
|
|
|
+ } catch (e) {
|
|
|
+ magicJS.logger.error(e);
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ const msg = `请求代理浏览器异常\n${JSON.stringify(err)}`;
|
|
|
+ magicJS.logger.error(msg);
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
Main().catch((e) => magicJS.logger.log(`-\n ${e}`)).finally(() => magicJS.done());
|
|
|
|
|
|
|