diff --git a/webapp/packages/supersonic-fe/src/pages/Login/index.tsx b/webapp/packages/supersonic-fe/src/pages/Login/index.tsx index dc9265cee..481f1ea57 100644 --- a/webapp/packages/supersonic-fe/src/pages/Login/index.tsx +++ b/webapp/packages/supersonic-fe/src/pages/Login/index.tsx @@ -13,12 +13,13 @@ import { postUserLogin, userRegister } from './services'; import { AUTH_TOKEN_KEY } from '@/common/constants'; import { queryCurrentUser } from '@/services/user'; import { history, useModel } from 'umi'; +import CryptoJS from 'crypto-js'; import { encryptPassword } from '@/utils/utils'; const { Item } = Form; const LoginPage: React.FC = () => { const [createModalVisible, setCreateModalVisible] = useState(false); - const encryptKey = 'supersonic@2024'; + const encryptKey = CryptoJS.enc.Utf8.parse('supersonic@2024'); const [form] = useForm(); const { initialState = {}, setInitialState } = useModel('@@initialState'); // 通过用户信息进行登录 diff --git a/webapp/packages/supersonic-fe/src/utils/utils.ts b/webapp/packages/supersonic-fe/src/utils/utils.ts index a36096371..bb4dd5573 100644 --- a/webapp/packages/supersonic-fe/src/utils/utils.ts +++ b/webapp/packages/supersonic-fe/src/utils/utils.ts @@ -476,7 +476,7 @@ const encryptKey = CryptoJS.enc.Hex.parse( '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', ); -export const encryptPassword = (password: string, key?: string) => { +export const encryptPassword = (password: string, key?: any) => { if (!password) { return password; }