权限使用记录资源获取

Signed-off-by: fanchenxuan <fanchenxuan@huawei.com>
This commit is contained in:
fanchenxuan 2023-08-28 16:02:15 +08:00
parent 1775a19158
commit 0af2525fd8

View File

@ -415,7 +415,7 @@ struct permissionRecordPage {
DD: date.getDate(),
NN: date.getHours() >= 12 ? this.strings.afternoon : this.strings.morning,
HH: date.getHours() >= 12 ? date.getHours() - 12 : date.getHours(),
mm: date.getMinutes() > 10 ? date.getMinutes() : '0' + date.getMinutes(),
mm: date.getMinutes() >= 10 ? date.getMinutes() : '0' + date.getMinutes(),
}
for (const key in config) {
@ -524,18 +524,13 @@ struct permissionRecordPage {
}
}
await globalThis.context.resourceManager.getString(info.appInfo.labelResource, (error, value) => {
if (value == undefined) {
appInfo.groupName = info.appInfo.label;
} else {
appInfo.groupName = value;
globalThis.allBundleInfo.forEach(bundleInfo => {
if (bundleInfo.bundleName === info.name) {
appInfo.groupName = bundleInfo.label;
appInfo.icon = bundleInfo.icon;
}
})
await globalThis.context.resourceManager.getMediaBase64(info.appInfo.iconResource, (error, value) => {
appInfo.icon = value;
})
appInfo.name = info.name;
appInfo.api = info.targetVersion;
appInfo.accessTokenId = info.appInfo.accessTokenId;