瀏覽代碼

#IQRV #comment [Chromium] 直接上线使用UOS浏览器打开业务界面

gifur 3 年之前
父節點
當前提交
555eacdb24

+ 21 - 10
Module/mod_DeviceControl/DeviceControlFSM.cpp

@@ -172,22 +172,33 @@ void CDeviceControlFSM::DoBrowserCacheClearJob()
     err = spConfig->ReadConfigValue("Browser", "CacheClear", str);
     if (str.Compare("true", true) == 0) {
 
+        BOOL bSucc(FALSE);
         CSimpleStringA strCachePath;
         GetEntityBase()->GetFunction()->GetPath("Temp", strCachePath);
         if (!strCachePath.IsNullOrEmpty()) {
-            strCachePath += SPLIT_SLASH_STR;
-            strCachePath += "cefCache";
 
-            Dbg("browser cache path: %s", strCachePath.GetData());
+            bSucc = TRUE;
+
+            const char* cacheDirs[] = {"cefCache", "cefCache_Ad", "cefCache_breakdown", "cefCache_ErrNotify", "cefCache_main"
+                , "UOSBrowser_Ad", "UOSBrowser_main" };
+ 
+            for(int i=0; i<array_size(cacheDirs); ++i)
+            {
+                CSimpleStringA strcefCachePath(strCachePath);
+                strcefCachePath += SPLIT_SLASH_STR;
+                strcefCachePath += cacheDirs[i];
+
+                if (ExistsDirA(strcefCachePath)) {
+                    RemoveDirRecursiveA(strcefCachePath);
+                    LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER, 
+                            CSimpleStringA::Format("clear chromium browser cache: %s", strcefCachePath.GetData()));
+                }
 
-            if (ExistsDirA(strCachePath)) {
-                RemoveDirRecursiveA(strCachePath);
-                LogWarn(Severity_Middle, Error_Debug, LOG_DEVICECONTROL_BROWSER_CACHE_CLEAER, "clear chromium browser cache.");
-            }
+            } 
+        }
 
-            if (!ExistsDirA(strCachePath)) {
-                spConfig->WriteConfigValue("Browser", "CacheClear", NULL);
-            }
+        if (bSucc) {
+            spConfig->WriteConfigValue("Browser", "CacheClear", NULL);
         }
     }
 }

+ 4 - 2
Module/mod_chromium/CModTools.cpp

@@ -942,8 +942,10 @@ namespace Chromium {
 			CSmartPointer<IConfigInfo> spConfig;
 			m_pEntity->GetFunction()->OpenConfig(Config_Cache, spConfig);
 			CSimpleStringA value(true);
-			spConfig->ReadConfigValue("BusinessBrowserType", "Fulture", value);
-            m_bUseUOSBrowser = (value.Compare("1") == 0);
+			spConfig->ReadConfigValue("BusinessBrowserType", "FultureEx", value);
+            m_bUseUOSBrowser = (value.IsNullOrEmpty() || (value.Compare("1") != 0));
+		} else {
+			m_bUseUOSBrowser = true;
 		}
     }
 

+ 8 - 8
addin/res/ManagerDesktop/js/page/browser.js

@@ -20,12 +20,12 @@ function browserGenPage() {
             <div class="controls" style="margin-top:7px;">\
                 <div class="pull-left">\
                     <div onclick="radio(this)" name="browser_provider_radio" id="cefclient_browser"\
-                        class="radio_btn_on"></div>\
+                        class="radio_btn_off"></div>\
                 </div>\
                 <div class="pull-left" style="width:100px;">第三方</div>\
                 <div class="pull-left">\
                     <div onclick="radio(this)" name="browser_provider_radio" id="uos_browser"\
-                        class="radio_btn_off"></div>\
+                        class="radio_btn_on"></div>\
                 </div>\
                 <div class="pull-left" style="padding-top:0px;">系统自带\
                 </div>\
@@ -170,10 +170,10 @@ var browserController = (function() {
         req.configType = 7; //GlobalCache
         req.section = 'BusinessBrowserType';
         req.option = true;
-        req.key = 'Fulture';
+        req.key = 'FultureEx';
         req.reserved1 = 0;
         req.reserved2 = 0;
-        if(usingUOS) {
+        if(!usingUOS) {
             req.reserved3 = '1';
         } else {
             req.reserved3 = '0';
@@ -211,7 +211,7 @@ var browserController = (function() {
         req.configType = 7; //GlobalCache
         req.section = 'BusinessBrowserType';
         req.option = false;
-        req.key = 'Fulture';
+        req.key = 'FultureEx';
         req.reserved1 = 0;
         req.reserved2 = 0;
         req.reserved3 = '';
@@ -220,11 +220,11 @@ var browserController = (function() {
             if (ret.errorCode === 0) {
                 let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
                 if(result.value === '1') {
-                    $('#uos_browser').addClass('radio_btn_on').removeClass('radio_btn_off');
-                    $('#cefclient_browser').addClass('radio_btn_off').removeClass('radio_btn_on');
-                } else {
                     $('#cefclient_browser').addClass('radio_btn_on').removeClass('radio_btn_off');
                     $('#uos_browser').addClass('radio_btn_off').removeClass('radio_btn_on');
+                } else {
+                    $('#uos_browser').addClass('radio_btn_on').removeClass('radio_btn_off');
+                    $('#cefclient_browser').addClass('radio_btn_off').removeClass('radio_btn_on');
                 }
             } else {
                 $('#cefclient_browser').addClass('radio_btn_off_disabled').removeClass('radio_btn_on').removeClass('radio_btn_off');