提交 b92e6430 编写于 作者: lizhongyi_'s avatar lizhongyi_

调整uni-usercapturescree 防截屏参数

上级 7a9e40e8
......@@ -27,7 +27,7 @@
return {
title: 'Hello',
memListener:null,
setUserCaptureScreenFlag: true,
setUserCaptureScreenFlag: false,
setUserCaptureScreenText: '禁止截屏'
}
},
......@@ -162,16 +162,15 @@
title:'捕获截屏事件'
})
}
});
});
if (uni.getSystemInfoSync().platform != "android") {
// 除android 之外的平台,直接提示监听已开启
uni.showToast({
icon:"none",
title:'截屏监听已开启'
})
}
if (uni.getSystemInfoSync().platform != "android") {
// 除android 之外的平台,直接提示监听已开启
uni.showToast({
icon:"none",
title:'截屏监听已开启'
})
}
},
testScreenShotOff() {
uni.offUserCaptureScreen(function(res) {
......@@ -197,7 +196,7 @@
testSetUserCaptureScreen() {
let flag = this.setUserCaptureScreenFlag;
uni.setUserCaptureScreen({
open: flag,
enable: flag,
success: (res) => {
console.log("setUserCaptureScreen open: " + flag + " success: " + JSON.stringify(res));
},
......@@ -214,9 +213,9 @@
});
this.setUserCaptureScreenFlag = !this.setUserCaptureScreenFlag;
if (this.setUserCaptureScreenFlag) {
this.setUserCaptureScreenText = '禁止截屏';
} else {
this.setUserCaptureScreenText = '允许截屏';
} else {
this.setUserCaptureScreenText = '禁止截屏';
}
},
}
......
......@@ -138,10 +138,10 @@ export const setUserCaptureScreen : SetUserCaptureScreen = function (options : S
options.fail?.(res);
options.complete?.(res);
} else {
if (options.open == true) {
CaptureScreenTool.onAntiScreenshot(options)
} else {
if (options.enable == true) {
CaptureScreenTool.offAntiScreenshot(options)
} else {
CaptureScreenTool.onAntiScreenshot(options)
}
}
}
......
......@@ -18,9 +18,9 @@ export type UserCaptureScreenResult = {
export type SetUserCaptureScreenOption = {
/**
* true: 开启防截屏 false: 关闭防截屏
* true: 允许用户截屏 false: 不允许用户截屏,防止用户截屏到应用页面内容
*/
open : boolean;
enable : boolean;
/**
* 接口调用成功的回调函数
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册