網(wǎng)站首頁 編程語言 正文
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getDevices')
at SoftKey3A.FindPort (SoftKey3A.js:278)
at n.<anonymous> (index.js:105)
at s (runtime.js:63)
at Generator._invoke (runtime.js:293)
at Generator.next (runtime.js:118)
at a (asyncToGenerator.js:3)
at s (asyncToGenerator.js:25)
at asyncToGenerator.js:32
at new Promise (<anonymous>)
at n.<anonymous> (asyncToGenerator.js:21)
使用 navigator 讀取識別 ukey,報(bào)出這個問題,在本地是可以的,但是在測試環(huán)境上就出問題了,報(bào)
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getDevices')
查詢了好多地方,各種修改都報(bào)錯。
突然詳情,瀏覽器的api是否和ssl有關(guān)系,正式環(huán)境使用的是 https,使用沒有問題,但是在測試環(huán)境使用的http,使用https訪問就不會有這個問題了。
在這兒可以印證需要這個操作
https://developer.mozilla.org/en-US/docs/Web/API/HID
Secure context:?This feature is available only in?secure contexts?(HTTPS), in some or all?supporting browsers.
?
所以,非本地訪問,得使用https訪問。
原文鏈接:https://blog.csdn.net/poem_2010/article/details/122819624
相關(guān)推薦
- 2023-03-04 Golang錯誤處理方式異常與error_Golang
- 2022-09-18 GO語言原生實(shí)現(xiàn)文件上傳功能_Golang
- 2021-10-17 linux配置主機(jī)名詳細(xì)介紹_Linux
- 2022-03-26 .Net?Core微服務(wù)rpc框架GRPC通信基礎(chǔ)_基礎(chǔ)應(yīng)用
- 2022-04-14 Python報(bào)mongod:?error?while?loading?shared?librarie
- 2022-06-25 Android開發(fā)MediaCodec和lamemp3多段音頻截取拼接_Android
- 2021-12-11 由redux到react-redux再到rematch
- 2023-03-28 Go實(shí)現(xiàn)set類型的示例代碼_Golang
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支