From e44ecb571bb2df6390503f4303282e18db5d60ef Mon Sep 17 00:00:00 2001
From: lgq <1015864684@qq.com>
Date: 星期一, 20 四月 2026 13:43:52 +0800
Subject: [PATCH] 1.修复安全入仓联动控制按钮无权限问题 2.增加安全入仓联动控制配置项,默认不启用 3.修改气体浓度验证选项默认不启用 4.增加门禁web页面源码 Changes to be committed: new file: "face_webserver/ modified: vf107/src/config.json modified: vf107/src/service/grainService.js modified: vf107/src/view/config/menu/doorControlView.js modified: vf107/src/view/mainView.js
---
vf107/src/view/mainView.js | 278 +++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 255 insertions(+), 23 deletions(-)
diff --git a/vf107/src/view/mainView.js b/vf107/src/view/mainView.js
index 7fd7566..3680c43 100644
--- a/vf107/src/view/mainView.js
+++ b/vf107/src/view/mainView.js
@@ -21,7 +21,8 @@
const mainView = {
authComplete: false, // 璁よ瘉鏄惁瀹屾垚锛岀敤浜庢帶鍒禪I鏇存柊
verifiedUsers: {}, // 瀛樺偍宸叉牳楠屾垚鍔熺殑鐢ㄦ埛淇℃伅
- eventListenersRegistered: false // 浜嬩欢鐩戝惉鍣ㄦ槸鍚﹀凡娉ㄥ唽
+ eventListenersRegistered: false, // 浜嬩欢鐩戝惉鍣ㄦ槸鍚﹀凡娉ㄥ唽
+ resetTimerId: null // 瀛樺偍閲嶇疆鐢ㄦ埛UI鐨勫畾鏃跺櫒ID
}
// 鍔犺浇涓昏鍥剧殑鏂规硶
@@ -30,8 +31,8 @@
// 渚嬪鏇存柊璁惧淇℃伅銆佹皵浣撴祿搴︽暟鎹瓑
try {
// 鏇存柊璁惧淇℃伅
- let config = screen.getConfig()
- let sn = config["sys.sn"] || ""
+ let screenConfig = screen.getConfig()
+ let sn = screenConfig["sys.sn"] || ""
// 鐩存帴浠巒et妯″潡鑾峰彇IP鍦板潃锛岀‘淇濊幏鍙栧埌鏈�鏂扮殑IP
let ip = ""
try {
@@ -41,8 +42,8 @@
ip = param.ip
}
} catch (error) {
- // 鍑洪敊鏃朵娇鐢╟onfig涓殑IP
- ip = config["net.ip"] || ""
+ // 鍑洪敊鏃朵娇鐢╯creenConfig涓殑IP
+ ip = screenConfig["net.ip"] || ""
}
// 閫氳繃mainView瀵硅薄璁块棶鏍囩
if (mainView.snInfoLbl && mainView.ipInfoLbl) {
@@ -81,8 +82,8 @@
// 鏇存柊璁惧淇℃伅锛圫N鍜孖P锛�
function updateDeviceInfo() {
- let config = screen.getConfig()
- let sn = config["sys.sn"] || ""
+ let screenConfig = screen.getConfig()
+ let sn = screenConfig["sys.sn"] || ""
// 鐩存帴浠巒et妯″潡鑾峰彇IP鍦板潃锛岀‘淇濊幏鍙栧埌鏈�鏂扮殑IP
let ip = ""
try {
@@ -92,8 +93,8 @@
ip = param.ip
}
} catch (error) {
- // 鍑洪敊鏃朵娇鐢╟onfig涓殑IP
- ip = config["net.ip"] || ""
+ // 鍑洪敊鏃朵娇鐢╯creenConfig涓殑IP
+ ip = screenConfig["net.ip"] || ""
}
// 閫氳繃mainView瀵硅薄璁块棶鏍囩
if (mainView.snInfoLbl && mainView.ipInfoLbl) {
@@ -109,11 +110,11 @@
// 鏇存柊搴撳尯鍚嶇О鍜屼粨鍙凤紙鍙湪绋嬪簭鍚姩鍜岄厤缃慨鏀规椂璋冪敤锛�
function updateWarehouseInfo() {
- let config = screen.getConfig()
+ let screenConfig = screen.getConfig()
// 鑾峰彇浠撳彿淇℃伅
- let houseName = config["houseName"] || "01鍙蜂粨"
+ let houseName = screenConfig["houseName"] || "01鍙蜂粨"
// 鑾峰彇搴撳尯鍚嶇О
- let GranaryName = config["GranaryName"] || "涓ぎ鍌ㄥ绮煇鏌愮洿灞炲簱"
+ let GranaryName = screenConfig["GranaryName"] || "涓ぎ鍌ㄥ绮煇鏌愮洿灞炲簱"
logger.info(`[mainView]: 鏇存柊搴撳尯鍚嶇О鍜屼粨鍙�: 浠撳彿=${houseName}, 搴撳尯鍚嶇О=${GranaryName}`)
// 鏇存柊椤堕儴鏍囬鏍忕殑搴撳尯鍚嶇О
if (mainView.headerLbl) {
@@ -131,8 +132,8 @@
// 鏇存柊缃戠粶鍥炬爣
function updateNetworkIcon() {
try {
- let config = screen.getConfig()
- let netType = config["net.type"] || 1
+ let screenConfig = screen.getConfig()
+ let netType = screenConfig["net.type"] || 1
let isConnected = net.isConnected()
// 闅愯棌鎵�鏈夌綉缁滃浘鏍�
@@ -293,9 +294,9 @@
logger.info('[mainView]: accessRes浜嬩欢瑙﹀彂, result=' + result + ', data=' + JSON.stringify(data))
// 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒
- if (resetTimerId) {
- std.clearTimeout(resetTimerId)
- resetTimerId = null
+ if (mainView.resetTimerId) {
+ std.clearTimeout(mainView.resetTimerId)
+ mainView.resetTimerId = null
logger.info('[mainView]: 娓呴櫎涔嬪墠鐨勯噸缃畾鏃跺櫒')
}
@@ -415,7 +416,7 @@
}
// 璁剧疆1鍒嗛挓鍚庨噸缃敤鎴稶I鐨勫畾鏃跺櫒
- resetTimerId = std.setTimeout(() => {
+ mainView.resetTimerId = std.setTimeout(() => {
logger.info('[mainView]: 1鍒嗛挓瀹氭椂鍣ㄨЕ鍙戯紝閲嶇疆鐢ㄦ埛UI')
// 瑙﹀彂閫氳瑙i攣瀹屾垚浜嬩欢锛岄�氱煡UI閲嶇疆
bus.fire("accessUnlockComplete")
@@ -439,6 +440,11 @@
let dualAuthInfo = data.dualAuthInfo
logger.info('[mainView]: 鍙屼汉璁よ瘉鎴愬姛锛屾洿鏂扮敤鎴稶I, user1=' + dualAuthInfo.firstUserId + ', user2=' + dualAuthInfo.secondUserId)
+ // 瀛樺偍宸叉牳楠屾垚鍔熺殑鐢ㄦ埛淇℃伅
+ mainView.verifiedUsers[1] = dualAuthInfo.firstUserId
+ mainView.verifiedUsers[2] = dualAuthInfo.secondUserId
+ logger.info('[mainView]: 瀛樺偍鍙屼汉璁よ瘉鐢ㄦ埛淇℃伅, user1=' + dualAuthInfo.firstUserId + ', user2=' + dualAuthInfo.secondUserId)
+
// 鏇存柊鐢ㄦ埛1鐨刄I
mainView.updateUserUI(1, dualAuthInfo.firstUserId, true, data.firstUserFileName || fileName)
@@ -449,12 +455,21 @@
let dualAuthInfo = data.dualAuthInfo
logger.info('[mainView]: 绗竴鐢ㄦ埛璁よ瘉鎴愬姛锛岀瓑寰呯浜岀敤鎴疯璇侊紝鏇存柊鐢ㄦ埛UI, user1=' + dualAuthInfo.firstUserId)
+ // 瀛樺偍宸叉牳楠屾垚鍔熺殑鐢ㄦ埛淇℃伅
+ mainView.verifiedUsers[1] = dualAuthInfo.firstUserId
+ logger.info('[mainView]: 瀛樺偍绗竴鐢ㄦ埛璁よ瘉淇℃伅, user1=' + dualAuthInfo.firstUserId)
+
// 鏇存柊鐢ㄦ埛1鐨刄I
mainView.updateUserUI(1, dualAuthInfo.firstUserId, true, data.firstUserFileName || fileName)
} else {
// 鍗曚汉璁よ瘉锛屾洿鏂扮敤鎴�1鐨刄I
if (data.userId) {
logger.info('[mainView]: 鍗曚汉璁よ瘉鎴愬姛锛屾洿鏂扮敤鎴稶I, userId=' + data.userId)
+
+ // 瀛樺偍宸叉牳楠屾垚鍔熺殑鐢ㄦ埛淇℃伅
+ mainView.verifiedUsers[1] = data.userId
+ logger.info('[mainView]: 瀛樺偍鍗曚汉璁よ瘉鐢ㄦ埛淇℃伅, user1=' + data.userId)
+
mainView.updateUserUI(1, data.userId, true, fileName)
}
}
@@ -653,8 +668,7 @@
logger.info('[mainView]: 浜嬩欢鐩戝惉鍣ㄦ敞鍐屽畬鎴�')
}
- // 瀛樺偍瀹氭椂鍣↖D
- let resetTimerId = null
+
// 鑾峰彇姘斾綋娴撳害鍜岀姸鎬佷俊鎭�
grainService.checkGasConcentration()
@@ -785,8 +799,8 @@
const headerLbl = dxui.Label.build('headerLbl', headerBox)
mainView.headerLbl = headerLbl
// 浠庨厤缃腑鑾峰彇搴撳尯鍚嶇О
- const config = screen.getConfig()
- const GranaryName = config['GranaryName'] || '涓ぎ鍌ㄥ绮煇鏌愮洿灞炲簱'
+ const screenConfig = screen.getConfig()
+ const GranaryName = screenConfig['GranaryName'] || '涓ぎ鍌ㄥ绮煇鏌愮洿灞炲簱'
headerLbl.text(GranaryName)
headerLbl.textFont(viewUtils.font(30)) // 澧炲ぇ瀛椾綋
headerLbl.textColor(0xffffff)
@@ -795,7 +809,7 @@
const warehouseLbl = dxui.Label.build('warehouseLbl', overlayBox)
mainView.warehouseLbl = warehouseLbl
// 浠庨厤缃腑鑾峰彇浠撳彿淇℃伅
- const houseName = config['houseName'] || '01鍙蜂粨'
+ const houseName = screenConfig['houseName'] || '01鍙蜂粨'
warehouseLbl.text(houseName)
warehouseLbl.textFont(viewUtils.font(30, dxui.Utils.FONT_STYLE.BOLD))
warehouseLbl.textColor(0x000000)
@@ -1385,6 +1399,18 @@
// 璁剧疆鎸夐挳鐐瑰嚮浜嬩欢
mode1Btn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍏佽杩涗粨妯″紡鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1410,6 +1436,18 @@
inBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍏ヤ粨鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1436,6 +1474,18 @@
outBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍑轰粨鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1462,6 +1512,18 @@
mode2Btn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍐閫氶妯″紡鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1470,6 +1532,49 @@
gasConcentration: true,
accessAllowed: false,
message: "*鑱斿姩鎺у埗鎿嶄綔鏃犳潈闄�*"
+ })
+ // 鎾斁璇煶鎻愮ず
+ driver.audio.play('/app/code/resource/CN/wav/control_f.wav')
+ return
+ }
+ // 妫�鏌ユ槸鍚︽湁绉戦暱鏉冮檺
+ let hasSectionChief = false
+ // 妫�鏌ョ敤鎴�1
+ if (mainView.verifiedUsers[1]) {
+ let user1 = sqliteService.d1_person.find({ userId: mainView.verifiedUsers[1] })
+ if (user1 && user1.length > 0) {
+ try {
+ let userType = JSON.parse(user1[0].extra).type || 0
+ if (userType === 1) {
+ hasSectionChief = true
+ }
+ } catch (error) {
+ logger.error("瑙f瀽鐢ㄦ埛1绫诲瀷澶辫触")
+ }
+ }
+ }
+ // 妫�鏌ョ敤鎴�2
+ if (!hasSectionChief && mainView.verifiedUsers[2]) {
+ let user2 = sqliteService.d1_person.find({ userId: mainView.verifiedUsers[2] })
+ if (user2 && user2.length > 0) {
+ try {
+ let userType = JSON.parse(user2[0].extra).type || 0
+ if (userType === 1) {
+ hasSectionChief = true
+ }
+ } catch (error) {
+ logger.error("瑙f瀽鐢ㄦ埛2绫诲瀷澶辫触")
+ }
+ }
+ }
+ // 濡傛灉娌℃湁绉戦暱鏉冮檺锛屾樉绀烘牳楠屽け璐�
+ if (!hasSectionChief) {
+ // 鏄剧ず寮圭獥閫氱煡
+ bus.fire('showAccessResult', {
+ faceAuth: false,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*鏃犵闀挎潈闄愶紝绂佹鎿嶄綔*"
})
// 鎾斁璇煶鎻愮ず
driver.audio.play('/app/code/resource/CN/wav/control_f.wav')
@@ -1487,6 +1592,18 @@
startBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍚姩鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1513,6 +1630,18 @@
stopBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍏抽棴鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1539,6 +1668,18 @@
mode3Btn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('绂佹杩涗粨妯″紡鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1547,6 +1688,49 @@
gasConcentration: true,
accessAllowed: false,
message: "*鑱斿姩鎺у埗鎿嶄綔鏃犳潈闄�*"
+ })
+ // 鎾斁璇煶鎻愮ず
+ driver.audio.play('/app/code/resource/CN/wav/control_f.wav')
+ return
+ }
+ // 妫�鏌ユ槸鍚︽湁绉戦暱鏉冮檺
+ let hasSectionChief = false
+ // 妫�鏌ョ敤鎴�1
+ if (mainView.verifiedUsers[1]) {
+ let user1 = sqliteService.d1_person.find({ userId: mainView.verifiedUsers[1] })
+ if (user1 && user1.length > 0) {
+ try {
+ let userType = JSON.parse(user1[0].extra).type || 0
+ if (userType === 1) {
+ hasSectionChief = true
+ }
+ } catch (error) {
+ logger.error("瑙f瀽鐢ㄦ埛1绫诲瀷澶辫触")
+ }
+ }
+ }
+ // 妫�鏌ョ敤鎴�2
+ if (!hasSectionChief && mainView.verifiedUsers[2]) {
+ let user2 = sqliteService.d1_person.find({ userId: mainView.verifiedUsers[2] })
+ if (user2 && user2.length > 0) {
+ try {
+ let userType = JSON.parse(user2[0].extra).type || 0
+ if (userType === 1) {
+ hasSectionChief = true
+ }
+ } catch (error) {
+ logger.error("瑙f瀽鐢ㄦ埛2绫诲瀷澶辫触")
+ }
+ }
+ }
+ // 濡傛灉娌℃湁绉戦暱鏉冮檺锛屾樉绀烘牳楠屽け璐�
+ if (!hasSectionChief) {
+ // 鏄剧ず寮圭獥閫氱煡
+ bus.fire('showAccessResult', {
+ faceAuth: false,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*鏃犵闀挎潈闄愶紝绂佹鎿嶄綔*"
})
// 鎾斁璇煶鎻愮ず
driver.audio.play('/app/code/resource/CN/wav/control_f.wav')
@@ -1564,6 +1748,18 @@
emergencyInBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('绱ф�ュ叆浠撴寜閽偣鍑�')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1590,6 +1786,18 @@
emergencyOutBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍑轰粨鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1616,6 +1824,18 @@
lightOnBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('寮�鐏寜閽偣鍑�')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
@@ -1642,6 +1862,18 @@
lightOffBtn.on(dxui.Utils.EVENT.CLICK, () => {
logger.info('鍏崇伅鎸夐挳鐐瑰嚮')
+ const isSafeInputControlEnabled = config.get('safeInputControl') === 1
+ if (!isSafeInputControlEnabled) {
+ logger.info('[grain]: 瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�')
+ // 瑙﹀彂鏈惎鐢ㄥ脊绐�
+ bus.fire('showAccessResult', {
+ faceAuth: true,
+ gasConcentration: true,
+ accessAllowed: false,
+ message: "*瀹夊叏鍏ヤ粨鑱斿姩鎺у埗鍔熻兘鏈惎鐢�*"
+ })
+ return false
+ }
// 妫�鏌ユ槸鍚︽湁鐢ㄦ埛宸叉牳楠屾垚鍔�
if (!mainView.verifiedUsers[1] && !mainView.verifiedUsers[2]) {
// 鏄剧ず寮圭獥閫氱煡
--
Gitblit v1.9.3