未验证 提交 020bb921 编写于 作者: O openharmony_ci 提交者: Gitee

!14530 appaccount资料修改

Merge pull request !14530 from liushuling/master
......@@ -198,18 +198,23 @@ createAccountImplicitly(owner: string, callback: AuthCallback): void
**示例:**
```js
import featureAbility from '@ohos.ability.featureAbility';
function onResultCallback(code, result) {
console.log("resultCode: " + code);
console.log("result: " + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
let abilityStartSetting = {want: request};
featureAbility.startAbility(abilityStartSetting, (err) => {
let wantInfo = {
deviceId: '',
bundleName: 'com.example.accountjsdemo',
action: 'ohos.want.action.viewData',
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
console.log("startAbility successfully");
}).catch((err) => {
console.log("startAbility err: " + JSON.stringify(err));
});
})
}
try {
......@@ -252,18 +257,23 @@ createAccountImplicitly(owner: string, options: CreateAccountImplicitlyOptions,
**示例:**
```js
import featureAbility from '@ohos.ability.featureAbility';
function onResultCallback(code, result) {
console.log("resultCode: " + code);
console.log("result: " + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
let abilityStartSetting = {want: request};
featureAbility.startAbility(abilityStartSetting, (err) => {
let wantInfo = {
deviceId: '',
bundleName: 'com.example.accountjsdemo',
action: 'ohos.want.action.viewData',
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
console.log("startAbility successfully");
}).catch((err) => {
console.log("startAbility err: " + JSON.stringify(err));
});
})
}
let options = {
......@@ -1346,7 +1356,7 @@ auth(name: string, owner: string, authType: string, callback: AuthCallback): voi
**示例:**
```js
import featureAbility from '@ohos.ability.featureAbility';
function onResultCallback(code, authResult) {
console.log("resultCode: " + code);
......@@ -1354,10 +1364,17 @@ auth(name: string, owner: string, authType: string, callback: AuthCallback): voi
}
function onRequestRedirectedCallback(request) {
let abilityStartSetting = {want: request};
featureAbility.startAbility(abilityStartSetting, (err) => {
console.log("startAbility err: " + JSON.stringify(err));
});
let wantInfo = {
deviceId: '',
bundleName: 'com.example.accountjsdemo',
action: 'ohos.want.action.viewData',
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
console.log("startAbility successfully");
}).catch((err) => {
console.log("startAbility err: " + JSON.stringify(err));
})
}
try {
......@@ -1402,7 +1419,7 @@ auth(name: string, owner: string, authType: string, options: {[key: string]: Obj
**示例:**
```js
import featureAbility from '@ohos.ability.featureAbility';
function onResultCallback(code, authResult) {
console.log("resultCode: " + code);
......@@ -1410,10 +1427,17 @@ auth(name: string, owner: string, authType: string, options: {[key: string]: Obj
}
function onRequestRedirectedCallback(request) {
let abilityStartSetting = {want: request};
featureAbility.startAbility(abilityStartSetting, (err) => {
console.log("startAbility err: " + JSON.stringify(err));
});
let wantInfo = {
deviceId: '',
bundleName: 'com.example.accountjsdemo',
action: 'ohos.want.action.viewData',
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
console.log("startAbility successfully");
}).catch((err) => {
console.log("startAbility err: " + JSON.stringify(err));
})
}
let options = {
......@@ -2802,7 +2826,7 @@ addAccountImplicitly(owner: string, authType: string, options: {[key: string]: a
**示例:**
```js
import featureAbility from '@ohos.ability.featureAbility';
function onResultCallback(code, result) {
console.log("resultCode: " + code);
......@@ -2810,10 +2834,17 @@ addAccountImplicitly(owner: string, authType: string, options: {[key: string]: a
}
function onRequestRedirectedCallback(request) {
let abilityStartSetting = {want: request};
featureAbility.startAbility(abilityStartSetting, (err)=>{
let wantInfo = {
deviceId: '',
bundleName: 'com.example.accountjsdemo',
action: 'ohos.want.action.viewData',
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
console.log("startAbility successfully");
}).catch((err) => {
console.log("startAbility err: " + JSON.stringify(err));
});
})
}
appAccountManager.addAccountImplicitly("com.example.accountjsdemo", "getSocialData", {}, {
......@@ -3750,18 +3781,23 @@ authenticate(name: string, owner: string, authType: string, options: {[key: stri
**示例:**
```js
import featureAbility from '@ohos.ability.featureAbility';
function onResultCallback(code, result) {
console.log("resultCode: " + code);
console.log("result: " + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
let abilityStartSetting = {want: request};
featureAbility.startAbility(abilityStartSetting, (err)=>{
console.log("startAbility err: " + JSON.stringify(err));
});
let wantInfo = {
deviceId: '',
bundleName: 'com.example.accountjsdemo',
action: 'ohos.want.action.viewData',
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
console.log("startAbility successfully");
}).catch((err) => {
console.log("startAbility err: " + JSON.stringify(err));
})
}
appAccountManager.authenticate("LiSi", "com.example.accountjsdemo", "getSocialData", {}, {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册