Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Skye Yu
jensen
Commits
293a23bd
Commit
293a23bd
authored
Jul 31, 2025
by
carl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增onerror方法错误提示
parent
0cf71b5f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
877 additions
and
0 deletions
+877
-0
jensen.d.ts
jensen.d.ts
+2
-0
pnpm-lock.yaml
pnpm-lock.yaml
+839
-0
index.tsx
src/index.tsx
+27
-0
jensen.js
src/utils/jensen.js
+9
-0
No files found.
jensen.d.ts
View file @
293a23bd
...
@@ -139,6 +139,8 @@ declare class Jensen {
...
@@ -139,6 +139,8 @@ declare class Jensen {
connect
:
()
=>
Promise
<
void
>
;
connect
:
()
=>
Promise
<
void
>
;
// 事件:当连接完成时触发
// 事件:当连接完成时触发
onconnect
:
()
=>
void
;
onconnect
:
()
=>
void
;
// 事件:当连接异常时触发
onerror
:
(
e
:
Error
)
=>
void
;
// 主动断开连接(单连接时适用)
// 主动断开连接(单连接时适用)
disconnect
:
()
=>
void
;
disconnect
:
()
=>
void
;
// 事件:当连接断开时触发
// 事件:当连接断开时触发
...
...
pnpm-lock.yaml
0 → 100644
View file @
293a23bd
lockfileVersion
:
'
9.0'
settings
:
autoInstallPeers
:
true
excludeLinksFromLockfile
:
false
importers
:
.
:
dependencies
:
js-md5
:
specifier
:
^0.8.3
version
:
0.8.3
react
:
specifier
:
^19.0.0
version
:
19.1.0
react-dom
:
specifier
:
^19.0.0
version
:
19.1.0(react@19.1.0)
devDependencies
:
'
@types/node'
:
specifier
:
^22.10.2
version
:
22.16.5
'
@types/react-dom'
:
specifier
:
^19.0.2
version
:
19.1.6(@types/react@19.1.8)
'
@vitejs/plugin-react-swc'
:
specifier
:
^3.7.2
version
:
3.11.0(vite@6.3.5(@types/node@22.16.5))
prettier
:
specifier
:
^3.3.3
version
:
3.6.2
typescript
:
specifier
:
^5.7.2
version
:
5.8.3
vite
:
specifier
:
^6.0.3
version
:
6.3.5(@types/node@22.16.5)
packages
:
'
@esbuild/aix-ppc64@0.25.8'
:
resolution
:
{
integrity
:
sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
ppc64
]
os
:
[
aix
]
'
@esbuild/android-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
android
]
'
@esbuild/android-arm@0.25.8'
:
resolution
:
{
integrity
:
sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm
]
os
:
[
android
]
'
@esbuild/android-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
android
]
'
@esbuild/darwin-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
darwin
]
'
@esbuild/darwin-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
darwin
]
'
@esbuild/freebsd-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
freebsd
]
'
@esbuild/freebsd-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
freebsd
]
'
@esbuild/linux-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
linux
]
'
@esbuild/linux-arm@0.25.8'
:
resolution
:
{
integrity
:
sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm
]
os
:
[
linux
]
'
@esbuild/linux-ia32@0.25.8'
:
resolution
:
{
integrity
:
sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
ia32
]
os
:
[
linux
]
'
@esbuild/linux-loong64@0.25.8'
:
resolution
:
{
integrity
:
sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
loong64
]
os
:
[
linux
]
'
@esbuild/linux-mips64el@0.25.8'
:
resolution
:
{
integrity
:
sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
mips64el
]
os
:
[
linux
]
'
@esbuild/linux-ppc64@0.25.8'
:
resolution
:
{
integrity
:
sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
ppc64
]
os
:
[
linux
]
'
@esbuild/linux-riscv64@0.25.8'
:
resolution
:
{
integrity
:
sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
riscv64
]
os
:
[
linux
]
'
@esbuild/linux-s390x@0.25.8'
:
resolution
:
{
integrity
:
sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
s390x
]
os
:
[
linux
]
'
@esbuild/linux-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
linux
]
'
@esbuild/netbsd-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
netbsd
]
'
@esbuild/netbsd-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
netbsd
]
'
@esbuild/openbsd-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
openbsd
]
'
@esbuild/openbsd-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
openbsd
]
'
@esbuild/openharmony-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
openharmony
]
'
@esbuild/sunos-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
sunos
]
'
@esbuild/win32-arm64@0.25.8'
:
resolution
:
{
integrity
:
sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
arm64
]
os
:
[
win32
]
'
@esbuild/win32-ia32@0.25.8'
:
resolution
:
{
integrity
:
sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
ia32
]
os
:
[
win32
]
'
@esbuild/win32-x64@0.25.8'
:
resolution
:
{
integrity
:
sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==
}
engines
:
{
node
:
'
>=18'
}
cpu
:
[
x64
]
os
:
[
win32
]
'
@rolldown/pluginutils@1.0.0-beta.27'
:
resolution
:
{
integrity
:
sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==
}
'
@rollup/rollup-android-arm-eabi@4.45.1'
:
resolution
:
{
integrity
:
sha512-NEySIFvMY0ZQO+utJkgoMiCAjMrGvnbDLHvcmlA33UXJpYBCvlBEbMMtV837uCkS+plG2umfhn0T5mMAxGrlRA==
}
cpu
:
[
arm
]
os
:
[
android
]
'
@rollup/rollup-android-arm64@4.45.1'
:
resolution
:
{
integrity
:
sha512-ujQ+sMXJkg4LRJaYreaVx7Z/VMgBBd89wGS4qMrdtfUFZ+TSY5Rs9asgjitLwzeIbhwdEhyj29zhst3L1lKsRQ==
}
cpu
:
[
arm64
]
os
:
[
android
]
'
@rollup/rollup-darwin-arm64@4.45.1'
:
resolution
:
{
integrity
:
sha512-FSncqHvqTm3lC6Y13xncsdOYfxGSLnP+73k815EfNmpewPs+EyM49haPS105Rh4aF5mJKywk9X0ogzLXZzN9lA==
}
cpu
:
[
arm64
]
os
:
[
darwin
]
'
@rollup/rollup-darwin-x64@4.45.1'
:
resolution
:
{
integrity
:
sha512-2/vVn/husP5XI7Fsf/RlhDaQJ7x9zjvC81anIVbr4b/f0xtSmXQTFcGIQ/B1cXIYM6h2nAhJkdMHTnD7OtQ9Og==
}
cpu
:
[
x64
]
os
:
[
darwin
]
'
@rollup/rollup-freebsd-arm64@4.45.1'
:
resolution
:
{
integrity
:
sha512-4g1kaDxQItZsrkVTdYQ0bxu4ZIQ32cotoQbmsAnW1jAE4XCMbcBPDirX5fyUzdhVCKgPcrwWuucI8yrVRBw2+g==
}
cpu
:
[
arm64
]
os
:
[
freebsd
]
'
@rollup/rollup-freebsd-x64@4.45.1'
:
resolution
:
{
integrity
:
sha512-L/6JsfiL74i3uK1Ti2ZFSNsp5NMiM4/kbbGEcOCps99aZx3g8SJMO1/9Y0n/qKlWZfn6sScf98lEOUe2mBvW9A==
}
cpu
:
[
x64
]
os
:
[
freebsd
]
'
@rollup/rollup-linux-arm-gnueabihf@4.45.1'
:
resolution
:
{
integrity
:
sha512-RkdOTu2jK7brlu+ZwjMIZfdV2sSYHK2qR08FUWcIoqJC2eywHbXr0L8T/pONFwkGukQqERDheaGTeedG+rra6Q==
}
cpu
:
[
arm
]
os
:
[
linux
]
'
@rollup/rollup-linux-arm-musleabihf@4.45.1'
:
resolution
:
{
integrity
:
sha512-3kJ8pgfBt6CIIr1o+HQA7OZ9mp/zDk3ctekGl9qn/pRBgrRgfwiffaUmqioUGN9hv0OHv2gxmvdKOkARCtRb8Q==
}
cpu
:
[
arm
]
os
:
[
linux
]
'
@rollup/rollup-linux-arm64-gnu@4.45.1'
:
resolution
:
{
integrity
:
sha512-k3dOKCfIVixWjG7OXTCOmDfJj3vbdhN0QYEqB+OuGArOChek22hn7Uy5A/gTDNAcCy5v2YcXRJ/Qcnm4/ma1xw==
}
cpu
:
[
arm64
]
os
:
[
linux
]
'
@rollup/rollup-linux-arm64-musl@4.45.1'
:
resolution
:
{
integrity
:
sha512-PmI1vxQetnM58ZmDFl9/Uk2lpBBby6B6rF4muJc65uZbxCs0EA7hhKCk2PKlmZKuyVSHAyIw3+/SiuMLxKxWog==
}
cpu
:
[
arm64
]
os
:
[
linux
]
'
@rollup/rollup-linux-loongarch64-gnu@4.45.1'
:
resolution
:
{
integrity
:
sha512-9UmI0VzGmNJ28ibHW2GpE2nF0PBQqsyiS4kcJ5vK+wuwGnV5RlqdczVocDSUfGX/Na7/XINRVoUgJyFIgipoRg==
}
cpu
:
[
loong64
]
os
:
[
linux
]
'
@rollup/rollup-linux-powerpc64le-gnu@4.45.1'
:
resolution
:
{
integrity
:
sha512-7nR2KY8oEOUTD3pBAxIBBbZr0U7U+R9HDTPNy+5nVVHDXI4ikYniH1oxQz9VoB5PbBU1CZuDGHkLJkd3zLMWsg==
}
cpu
:
[
ppc64
]
os
:
[
linux
]
'
@rollup/rollup-linux-riscv64-gnu@4.45.1'
:
resolution
:
{
integrity
:
sha512-nlcl3jgUultKROfZijKjRQLUu9Ma0PeNv/VFHkZiKbXTBQXhpytS8CIj5/NfBeECZtY2FJQubm6ltIxm/ftxpw==
}
cpu
:
[
riscv64
]
os
:
[
linux
]
'
@rollup/rollup-linux-riscv64-musl@4.45.1'
:
resolution
:
{
integrity
:
sha512-HJV65KLS51rW0VY6rvZkiieiBnurSzpzore1bMKAhunQiECPuxsROvyeaot/tcK3A3aGnI+qTHqisrpSgQrpgA==
}
cpu
:
[
riscv64
]
os
:
[
linux
]
'
@rollup/rollup-linux-s390x-gnu@4.45.1'
:
resolution
:
{
integrity
:
sha512-NITBOCv3Qqc6hhwFt7jLV78VEO/il4YcBzoMGGNxznLgRQf43VQDae0aAzKiBeEPIxnDrACiMgbqjuihx08OOw==
}
cpu
:
[
s390x
]
os
:
[
linux
]
'
@rollup/rollup-linux-x64-gnu@4.45.1'
:
resolution
:
{
integrity
:
sha512-+E/lYl6qu1zqgPEnTrs4WysQtvc/Sh4fC2nByfFExqgYrqkKWp1tWIbe+ELhixnenSpBbLXNi6vbEEJ8M7fiHw==
}
cpu
:
[
x64
]
os
:
[
linux
]
'
@rollup/rollup-linux-x64-musl@4.45.1'
:
resolution
:
{
integrity
:
sha512-a6WIAp89p3kpNoYStITT9RbTbTnqarU7D8N8F2CV+4Cl9fwCOZraLVuVFvlpsW0SbIiYtEnhCZBPLoNdRkjQFw==
}
cpu
:
[
x64
]
os
:
[
linux
]
'
@rollup/rollup-win32-arm64-msvc@4.45.1'
:
resolution
:
{
integrity
:
sha512-T5Bi/NS3fQiJeYdGvRpTAP5P02kqSOpqiopwhj0uaXB6nzs5JVi2XMJb18JUSKhCOX8+UE1UKQufyD6Or48dJg==
}
cpu
:
[
arm64
]
os
:
[
win32
]
'
@rollup/rollup-win32-ia32-msvc@4.45.1'
:
resolution
:
{
integrity
:
sha512-lxV2Pako3ujjuUe9jiU3/s7KSrDfH6IgTSQOnDWr9aJ92YsFd7EurmClK0ly/t8dzMkDtd04g60WX6yl0sGfdw==
}
cpu
:
[
ia32
]
os
:
[
win32
]
'
@rollup/rollup-win32-x64-msvc@4.45.1'
:
resolution
:
{
integrity
:
sha512-M/fKi4sasCdM8i0aWJjCSFm2qEnYRR8AMLG2kxp6wD13+tMGA4Z1tVAuHkNRjud5SW2EM3naLuK35w9twvf6aA==
}
cpu
:
[
x64
]
os
:
[
win32
]
'
@swc/core-darwin-arm64@1.13.2'
:
resolution
:
{
integrity
:
sha512-44p7ivuLSGFJ15Vly4ivLJjg3ARo4879LtEBAabcHhSZygpmkP8eyjyWxrH3OxkY1eRZSIJe8yRZPFw4kPXFPw==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
arm64
]
os
:
[
darwin
]
'
@swc/core-darwin-x64@1.13.2'
:
resolution
:
{
integrity
:
sha512-Lb9EZi7X2XDAVmuUlBm2UvVAgSCbD3qKqDCxSI4jEOddzVOpNCnyZ/xEampdngUIyDDhhJLYU9duC+Mcsv5Y+A==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
x64
]
os
:
[
darwin
]
'
@swc/core-linux-arm-gnueabihf@1.13.2'
:
resolution
:
{
integrity
:
sha512-9TDe/92ee1x57x+0OqL1huG4BeljVx0nWW4QOOxp8CCK67Rpc/HHl2wciJ0Kl9Dxf2NvpNtkPvqj9+BUmM9WVA==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
arm
]
os
:
[
linux
]
'
@swc/core-linux-arm64-gnu@1.13.2'
:
resolution
:
{
integrity
:
sha512-KJUSl56DBk7AWMAIEcU83zl5mg3vlQYhLELhjwRFkGFMvghQvdqQ3zFOYa4TexKA7noBZa3C8fb24rI5sw9Exg==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
arm64
]
os
:
[
linux
]
'
@swc/core-linux-arm64-musl@1.13.2'
:
resolution
:
{
integrity
:
sha512-teU27iG1oyWpNh9CzcGQ48ClDRt/RCem7mYO7ehd2FY102UeTws2+OzLESS1TS1tEZipq/5xwx3FzbVgiolCiQ==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
arm64
]
os
:
[
linux
]
'
@swc/core-linux-x64-gnu@1.13.2'
:
resolution
:
{
integrity
:
sha512-dRPsyPyqpLD0HMRCRpYALIh4kdOir8pPg4AhNQZLehKowigRd30RcLXGNVZcc31Ua8CiPI4QSgjOIxK+EQe4LQ==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
x64
]
os
:
[
linux
]
'
@swc/core-linux-x64-musl@1.13.2'
:
resolution
:
{
integrity
:
sha512-CCxETW+KkYEQDqz1SYC15YIWYheqFC+PJVOW76Maa/8yu8Biw+HTAcblKf2isrlUtK8RvrQN94v3UXkC2NzCEw==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
x64
]
os
:
[
linux
]
'
@swc/core-win32-arm64-msvc@1.13.2'
:
resolution
:
{
integrity
:
sha512-Wv/QTA6PjyRLlmKcN6AmSI4jwSMRl0VTLGs57PHTqYRwwfwd7y4s2fIPJVBNbAlXd795dOEP6d/bGSQSyhOX3A==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
arm64
]
os
:
[
win32
]
'
@swc/core-win32-ia32-msvc@1.13.2'
:
resolution
:
{
integrity
:
sha512-PuCdtNynEkUNbUXX/wsyUC+t4mamIU5y00lT5vJcAvco3/r16Iaxl5UCzhXYaWZSNVZMzPp9qN8NlSL8M5pPxw==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
ia32
]
os
:
[
win32
]
'
@swc/core-win32-x64-msvc@1.13.2'
:
resolution
:
{
integrity
:
sha512-qlmMkFZJus8cYuBURx1a3YAG2G7IW44i+FEYV5/32ylKkzGNAr9tDJSA53XNnNXkAB5EXSPsOz7bn5C3JlEtdQ==
}
engines
:
{
node
:
'
>=10'
}
cpu
:
[
x64
]
os
:
[
win32
]
'
@swc/core@1.13.2'
:
resolution
:
{
integrity
:
sha512-YWqn+0IKXDhqVLKoac4v2tV6hJqB/wOh8/Br8zjqeqBkKa77Qb0Kw2i7LOFzjFNZbZaPH6AlMGlBwNrxaauaAg==
}
engines
:
{
node
:
'
>=10'
}
peerDependencies
:
'
@swc/helpers'
:
'
>=0.5.17'
peerDependenciesMeta
:
'
@swc/helpers'
:
optional
:
true
'
@swc/counter@0.1.3'
:
resolution
:
{
integrity
:
sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==
}
'
@swc/types@0.1.23'
:
resolution
:
{
integrity
:
sha512-u1iIVZV9Q0jxY+yM2vw/hZGDNudsN85bBpTqzAQ9rzkxW9D+e3aEM4Han+ow518gSewkXgjmEK0BD79ZcNVgPw==
}
'
@types/estree@1.0.8'
:
resolution
:
{
integrity
:
sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==
}
'
@types/node@22.16.5'
:
resolution
:
{
integrity
:
sha512-bJFoMATwIGaxxx8VJPeM8TonI8t579oRvgAuT8zFugJsJZgzqv0Fu8Mhp68iecjzG7cnN3mO2dJQ5uUM2EFrgQ==
}
'
@types/react-dom@19.1.6'
:
resolution
:
{
integrity
:
sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw==
}
peerDependencies
:
'
@types/react'
:
^19.0.0
'
@types/react@19.1.8'
:
resolution
:
{
integrity
:
sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==
}
'
@vitejs/plugin-react-swc@3.11.0'
:
resolution
:
{
integrity
:
sha512-YTJCGFdNMHCMfjODYtxRNVAYmTWQ1Lb8PulP/2/f/oEEtglw8oKxKIZmmRkyXrVrHfsKOaVkAc3NT9/dMutO5w==
}
peerDependencies
:
vite
:
^4 || ^5 || ^6 || ^7
csstype@3.1.3
:
resolution
:
{
integrity
:
sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==
}
esbuild@0.25.8
:
resolution
:
{
integrity
:
sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==
}
engines
:
{
node
:
'
>=18'
}
hasBin
:
true
fdir@6.4.6
:
resolution
:
{
integrity
:
sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==
}
peerDependencies
:
picomatch
:
^3 || ^4
peerDependenciesMeta
:
picomatch
:
optional
:
true
fsevents@2.3.3
:
resolution
:
{
integrity
:
sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
}
engines
:
{
node
:
^8.16.0 || ^10.6.0 || >=11.0.0
}
os
:
[
darwin
]
js-md5@0.8.3
:
resolution
:
{
integrity
:
sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==
}
nanoid@3.3.11
:
resolution
:
{
integrity
:
sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==
}
engines
:
{
node
:
^10 || ^12 || ^13.7 || ^14 || >=15.0.1
}
hasBin
:
true
picocolors@1.1.1
:
resolution
:
{
integrity
:
sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==
}
picomatch@4.0.3
:
resolution
:
{
integrity
:
sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==
}
engines
:
{
node
:
'
>=12'
}
postcss@8.5.6
:
resolution
:
{
integrity
:
sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==
}
engines
:
{
node
:
^10 || ^12 || >=14
}
prettier@3.6.2
:
resolution
:
{
integrity
:
sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==
}
engines
:
{
node
:
'
>=14'
}
hasBin
:
true
react-dom@19.1.0
:
resolution
:
{
integrity
:
sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==
}
peerDependencies
:
react
:
^19.1.0
react@19.1.0
:
resolution
:
{
integrity
:
sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==
}
engines
:
{
node
:
'
>=0.10.0'
}
rollup@4.45.1
:
resolution
:
{
integrity
:
sha512-4iya7Jb76fVpQyLoiVpzUrsjQ12r3dM7fIVz+4NwoYvZOShknRmiv+iu9CClZml5ZLGb0XMcYLutK6w9tgxHDw==
}
engines
:
{
node
:
'
>=18.0.0'
,
npm
:
'
>=8.0.0'
}
hasBin
:
true
scheduler@0.26.0
:
resolution
:
{
integrity
:
sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==
}
source-map-js@1.2.1
:
resolution
:
{
integrity
:
sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
}
engines
:
{
node
:
'
>=0.10.0'
}
tinyglobby@0.2.14
:
resolution
:
{
integrity
:
sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==
}
engines
:
{
node
:
'
>=12.0.0'
}
typescript@5.8.3
:
resolution
:
{
integrity
:
sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==
}
engines
:
{
node
:
'
>=14.17'
}
hasBin
:
true
undici-types@6.21.0
:
resolution
:
{
integrity
:
sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
}
vite@6.3.5
:
resolution
:
{
integrity
:
sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==
}
engines
:
{
node
:
^18.0.0 || ^20.0.0 || >=22.0.0
}
hasBin
:
true
peerDependencies
:
'
@types/node'
:
^18.0.0 || ^20.0.0 || >=22.0.0
jiti
:
'
>=1.21.0'
less
:
'
*'
lightningcss
:
^1.21.0
sass
:
'
*'
sass-embedded
:
'
*'
stylus
:
'
*'
sugarss
:
'
*'
terser
:
^5.16.0
tsx
:
^4.8.1
yaml
:
^2.4.2
peerDependenciesMeta
:
'
@types/node'
:
optional
:
true
jiti
:
optional
:
true
less
:
optional
:
true
lightningcss
:
optional
:
true
sass
:
optional
:
true
sass-embedded
:
optional
:
true
stylus
:
optional
:
true
sugarss
:
optional
:
true
terser
:
optional
:
true
tsx
:
optional
:
true
yaml
:
optional
:
true
snapshots
:
'
@esbuild/aix-ppc64@0.25.8'
:
optional
:
true
'
@esbuild/android-arm64@0.25.8'
:
optional
:
true
'
@esbuild/android-arm@0.25.8'
:
optional
:
true
'
@esbuild/android-x64@0.25.8'
:
optional
:
true
'
@esbuild/darwin-arm64@0.25.8'
:
optional
:
true
'
@esbuild/darwin-x64@0.25.8'
:
optional
:
true
'
@esbuild/freebsd-arm64@0.25.8'
:
optional
:
true
'
@esbuild/freebsd-x64@0.25.8'
:
optional
:
true
'
@esbuild/linux-arm64@0.25.8'
:
optional
:
true
'
@esbuild/linux-arm@0.25.8'
:
optional
:
true
'
@esbuild/linux-ia32@0.25.8'
:
optional
:
true
'
@esbuild/linux-loong64@0.25.8'
:
optional
:
true
'
@esbuild/linux-mips64el@0.25.8'
:
optional
:
true
'
@esbuild/linux-ppc64@0.25.8'
:
optional
:
true
'
@esbuild/linux-riscv64@0.25.8'
:
optional
:
true
'
@esbuild/linux-s390x@0.25.8'
:
optional
:
true
'
@esbuild/linux-x64@0.25.8'
:
optional
:
true
'
@esbuild/netbsd-arm64@0.25.8'
:
optional
:
true
'
@esbuild/netbsd-x64@0.25.8'
:
optional
:
true
'
@esbuild/openbsd-arm64@0.25.8'
:
optional
:
true
'
@esbuild/openbsd-x64@0.25.8'
:
optional
:
true
'
@esbuild/openharmony-arm64@0.25.8'
:
optional
:
true
'
@esbuild/sunos-x64@0.25.8'
:
optional
:
true
'
@esbuild/win32-arm64@0.25.8'
:
optional
:
true
'
@esbuild/win32-ia32@0.25.8'
:
optional
:
true
'
@esbuild/win32-x64@0.25.8'
:
optional
:
true
'
@rolldown/pluginutils@1.0.0-beta.27'
:
{}
'
@rollup/rollup-android-arm-eabi@4.45.1'
:
optional
:
true
'
@rollup/rollup-android-arm64@4.45.1'
:
optional
:
true
'
@rollup/rollup-darwin-arm64@4.45.1'
:
optional
:
true
'
@rollup/rollup-darwin-x64@4.45.1'
:
optional
:
true
'
@rollup/rollup-freebsd-arm64@4.45.1'
:
optional
:
true
'
@rollup/rollup-freebsd-x64@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-arm-gnueabihf@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-arm-musleabihf@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-arm64-gnu@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-arm64-musl@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-loongarch64-gnu@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-powerpc64le-gnu@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-riscv64-gnu@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-riscv64-musl@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-s390x-gnu@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-x64-gnu@4.45.1'
:
optional
:
true
'
@rollup/rollup-linux-x64-musl@4.45.1'
:
optional
:
true
'
@rollup/rollup-win32-arm64-msvc@4.45.1'
:
optional
:
true
'
@rollup/rollup-win32-ia32-msvc@4.45.1'
:
optional
:
true
'
@rollup/rollup-win32-x64-msvc@4.45.1'
:
optional
:
true
'
@swc/core-darwin-arm64@1.13.2'
:
optional
:
true
'
@swc/core-darwin-x64@1.13.2'
:
optional
:
true
'
@swc/core-linux-arm-gnueabihf@1.13.2'
:
optional
:
true
'
@swc/core-linux-arm64-gnu@1.13.2'
:
optional
:
true
'
@swc/core-linux-arm64-musl@1.13.2'
:
optional
:
true
'
@swc/core-linux-x64-gnu@1.13.2'
:
optional
:
true
'
@swc/core-linux-x64-musl@1.13.2'
:
optional
:
true
'
@swc/core-win32-arm64-msvc@1.13.2'
:
optional
:
true
'
@swc/core-win32-ia32-msvc@1.13.2'
:
optional
:
true
'
@swc/core-win32-x64-msvc@1.13.2'
:
optional
:
true
'
@swc/core@1.13.2'
:
dependencies
:
'
@swc/counter'
:
0.1.3
'
@swc/types'
:
0.1.23
optionalDependencies
:
'
@swc/core-darwin-arm64'
:
1.13.2
'
@swc/core-darwin-x64'
:
1.13.2
'
@swc/core-linux-arm-gnueabihf'
:
1.13.2
'
@swc/core-linux-arm64-gnu'
:
1.13.2
'
@swc/core-linux-arm64-musl'
:
1.13.2
'
@swc/core-linux-x64-gnu'
:
1.13.2
'
@swc/core-linux-x64-musl'
:
1.13.2
'
@swc/core-win32-arm64-msvc'
:
1.13.2
'
@swc/core-win32-ia32-msvc'
:
1.13.2
'
@swc/core-win32-x64-msvc'
:
1.13.2
'
@swc/counter@0.1.3'
:
{}
'
@swc/types@0.1.23'
:
dependencies
:
'
@swc/counter'
:
0.1.3
'
@types/estree@1.0.8'
:
{}
'
@types/node@22.16.5'
:
dependencies
:
undici-types
:
6.21.0
'
@types/react-dom@19.1.6(@types/react@19.1.8)'
:
dependencies
:
'
@types/react'
:
19.1.8
'
@types/react@19.1.8'
:
dependencies
:
csstype
:
3.1.3
'
@vitejs/plugin-react-swc@3.11.0(vite@6.3.5(@types/node@22.16.5))'
:
dependencies
:
'
@rolldown/pluginutils'
:
1.0.0-beta.27
'
@swc/core'
:
1.13.2
vite
:
6.3.5(@types/node@22.16.5)
transitivePeerDependencies
:
-
'
@swc/helpers'
csstype@3.1.3
:
{}
esbuild@0.25.8
:
optionalDependencies
:
'
@esbuild/aix-ppc64'
:
0.25.8
'
@esbuild/android-arm'
:
0.25.8
'
@esbuild/android-arm64'
:
0.25.8
'
@esbuild/android-x64'
:
0.25.8
'
@esbuild/darwin-arm64'
:
0.25.8
'
@esbuild/darwin-x64'
:
0.25.8
'
@esbuild/freebsd-arm64'
:
0.25.8
'
@esbuild/freebsd-x64'
:
0.25.8
'
@esbuild/linux-arm'
:
0.25.8
'
@esbuild/linux-arm64'
:
0.25.8
'
@esbuild/linux-ia32'
:
0.25.8
'
@esbuild/linux-loong64'
:
0.25.8
'
@esbuild/linux-mips64el'
:
0.25.8
'
@esbuild/linux-ppc64'
:
0.25.8
'
@esbuild/linux-riscv64'
:
0.25.8
'
@esbuild/linux-s390x'
:
0.25.8
'
@esbuild/linux-x64'
:
0.25.8
'
@esbuild/netbsd-arm64'
:
0.25.8
'
@esbuild/netbsd-x64'
:
0.25.8
'
@esbuild/openbsd-arm64'
:
0.25.8
'
@esbuild/openbsd-x64'
:
0.25.8
'
@esbuild/openharmony-arm64'
:
0.25.8
'
@esbuild/sunos-x64'
:
0.25.8
'
@esbuild/win32-arm64'
:
0.25.8
'
@esbuild/win32-ia32'
:
0.25.8
'
@esbuild/win32-x64'
:
0.25.8
fdir@6.4.6(picomatch@4.0.3)
:
optionalDependencies
:
picomatch
:
4.0.3
fsevents@2.3.3
:
optional
:
true
js-md5@0.8.3
:
{}
nanoid@3.3.11
:
{}
picocolors@1.1.1
:
{}
picomatch@4.0.3
:
{}
postcss@8.5.6
:
dependencies
:
nanoid
:
3.3.11
picocolors
:
1.1.1
source-map-js
:
1.2.1
prettier@3.6.2
:
{}
react-dom@19.1.0(react@19.1.0)
:
dependencies
:
react
:
19.1.0
scheduler
:
0.26.0
react@19.1.0
:
{}
rollup@4.45.1
:
dependencies
:
'
@types/estree'
:
1.0.8
optionalDependencies
:
'
@rollup/rollup-android-arm-eabi'
:
4.45.1
'
@rollup/rollup-android-arm64'
:
4.45.1
'
@rollup/rollup-darwin-arm64'
:
4.45.1
'
@rollup/rollup-darwin-x64'
:
4.45.1
'
@rollup/rollup-freebsd-arm64'
:
4.45.1
'
@rollup/rollup-freebsd-x64'
:
4.45.1
'
@rollup/rollup-linux-arm-gnueabihf'
:
4.45.1
'
@rollup/rollup-linux-arm-musleabihf'
:
4.45.1
'
@rollup/rollup-linux-arm64-gnu'
:
4.45.1
'
@rollup/rollup-linux-arm64-musl'
:
4.45.1
'
@rollup/rollup-linux-loongarch64-gnu'
:
4.45.1
'
@rollup/rollup-linux-powerpc64le-gnu'
:
4.45.1
'
@rollup/rollup-linux-riscv64-gnu'
:
4.45.1
'
@rollup/rollup-linux-riscv64-musl'
:
4.45.1
'
@rollup/rollup-linux-s390x-gnu'
:
4.45.1
'
@rollup/rollup-linux-x64-gnu'
:
4.45.1
'
@rollup/rollup-linux-x64-musl'
:
4.45.1
'
@rollup/rollup-win32-arm64-msvc'
:
4.45.1
'
@rollup/rollup-win32-ia32-msvc'
:
4.45.1
'
@rollup/rollup-win32-x64-msvc'
:
4.45.1
fsevents
:
2.3.3
scheduler@0.26.0
:
{}
source-map-js@1.2.1
:
{}
tinyglobby@0.2.14
:
dependencies
:
fdir
:
6.4.6(picomatch@4.0.3)
picomatch
:
4.0.3
typescript@5.8.3
:
{}
undici-types@6.21.0
:
{}
vite@6.3.5(@types/node@22.16.5)
:
dependencies
:
esbuild
:
0.25.8
fdir
:
6.4.6(picomatch@4.0.3)
picomatch
:
4.0.3
postcss
:
8.5.6
rollup
:
4.45.1
tinyglobby
:
0.2.14
optionalDependencies
:
'
@types/node'
:
22.16.5
fsevents
:
2.3.3
src/index.tsx
View file @
293a23bd
...
@@ -15,9 +15,16 @@ export function Home() {
...
@@ -15,9 +15,16 @@ export function Home() {
jensen
.
onconnect
=
()
=>
{
jensen
.
onconnect
=
()
=>
{
console
.
log
(
'connect successfully'
);
console
.
log
(
'connect successfully'
);
jensen
.
getDeviceInfo
().
then
((
info
)
=>
{
jensen
.
getDeviceInfo
().
then
((
info
)
=>
{
console
.
log
(
'getDeviceInfo'
,
info
);
alert
(
info
.
sn
+
' connected'
);
alert
(
info
.
sn
+
' connected'
);
}).
catch
((
e
)
=>
{
console
.
log
(
'getDeviceInfo error'
,
e
);
});
});
};
};
// jensen.onerror = (e) => {
// console.log('onerror', e);
// alert('此设备已经在其它已打开的HiNotes网页上建立连接');
// };
},
[]);
},
[]);
const
getFilePart
=
()
=>
{
const
getFilePart
=
()
=>
{
...
@@ -40,6 +47,25 @@ export function Home() {
...
@@ -40,6 +47,25 @@ export function Home() {
setDevices
(
devices
);
setDevices
(
devices
);
setGreeting
(
null
)
setGreeting
(
null
)
}
}
const
connecty
=
async
()
=>
{
const
usb
=
(
navigator
as
any
).
usb
;
let
conn
=
await
usb
.
requestDevice
({
filters
:
[{
vendorId
:
0x10d6
},
{
vendorId
:
0x3887
}]
});
if
(
conn
==
null
)
return
null
;
// if (conn.opened) throw new Error('device_already_opened');
await
conn
.
open
();
let
jensen
=
new
Jensen
(
Logger
,
conn
);
jensen
.
onerror
=
(
e
)
=>
{
console
.
log
(
'onerror'
,
e
);
alert
(
'此设备已经在其它已打开的HiNotes网页上建立连接'
);
};
await
jensen
.
initialize
();
let
dinfo
=
await
jensen
.
getDeviceInfo
();
if
(
dinfo
)
console
.
log
(
'dinfo'
,
dinfo
);
return
null
;
}
const
connect
=
async
()
=>
{
const
connect
=
async
()
=>
{
await
jensen
.
connect
();
await
jensen
.
connect
();
...
@@ -220,6 +246,7 @@ export function Home() {
...
@@ -220,6 +246,7 @@ export function Home() {
return
(
return
(
<>
<>
<
div
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
<
div
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
<
button
onClick=
{
connecty
}
>
连接新设备
</
button
>
<
button
onClick=
{
connect
}
>
连接
</
button
>
<
button
onClick=
{
connect
}
>
连接
</
button
>
<
button
onClick=
{
getFilePart
}
>
获取文件
</
button
>
<
button
onClick=
{
getFilePart
}
>
获取文件
</
button
>
<
button
onClick=
{
writeSN
}
>
SN写号
</
button
>
<
button
onClick=
{
writeSN
}
>
SN写号
</
button
>
...
...
src/utils/jensen.js
View file @
293a23bd
...
@@ -99,6 +99,7 @@ function Jensen(log, conn) {
...
@@ -99,6 +99,7 @@ function Jensen(log, conn) {
this
.
isStopConnectionCheck
=
false
;
this
.
isStopConnectionCheck
=
false
;
this
.
onconnect
=
null
;
this
.
onconnect
=
null
;
this
.
onreceive
=
null
;
this
.
onreceive
=
null
;
this
.
onerror
=
null
;
const
RECV_BUFF_SIZE
=
51200
;
const
RECV_BUFF_SIZE
=
51200
;
...
@@ -382,7 +383,11 @@ function Jensen(log, conn) {
...
@@ -382,7 +383,11 @@ function Jensen(log, conn) {
Logger
.
save
?.(
'jensen'
,
'tryReceive'
,
r
?.
data
);
Logger
.
save
?.(
'jensen'
,
'tryReceive'
,
r
?.
data
);
console
.
log
(
pid
+
' Receive'
,
r
?.
data
);
console
.
log
(
pid
+
' Receive'
,
r
?.
data
);
receive
(
r
);
receive
(
r
);
}).
catch
((
e
)
=>
{
console
.
log
(
'tryReceive error'
,
e
)
self
.
onerror
?.(
e
);
});
});
};
};
const
read_int
=
function
(
a
,
b
,
c
,
d
)
{
const
read_int
=
function
(
a
,
b
,
c
,
d
)
{
...
@@ -394,6 +399,10 @@ function Jensen(log, conn) {
...
@@ -394,6 +399,10 @@ function Jensen(log, conn) {
};
};
const
receive
=
function
(
result
)
{
const
receive
=
function
(
result
)
{
if
(
result
instanceof
Error
)
{
console
.
log
(
'receive error'
,
result
);
return
}
totalBytes
+=
result
.
data
.
byteLength
;
totalBytes
+=
result
.
data
.
byteLength
;
// 做一个回调,怎么样找到它呢?
// 做一个回调,怎么样找到它呢?
blocks
.
push
(
result
.
data
);
blocks
.
push
(
result
.
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment