From 459db85a0a9325bcc196816733592269df279fbd Mon Sep 17 00:00:00 2001 From: xinking129 Date: Mon, 17 Jul 2023 13:48:46 +0800 Subject: [PATCH] code check Signed-off-by: xinking129 --- .../src/main/ets/entryability/EntryAbility.ts | 36 +++++++++---------- .../fourthentryability/FourthEntryAbility.ts | 14 ++++---- .../fourthentryability/FourthentryAbility.ts | 14 ++++---- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyFifth/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyFifth/entry/src/main/ets/entryability/EntryAbility.ts index 7c441db19..7abdd5650 100644 --- a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyFifth/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyFifth/entry/src/main/ets/entryability/EntryAbility.ts @@ -30,23 +30,23 @@ export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.info(0x0000, 'testTag', '%{public}s', 'Abilitytest4 onCreate'); globalThis.terminate = () => { - setTimeout(() => { - this.context.terminateSelf().then(() => { - console.info('====>EntryAbility terminateSelf end'); - }).catch((err) => { - console.info('====>EntryAbility terminateSelf err:' + JSON.stringify(err)); - }); - }, timeout); + setTimeout(() => { + this.context.terminateSelf().then(() => { + console.info('====>EntryAbility terminateSelf end'); + }).catch((err) => { + console.info('====>EntryAbility terminateSelf err:' + JSON.stringify(err)); + }); + }, timeout); }; console.info('Ability4 onCreate' + JSON.stringify(want)); let actionStr = want.action; if (actionStr === 'ohos.nfc.tag.action.TAG_FOUND') { - hilog.info(0x0000, 'testTag', '%{public}s', 'a4Ability ok'); - commonEventData.parameters.message = 'select'; - commonEvent.publish('ACTS_CROSS_CALL_EVENT', commonEventData, (err) => { - console.info('====>' + actionStr + ' apublish err:' + JSON.stringify(err)); - globalThis.terminate(); - }); + hilog.info(0x0000, 'testTag', '%{public}s', 'a4Ability ok'); + commonEventData.parameters.message = 'select'; + commonEvent.publish('ACTS_CROSS_CALL_EVENT', commonEventData, (err) => { + console.info('====>' + actionStr + ' apublish err:' + JSON.stringify(err)); + globalThis.terminate(); + }); } } @@ -59,11 +59,11 @@ export default class EntryAbility extends UIAbility { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability4 onWindowStageCreate'); windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); }); } diff --git a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiAbility/entry/src/main/ets/fourthentryability/FourthEntryAbility.ts b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiAbility/entry/src/main/ets/fourthentryability/FourthEntryAbility.ts index f82d692cc..b35128973 100644 --- a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiAbility/entry/src/main/ets/fourthentryability/FourthEntryAbility.ts +++ b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiAbility/entry/src/main/ets/fourthentryability/FourthEntryAbility.ts @@ -36,13 +36,13 @@ export default class FourthEntryAbility extends Ability { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); }); } diff --git a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiHapFourth/entry/src/main/ets/fourthentryability/FourthentryAbility.ts b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiHapFourth/entry/src/main/ets/fourthentryability/FourthentryAbility.ts index 6fe00952e..1d7a75ef5 100644 --- a/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiHapFourth/entry/src/main/ets/fourthentryability/FourthentryAbility.ts +++ b/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyMultiHapFourth/entry/src/main/ets/fourthentryability/FourthentryAbility.ts @@ -36,13 +36,13 @@ export default class FourthentryAbility extends UIAbility { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); - return; - } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); }); } -- GitLab