fix: CryptoES -> CryptoJS

This commit is contained in:
CrescentLeaf
2025-09-08 21:26:09 +08:00
parent e2c385b559
commit 45aef8204a
2 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ import useEventListener from "../useEventListener.ts";
import Client from "../../api/Client.ts";
import { checkApiSuccessOrSncakbar, snackbar } from "../snackbar.ts";
import * as CryptoES from 'crypto-es'
import * as CryptoES from 'crypto-js'
interface Refs {
loginInputAccountRef: React.MutableRefObject<TextField | null>
@@ -31,7 +31,7 @@ export default function RegisterDialog({
const re = await Client.invoke("User.register", {
username: username,
nickname: registerInputNickNameRef.current!.value,
password: CryptoES.SHA256(registerInputPasswordRef.current!.value).toString(CryptoES.Hex),
password: CryptoJS.SHA256(registerInputPasswordRef.current!.value).toString(CryptoJS.enc.Hex),
})
if (checkApiSuccessOrSncakbar(re, "注冊失敗")) return