@Component
struct loginPage {
private windowClass = AppStorage.get("windowClass") as window.Window
// 开启隐私模式
screenshotYes() {
let isPrivacyMode: boolean = true;
try {
this.windowClass.setWindowPrivacyMode(isPrivacyMode, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in setting the window to privacy mode.');
});
} catch (exception) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception));
}
}
// 关闭隐私模式
screenshotNo() {
let isPrivacyMode: boolean = false;
try {
this.windowClass.setWindowPrivacyMode(isPrivacyMode, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(err));
return;
}
console.info('Succeeded in setting the window to privacy mode.');
});
} catch (exception) {
console.error('Failed to set the window to privacy mode. Cause:' + JSON.stringify(exception));
}
}
}
开启隐私页面和关闭隐私页面
最新推荐文章于 2025-12-03 18:49:33 发布
1575

被折叠的 条评论
为什么被折叠?



