diff --git a/docs/notes/theme/guide/安装与使用.md b/docs/notes/theme/guide/安装与使用.md index fef6a3d0..c5a9ea4c 100644 --- a/docs/notes/theme/guide/安装与使用.md +++ b/docs/notes/theme/guide/安装与使用.md @@ -14,9 +14,13 @@ const vuepressVersion = __VUEPRESS_VERSION__ ## 依赖环境 -- [Node.js v20.6.0+](https://nodejs.org/) +- [Node.js](https://nodejs.org/) : **^18.19.0 || ^20.6.0 || >= 22.0.0** [+node-versions] - [npm 8+](https://www.npmjs.com/) 或 [pnpm 8+](https://pnpm.io/zh/) 或 [Yarn 2+](https://yarnpkg.com/) +[+node-versions]: **^18.19.0:** `18.19.0` 及以上但不高于 `19.0.0` 的版本 +[+node-versions]: **^20.6.0:** `20.6.0` 及以上但不高于 `21.0.0` 的版本 +[+node-versions]: **>= 22.0.0:** `22.0.0` 及以上的版本 + :::: details 怎么安装依赖环境? ::: steps diff --git a/theme/src/client/composables/encrypt.ts b/theme/src/client/composables/encrypt.ts index b05383c1..88256f57 100644 --- a/theme/src/client/composables/encrypt.ts +++ b/theme/src/client/composables/encrypt.ts @@ -18,11 +18,16 @@ export const EncryptSymbol: InjectionKey = Symbol( __VUEPRESS_DEV__ ? 'Encrypt' : '', ) -const storage = useSessionStorage('2a0a3d6afb2fdf1f', () => ({ - s: [genSaltSync(10), genSaltSync(10)] as const, - g: '' as string, - p: {} as Record, -})) +const storage = useSessionStorage('2a0a3d6afb2fdf1f', () => { + if (__VUEPRESS_SSR__) { + return { s: ['', ''] as const, g: '', p: {} as Record } + } + return { + s: [genSaltSync(10), genSaltSync(10)] as const, + g: '' as string, + p: {} as Record, + } +}) function mergeHash(hash: string) { const [left, right] = storage.value.s