From ba6d7bda6bcd376a30e6771437a9a9f826fc6d6e Mon Sep 17 00:00:00 2001 From: jangheon Pyo Date: Fri, 21 Jun 2024 17:53:37 +0900 Subject: [PATCH] =?UTF-8?q?[=ED=99=98=EA=B2=BD=EC=A0=84=ED=99=98]=20local?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=ED=99=95=EC=9D=B8=ED=95=98=EA=B8=B0=20?= =?UTF-8?q?=EC=9C=84=ED=95=98=EC=97=AC=20appinfo=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20commonActions=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/actions/commonActions.js | 54 +++++++++++++------ com.twin.app.shoptime/webos-meta/appinfo.json | 24 ++++----- .../webos-meta/appinfo35.json | 14 +++++ .../webos-meta/appinfo79.json | 14 +++++ 4 files changed, 79 insertions(+), 27 deletions(-) create mode 100644 com.twin.app.shoptime/webos-meta/appinfo35.json create mode 100644 com.twin.app.shoptime/webos-meta/appinfo79.json diff --git a/com.twin.app.shoptime/src/actions/commonActions.js b/com.twin.app.shoptime/src/actions/commonActions.js index c8c2499e..577e4ee5 100644 --- a/com.twin.app.shoptime/src/actions/commonActions.js +++ b/com.twin.app.shoptime/src/actions/commonActions.js @@ -1,6 +1,8 @@ import Spotlight from "@enact/spotlight"; import appinfo from "../../webos-meta/appinfo.json"; +import appinfo35 from "../../webos-meta/appinfo35.json"; +import appinfo79 from "../../webos-meta/appinfo79.json"; import * as lunaSend from "../lunaSend"; import { types } from "./actionTypes"; @@ -86,7 +88,8 @@ export const getSystemSettings = () => (dispatch, getState) => { export const getHttpHeaderForServiceRequest = (onComplete) => (dispatch, getState) => { console.log("getHttpHeaderForServiceRequest "); - const { serverType, ricCodeSetting } = getState().localSettings; + const { serverType, ricCodeSetting, languageSetting } = + getState().localSettings; lunaSend.getHttpHeaderForServiceRequest({ onSuccess: (res) => { console.log("getHttpHeaderForServiceRequest", res); @@ -114,9 +117,23 @@ export const getHttpHeaderForServiceRequest = window.PalmSystem.identifier && process.env.REACT_APP_MODE !== "DEBUG" ) { - convertedRes["app_id"] = window.PalmSystem.identifier ?? appinfo.id; + if (ricCodeSetting === "aic") { + convertedRes["app_id"] = window.PalmSystem.identifier ?? appinfo.id; + } else if (ricCodeSetting === "eic") { + convertedRes["app_id"] = + window.PalmSystem.identifier ?? appinfo35.id; + } else if (ricCodeSetting === "ruc") { + convertedRes["app_id"] = + window.PalmSystem.identifier ?? appinfo79.id; + } } else { - convertedRes["app_id"] = appinfo.id; + if (ricCodeSetting === "aic") { + convertedRes["app_id"] = appinfo.id; + } else if (ricCodeSetting === "eic") { + convertedRes["app_id"] = appinfo35.id; + } else if (ricCodeSetting === "ruc") { + convertedRes["app_id"] = appinfo79.id; + } } //todo temp convertedRes["app_ver"] = "1.0.0"; //appinfo.version; @@ -131,33 +148,40 @@ export const getHttpHeaderForServiceRequest = convertedRes["dvc_auth"] = res["X-Authentication"]; //todo: for test if (serverType !== "system") { - if(ricCodeSetting === 'eic'){ - convertedRes["cntry_cd"] = "GB"; - convertedRes['X-Device-Country'] = "GB"; - res["HOST"] = "GB.nextlgsdp.com"; + if (ricCodeSetting === "eic") { + if (languageSetting === "GB") { + convertedRes["cntry_cd"] = "GB"; + convertedRes["X-Device-Country"] = "GB"; + res["HOST"] = "GB.nextlgsdp.com"; + } + if (languageSetting === "DE") { + convertedRes["cntry_cd"] = "DE"; + convertedRes["X-Device-Country"] = "DE"; + res["HOST"] = "DE.nextlgsdp.com"; + } } - if(ricCodeSetting === 'aic'){ + if (ricCodeSetting === "aic") { convertedRes["cntry_cd"] = "US"; - convertedRes['X-Device-Country'] = "US"; + convertedRes["X-Device-Country"] = "US"; res["HOST"] = "US.nextlgsdp.com"; } - if(ricCodeSetting === 'ruc'){ + if (ricCodeSetting === "ruc") { convertedRes["cntry_cd"] = "RU"; - convertedRes['X-Device-Country'] = "RU"; + convertedRes["X-Device-Country"] = "RU"; res["HOST"] = "RU.nextlgsdp.com"; } } //language Code - if(convertedRes["cntry_cd"] === "US"){ + if (convertedRes["cntry_cd"] === "US") { convertedRes["lang_cd"] = "en-US"; } - if(convertedRes["cntry_cd"] === "DE"){ + if (convertedRes["cntry_cd"] === "DE") { convertedRes["lang_cd"] = "de-DE"; } - if(convertedRes["cntry_cd"] === "GB"){ + if (convertedRes["cntry_cd"] === "GB") { convertedRes["lang_cd"] = "en-GB"; } - if(convertedRes["cntry_cd"] === "RU"){ + if (convertedRes["cntry_cd"] === "RU") { convertedRes["lang_cd"] = "ru-RU"; } diff --git a/com.twin.app.shoptime/webos-meta/appinfo.json b/com.twin.app.shoptime/webos-meta/appinfo.json index 132ca94e..7fed01ab 100644 --- a/com.twin.app.shoptime/webos-meta/appinfo.json +++ b/com.twin.app.shoptime/webos-meta/appinfo.json @@ -1,14 +1,14 @@ { - "id": "com.lgshop.app", - "version": "2.0.0", - "vendor": "T-Win", - "type": "web", - "main": "index.html", - "title": "Shop Time", - "icon": "icon.png", - "miniicon": "icon-mini.png", - "largeIcon": "icon-large.png", - "iconColor": "#ffffff", - "disableBackHistoryAPI": true, - "uiRevision": 2 + "id": "com.lgshop.app", + "version": "2.0.0", + "vendor": "T-Win", + "type": "web", + "main": "index.html", + "title": "Shop Time", + "icon": "icon.png", + "miniicon": "icon-mini.png", + "largeIcon": "icon-large.png", + "iconColor": "#ffffff", + "disableBackHistoryAPI": true, + "uiRevision": 2 } diff --git a/com.twin.app.shoptime/webos-meta/appinfo35.json b/com.twin.app.shoptime/webos-meta/appinfo35.json new file mode 100644 index 00000000..bedc4e14 --- /dev/null +++ b/com.twin.app.shoptime/webos-meta/appinfo35.json @@ -0,0 +1,14 @@ +{ + "id": "com.lgshop.app35", + "version": "2.0.0", + "vendor": "T-Win", + "type": "web", + "main": "index.html", + "title": "Shop Time", + "icon": "icon.png", + "miniicon": "icon-mini.png", + "largeIcon": "icon-large.png", + "iconColor": "#ffffff", + "disableBackHistoryAPI": true, + "uiRevision": 2 +} diff --git a/com.twin.app.shoptime/webos-meta/appinfo79.json b/com.twin.app.shoptime/webos-meta/appinfo79.json new file mode 100644 index 00000000..c79e71ad --- /dev/null +++ b/com.twin.app.shoptime/webos-meta/appinfo79.json @@ -0,0 +1,14 @@ +{ + "id": "com.lgshop.app79", + "version": "2.0.0", + "vendor": "T-Win", + "type": "web", + "main": "index.html", + "title": "Shop Time", + "icon": "icon.png", + "miniicon": "icon-mini.png", + "largeIcon": "icon-large.png", + "iconColor": "#ffffff", + "disableBackHistoryAPI": true, + "uiRevision": 2 +}