| | |
| | | import logo1 from '../../assets/images/logo1.png'; |
| | | import publicDataStatus from '../../status/publicData'; |
| | | import SlideTest from '../../components/SlideTest'; |
| | | |
| | | import CryptoJS from 'crypto-js'; |
| | | const { TabPane } = Tabs; |
| | | |
| | | const { Link } = Typography; |
| | | |
| | | // 密码加密函数 |
| | | function encryptPassword(password) { |
| | | // 等价于 Java 的 DigestUtils.md5DigestAsHex(cipher.getBytes()) |
| | | const md5Hash = CryptoJS.MD5(password).toString(); |
| | | return md5Hash; |
| | | } |
| | | |
| | | // 登录接口 |
| | | function logInApi(data) { |
| | |
| | | return; |
| | | } |
| | | global.setSpinning(true); |
| | | const res = await logInApi(value); |
| | | |
| | | // 对密码进行MD5加密 |
| | | const encryptedData = { |
| | | ...value, |
| | | cipher: encryptPassword(value.cipher) |
| | | }; |
| | | |
| | | const res = await logInApi(encryptedData); |
| | | if (res.type) { |
| | | message.success('您已登入成功,欢迎回来!'); |
| | | $$.clearSessionStorage(); |