From d0c9465498ec4da7c79c5668e9fd3bf83e22ac30 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 6 Sep 2025 22:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=87=E9=83=A8=E5=88=86=E4=BE=9D=E8=B3=B4?= =?UTF-8?q?=E5=AD=98=E6=94=BE=E6=9C=AC=E5=9C=B0,=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=87=9D=E5=B0=8D=E7=A7=BB=E5=8B=95=E7=AB=AF=E7=9A=84=E5=A0=B1?= =?UTF-8?q?=E9=8C=AF=E6=8F=90=E7=A4=BA,=20=E4=BF=AE=E6=AD=A3=20CryptoES=20?= =?UTF-8?q?=E7=9A=84=E5=B0=8E=E5=87=BA=E4=BB=A5=E5=8F=8A=20Utf8=20?= =?UTF-8?q?=E7=9A=84=E5=BC=95=E7=94=A8,=20=E5=BF=BD=E7=95=A5=E7=B7=A8?= =?UTF-8?q?=E8=AD=AF=E9=9D=9C=E6=85=8B=E5=BA=AB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/Data.ts | 4 +- client/Imports.ts | 2 +- client/index.html | 22 +- client/static/crypto-es-3.1.0.static.mjs | 35 + client/static/crypto-es/aes.mjs | 134 ++ client/static/crypto-es/blowfish.mjs | 1200 ++++++++++++++++++ client/static/crypto-es/cipher-core.mjs | 636 ++++++++++ client/static/crypto-es/core.mjs | 584 +++++++++ client/static/crypto-es/enc-base64.mjs | 104 ++ client/static/crypto-es/enc-base64url.mjs | 102 ++ client/static/crypto-es/enc-utf16.mjs | 57 + client/static/crypto-es/evpkdf.mjs | 91 ++ client/static/crypto-es/format-hex.mjs | 22 + client/static/crypto-es/md5.mjs | 201 +++ client/static/crypto-es/mode-cfb.mjs | 48 + client/static/crypto-es/mode-ctr-gladman.mjs | 68 + client/static/crypto-es/mode-ctr.mjs | 39 + client/static/crypto-es/mode-ecb.mjs | 30 + client/static/crypto-es/mode-ofb.mjs | 40 + client/static/crypto-es/pad-ansix923.mjs | 25 + client/static/crypto-es/pad-iso10126.mjs | 22 + client/static/crypto-es/pad-iso97971.mjs | 22 + client/static/crypto-es/pad-nopadding.mjs | 12 + client/static/crypto-es/pad-zeropadding.mjs | 24 + client/static/crypto-es/pbkdf2.mjs | 99 ++ client/static/crypto-es/rabbit-legacy.mjs | 126 ++ client/static/crypto-es/rabbit.mjs | 123 ++ client/static/crypto-es/rc4.mjs | 93 ++ client/static/crypto-es/ripemd160.mjs | 497 ++++++++ client/static/crypto-es/sha1.mjs | 95 ++ client/static/crypto-es/sha224.mjs | 60 + client/static/crypto-es/sha256.mjs | 126 ++ client/static/crypto-es/sha3.mjs | 170 +++ client/static/crypto-es/sha384.mjs | 60 + client/static/crypto-es/sha512.mjs | 300 +++++ client/static/crypto-es/tripledes.mjs | 822 ++++++++++++ client/static/crypto-es/x64-core.mjs | 132 ++ client/static/jquery-3.7.1.min.js | 2 + client/static/mdui-2.1.4.css | 1 + client/static/mdui-2.1.4.global.min.js | 22 + client/static/splitjs-1.6.5.min.js | 3 + client/ui/App.tsx | 5 - server/compiler/transform.ts | 3 +- server/main.ts | 2 +- 44 files changed, 6251 insertions(+), 14 deletions(-) create mode 100644 client/static/crypto-es-3.1.0.static.mjs create mode 100644 client/static/crypto-es/aes.mjs create mode 100644 client/static/crypto-es/blowfish.mjs create mode 100644 client/static/crypto-es/cipher-core.mjs create mode 100644 client/static/crypto-es/core.mjs create mode 100644 client/static/crypto-es/enc-base64.mjs create mode 100644 client/static/crypto-es/enc-base64url.mjs create mode 100644 client/static/crypto-es/enc-utf16.mjs create mode 100644 client/static/crypto-es/evpkdf.mjs create mode 100644 client/static/crypto-es/format-hex.mjs create mode 100644 client/static/crypto-es/md5.mjs create mode 100644 client/static/crypto-es/mode-cfb.mjs create mode 100644 client/static/crypto-es/mode-ctr-gladman.mjs create mode 100644 client/static/crypto-es/mode-ctr.mjs create mode 100644 client/static/crypto-es/mode-ecb.mjs create mode 100644 client/static/crypto-es/mode-ofb.mjs create mode 100644 client/static/crypto-es/pad-ansix923.mjs create mode 100644 client/static/crypto-es/pad-iso10126.mjs create mode 100644 client/static/crypto-es/pad-iso97971.mjs create mode 100644 client/static/crypto-es/pad-nopadding.mjs create mode 100644 client/static/crypto-es/pad-zeropadding.mjs create mode 100644 client/static/crypto-es/pbkdf2.mjs create mode 100644 client/static/crypto-es/rabbit-legacy.mjs create mode 100644 client/static/crypto-es/rabbit.mjs create mode 100644 client/static/crypto-es/rc4.mjs create mode 100644 client/static/crypto-es/ripemd160.mjs create mode 100644 client/static/crypto-es/sha1.mjs create mode 100644 client/static/crypto-es/sha224.mjs create mode 100644 client/static/crypto-es/sha256.mjs create mode 100644 client/static/crypto-es/sha3.mjs create mode 100644 client/static/crypto-es/sha384.mjs create mode 100644 client/static/crypto-es/sha512.mjs create mode 100644 client/static/crypto-es/tripledes.mjs create mode 100644 client/static/crypto-es/x64-core.mjs create mode 100644 client/static/jquery-3.7.1.min.js create mode 100644 client/static/mdui-2.1.4.css create mode 100644 client/static/mdui-2.1.4.global.min.js create mode 100644 client/static/splitjs-1.6.5.min.js diff --git a/client/Data.ts b/client/Data.ts index 17ed9a3..829d27b 100644 --- a/client/Data.ts +++ b/client/Data.ts @@ -3,8 +3,8 @@ import { CryptoES } from './Imports.ts' const dataIsEmpty = !localStorage.tws_data || localStorage.tws_data == '' const aes = { - enc: (m: string, k: string) => CryptoES.AES.encrypt(m, k).toString(CryptoES.enc.Utf8), - dec: (m: string, k: string) => CryptoES.AES.decrypt(m, k).toString(CryptoES.enc.Utf8), + enc: (m: string, k: string) => CryptoES.AES.encrypt(m, k).toString(CryptoES.Utf8), + dec: (m: string, k: string) => CryptoES.AES.decrypt(m, k).toString(CryptoES.Utf8), } const key = location.host + '_TWS_姐姐' diff --git a/client/Imports.ts b/client/Imports.ts index 15ff7ad..4609b60 100644 --- a/client/Imports.ts +++ b/client/Imports.ts @@ -1,6 +1,6 @@ import * as React from 'https://esm.sh/react@18.3.1' import * as ReactDOM from 'https://esm.sh/react-dom@18.3.1' -import CryptoES from 'https://unpkg.com/crypto-es@3.0.4/dist/index.mjs' +import * as CryptoES from './static/crypto-es-3.1.0.static.mjs' import type { Dialog } from 'https://unpkg.com/mdui@2.1.4/components/dialog/index.d.ts' import type { TextField } from 'https://unpkg.com/mdui@2.1.4/components/text-field/index.d.ts' diff --git a/client/index.html b/client/index.html index cc2dd44..a63f62e 100644 --- a/client/index.html +++ b/client/index.html @@ -7,14 +7,14 @@ - - + - - + + TheWhiteSilk @@ -94,10 +94,24 @@
+ + + 错误 + + + - } diff --git a/server/compiler/transform.ts b/server/compiler/transform.ts index 641c722..14351d4 100644 --- a/server/compiler/transform.ts +++ b/server/compiler/transform.ts @@ -30,12 +30,13 @@ async function compileJs(path: string) { export default async function(source: string, output: string) { const t = Date.now() + io.remove(output) io.copyDir(source, output) for (const v of io.listFiles(output, { recursive: true, fullPath: true, })) - if (/\.(t|j)sx?$/.test(v)) + if (/\.(t|j)sx?$/.test(v) && !/\.(min|static)\.(t|j)sx?$/.test(v)) await compileJs(v) return (Date.now() - t) / 1000 } diff --git a/server/main.ts b/server/main.ts index 607d153..5fa02c9 100644 --- a/server/main.ts +++ b/server/main.ts @@ -14,7 +14,7 @@ import chalk from "chalk" const app = express() app.use((req, res, next) => { const url = req.originalUrl || req.url - if (/\.(j|t)sx?$/.test(url)) + if (/\.m?(j|t)sx?$/.test(url)) res.setHeader('Content-Type', 'application/javascript') next() })