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() })