提交 459db85a 编写于 作者: X xinking129

code check

Signed-off-by: Nxinking129 <xinxin13@huawei.com>
上级 917fc27a
...@@ -30,23 +30,23 @@ export default class EntryAbility extends UIAbility { ...@@ -30,23 +30,23 @@ export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'Abilitytest4 onCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'Abilitytest4 onCreate');
globalThis.terminate = () => { globalThis.terminate = () => {
setTimeout(() => { setTimeout(() => {
this.context.terminateSelf().then(() => { this.context.terminateSelf().then(() => {
console.info('====>EntryAbility terminateSelf end'); console.info('====>EntryAbility terminateSelf end');
}).catch((err) => { }).catch((err) => {
console.info('====>EntryAbility terminateSelf err:' + JSON.stringify(err)); console.info('====>EntryAbility terminateSelf err:' + JSON.stringify(err));
}); });
}, timeout); }, timeout);
}; };
console.info('Ability4 onCreate' + JSON.stringify(want)); console.info('Ability4 onCreate' + JSON.stringify(want));
let actionStr = want.action; let actionStr = want.action;
if (actionStr === 'ohos.nfc.tag.action.TAG_FOUND') { if (actionStr === 'ohos.nfc.tag.action.TAG_FOUND') {
hilog.info(0x0000, 'testTag', '%{public}s', 'a4Ability ok'); hilog.info(0x0000, 'testTag', '%{public}s', 'a4Ability ok');
commonEventData.parameters.message = 'select'; commonEventData.parameters.message = 'select';
commonEvent.publish('ACTS_CROSS_CALL_EVENT', commonEventData, (err) => { commonEvent.publish('ACTS_CROSS_CALL_EVENT', commonEventData, (err) => {
console.info('====>' + actionStr + ' apublish err:' + JSON.stringify(err)); console.info('====>' + actionStr + ' apublish err:' + JSON.stringify(err));
globalThis.terminate(); globalThis.terminate();
}); });
} }
} }
...@@ -59,11 +59,11 @@ export default class EntryAbility extends UIAbility { ...@@ -59,11 +59,11 @@ export default class EntryAbility extends UIAbility {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability4 onWindowStageCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability4 onWindowStageCreate');
windowStage.loadContent('pages/Index', (err, data) => { windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) { if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return; return;
} }
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
}); });
} }
......
...@@ -36,13 +36,13 @@ export default class FourthEntryAbility extends Ability { ...@@ -36,13 +36,13 @@ export default class FourthEntryAbility extends Ability {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
windowStage.loadContent('pages/Index', (err, data) => { windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) { if (err.code) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR);
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return; return;
} }
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
}); });
} }
......
...@@ -36,13 +36,13 @@ export default class FourthentryAbility extends UIAbility { ...@@ -36,13 +36,13 @@ export default class FourthentryAbility extends UIAbility {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
windowStage.loadContent('pages/Index', (err, data) => { windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) { if (err.code) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR);
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return; return;
} }
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册