From 989195e367c9250194baf96bbcb1c7af665aa178 Mon Sep 17 00:00:00 2001 From: bianxinbo Date: Fri, 5 May 2023 21:14:35 +0800 Subject: [PATCH] api10andonhttperror Signed-off-by: bianxinbo --- arkui/ace_ets_web_dev/AppScope/app.json | 6 +++--- .../entry/src/main/ets/MainAbility/pages/web.ets | 10 ++++++++-- .../entry/src/main/ets/test/WebJsunit.test.ets | 2 +- arkui/ace_ets_web_dev/entry/src/main/module.json | 6 ++++++ arkui/ace_ets_web_dev_four/entry/src/main/module.json | 6 ++++++ arkui/ace_ets_web_dev_two/AppScope/app.json | 6 +++--- arkui/ace_ets_web_dev_two/entry/src/main/module.json | 6 ++++++ 7 files changed, 33 insertions(+), 9 deletions(-) diff --git a/arkui/ace_ets_web_dev/AppScope/app.json b/arkui/ace_ets_web_dev/AppScope/app.json index 94d263ab9..11be5a436 100644 --- a/arkui/ace_ets_web_dev/AppScope/app.json +++ b/arkui/ace_ets_web_dev/AppScope/app.json @@ -11,10 +11,10 @@ "distributedNotificationEnabled": true, "keepAlive": true, "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, + "minAPIVersion": 10, + "targetAPIVersion": 10, "car": { - "apiCompatibleVersion": 9, + "apiCompatibleVersion": 10, "singleUser": false } } diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets index 8a3b35926..c69fc9e30 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets +++ b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets @@ -56,6 +56,8 @@ struct Index { @State webVisibility: Visibility = Visibility.Visible @State isProgressFinish:boolean=false @State isHttpErrorReceive:boolean=false + @State isLargeThan:boolean=false + onPageShow(){ let valueChangeEvent={ eventId:10, @@ -414,7 +416,7 @@ struct Index { case "emitOnHttpErrorReceive":{ this.isHttpErrorReceive=true await Utils.sleep(1000) - this.controller.loadUrl({url:'https://example1.com/path/does/not/exist/index.jsp'}) + this.controller.loadUrl({url:'http://1.1.1.123/index.html'}) break; } case "emitOnTitleReceive":{ @@ -651,7 +653,11 @@ struct Index { if(this.isHttpErrorReceive){ console.info("isHttpErrorReceive==>") this.httpErrorReceive = event.response.getResponseCode() - Utils.emitEvent(this.httpErrorReceive,66) + if(this.httpErrorReceive>400){ + this.isLargeThan=true + Utils.emitEvent(this.isLargeThan,66) + } + this.isLargeThan=false this.isHttpErrorReceive=false } }) diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets index e328f33c9..38180ee8e 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets +++ b/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets @@ -449,7 +449,7 @@ export default function webJsunit() { */ it('onHttpErrorReceive',0,async function(done){ emitKey="emitOnTitleReceive"; - Utils.registerEvent("onHttpErrorReceive",404,66,done); + Utils.registerEvent("onHttpErrorReceive",true,66,done); sendEventByKey('webcomponent',10,''); }) /* diff --git a/arkui/ace_ets_web_dev/entry/src/main/module.json b/arkui/ace_ets_web_dev/entry/src/main/module.json index 41c05e575..0729db882 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/module.json +++ b/arkui/ace_ets_web_dev/entry/src/main/module.json @@ -14,6 +14,12 @@ "installationFree": false, "uiSyntax": "ets", "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "abilities": [{ "name": "com.example.myapplication.MainAbility", "srcEntrance": "./ets/MainAbility/MainAbility.ts", diff --git a/arkui/ace_ets_web_dev_four/entry/src/main/module.json b/arkui/ace_ets_web_dev_four/entry/src/main/module.json index 41c05e575..988c1bf8e 100644 --- a/arkui/ace_ets_web_dev_four/entry/src/main/module.json +++ b/arkui/ace_ets_web_dev_four/entry/src/main/module.json @@ -14,6 +14,12 @@ "installationFree": false, "uiSyntax": "ets", "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "abilities": [{ "name": "com.example.myapplication.MainAbility", "srcEntrance": "./ets/MainAbility/MainAbility.ts", diff --git a/arkui/ace_ets_web_dev_two/AppScope/app.json b/arkui/ace_ets_web_dev_two/AppScope/app.json index a76ab24e0..7da2b7958 100644 --- a/arkui/ace_ets_web_dev_two/AppScope/app.json +++ b/arkui/ace_ets_web_dev_two/AppScope/app.json @@ -11,10 +11,10 @@ "distributedNotificationEnabled": true, "keepAlive": true, "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, + "minAPIVersion": 10, + "targetAPIVersion": 10, "car": { - "apiCompatibleVersion": 9, + "apiCompatibleVersion": 10, "singleUser": false } } diff --git a/arkui/ace_ets_web_dev_two/entry/src/main/module.json b/arkui/ace_ets_web_dev_two/entry/src/main/module.json index 41c05e575..988c1bf8e 100644 --- a/arkui/ace_ets_web_dev_two/entry/src/main/module.json +++ b/arkui/ace_ets_web_dev_two/entry/src/main/module.json @@ -14,6 +14,12 @@ "installationFree": false, "uiSyntax": "ets", "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "abilities": [{ "name": "com.example.myapplication.MainAbility", "srcEntrance": "./ets/MainAbility/MainAbility.ts", -- GitLab