diff --git a/client/src/pages/404.js b/client/src/pages/404.js deleted file mode 100644 index 5bed6b36b..000000000 --- a/client/src/pages/404.js +++ /dev/null @@ -1,20 +0,0 @@ -import { Button, Result } from 'antd'; -import React from 'react'; -import { history } from 'umi'; - -const NoFoundPage = () => { - return ( - history.push('/')}> - 返回主页 - < /Button> - } -/> - ); -}; - -export default NoFoundPage; diff --git a/client/src/pages/404.jsx b/client/src/pages/404.jsx new file mode 100644 index 000000000..ab8e9f168 --- /dev/null +++ b/client/src/pages/404.jsx @@ -0,0 +1,17 @@ +import { Button, Result } from 'antd'; +import React from 'react'; +import { history } from 'umi'; + +const NoFoundPage = () => { + return ( history.push('/')}> + 返回主页 + } + /> + ) +}; + +export default NoFoundPage; diff --git a/client/src/pages/login/index.tsx b/client/src/pages/login/index.tsx index 32dc4632b..aeecc410c 100644 --- a/client/src/pages/login/index.tsx +++ b/client/src/pages/login/index.tsx @@ -1,19 +1,14 @@ import { connect } from 'umi'; import { Input, Form, Button, Checkbox } from 'antd'; -// import md5 from 'md5'; import styles from './index.less'; -import JSEncrypt from 'jsencrypt'; -import { Base64 } from 'js-base64'; -import Title from 'antd/es/skeleton/Title'; +import { rsaPsw } from '@/utils' import { useState, useEffect } from 'react'; -// import Base64 from 'crypto-js/enc-base64'; + const View = ({ - loginModel, dispatch, - location, }) => { const [title, setTitle] = useState('login') - const pub = "-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArq9XTUSeYr2+N1h3Afl/z8Dse/2yD0ZGrKwx+EEEcdsBLca9Ynmx3nIB5obmLlSfmskLpBo0UACBmB5rEjBp2Q2f3AG3Hjd4B+gNCG6BDaawuDlgANIhGnaTLrIqWrrcm4EMzJOnAOI1fgzJRsOOUEfaS318Eq9OVO3apEyCCt0lOQK6PuksduOjVxtltDav+guVAA068NrPYmRNabVKRNLJpL8w4D44sfth5RvZ3q9t+6RTArpEtc5sh5ChzvqPOzKGMXW83C95TxmXqpbK6olN4RevSfVjEAgCydH6HN6OhtOQEcnrU97r9H0iZOWwbw3pVrZiUkuRD1R56Wzs2wIDAQAB-----END PUBLIC KEY-----" + const changeTitle = () => { setTitle((title) => title === 'login' ? 'register' : 'login') } @@ -27,10 +22,8 @@ const View = ({ const onCheck = async () => { try { const params = await form.validateFields(); - console.log('Success:', params); - const encryptor = new JSEncrypt() - encryptor.setPublicKey(pub) - var rsaPassWord = encryptor.encrypt(Base64.encode(params.password)) + + var rsaPassWord = rsaPsw(params.password) if (title === 'login') { dispatch({ type: 'loginModel/login', @@ -103,6 +96,7 @@ const View = ({ 已有账号?登录 ) } +
第三方登录