|
@@ -19,7 +19,7 @@ export default function Login() {
|
|
|
router.navigate(decodeURIComponent(searchParams.get('redirectUrl') as string))
|
|
|
}else{
|
|
|
sessionStorage.removeItem('advertiserId')
|
|
|
- router.navigate('/index')
|
|
|
+ router.navigate('/')
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -41,11 +41,11 @@ export default function Login() {
|
|
|
label: '账号登录',
|
|
|
children: <AccountLogin activeTab={activeTab} onLogin={login} onEditPassword={editPassword}/>
|
|
|
},
|
|
|
- {
|
|
|
- key: '2',
|
|
|
- label: '短信登录',
|
|
|
- children: <SMSlogin activeTab={activeTab} onLogin={login} onEditPassword={editPassword} />
|
|
|
- }
|
|
|
+ // {
|
|
|
+ // key: '2',
|
|
|
+ // label: '短信登录',
|
|
|
+ // children: <SMSlogin activeTab={activeTab} onLogin={login} onEditPassword={editPassword} />
|
|
|
+ // }
|
|
|
]
|
|
|
|
|
|
return (
|
|
@@ -53,7 +53,7 @@ export default function Login() {
|
|
|
<div className={styles['logo-banner']}>
|
|
|
<div className={styles['logo-icon']}></div>
|
|
|
<div className={styles['logo-title']}>
|
|
|
- 票圈 <span>|</span> 广告联盟
|
|
|
+ AD <span>|</span> 优量圈
|
|
|
</div>
|
|
|
</div>
|
|
|
<div className={styles['login-body']}>
|
|
@@ -65,16 +65,16 @@ export default function Login() {
|
|
|
{loginType === 'register' && <Register backToLogin={backToLogin}/>}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div className={styles['login-footer']}>
|
|
|
+ {/* <div className={styles['login-footer']}>
|
|
|
<p>客服电话 0731-85679198、18974809627 | 客服邮箱:piaoquankefu@piaoquantv.com</p>
|
|
|
<p>ICP备案:湘B2-20180063 | <span onClick={() => window.open('https://beian.miit.gov.cn/')}>湘ICP备16013107-06号</span> | <span onClick={() => window.open('https://beian.mps.gov.cn/#/query/webSearch')}>湘公网安备:43019002001624</span></p>
|
|
|
- </div>
|
|
|
+ </div> */}
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
// 密码登录
|
|
|
-function AccountLogin({ onLogin, onEditPassword, activeTab }: LoginTypeProps) {
|
|
|
+function AccountLogin({ onLogin, activeTab }: LoginTypeProps) {
|
|
|
const [form] = Form.useForm()
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -122,94 +122,94 @@ function AccountLogin({ onLogin, onEditPassword, activeTab }: LoginTypeProps) {
|
|
|
<Button type="primary" block onClick={login}>登录</Button>
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
|
- <p className={styles['forget-password']} onClick={onEditPassword}>忘记密码?</p>
|
|
|
+ {/* <p className={styles['forget-password']} onClick={onEditPassword}>忘记密码?</p> */}
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
// 短信登录
|
|
|
-function SMSlogin({ onLogin, onEditPassword, activeTab }: LoginTypeProps) {
|
|
|
- const [smsText, setSmsText] = useState('获取验证码')
|
|
|
- const [verificationDisabled, setVerificationDisabled] = useState(false)
|
|
|
- const [form] = Form.useForm()
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- form.resetFields()
|
|
|
- }, [activeTab])
|
|
|
-
|
|
|
- function login() {
|
|
|
- form.validateFields().then(res => {
|
|
|
- const { verificationCode, phone } = res
|
|
|
- fetchLogin(phone, verificationCode)
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- const fetchLogin = debounce((phone, verificationCode) => {
|
|
|
- sso.loginBySendCode(phone, verificationCode).then(res => {
|
|
|
- res && onLogin()
|
|
|
- })
|
|
|
- }, 500)
|
|
|
-
|
|
|
- function verificationCode() {
|
|
|
- form.validateFields(['phone']).then(res => {
|
|
|
- const { phone } = res
|
|
|
- sso.sendCode(phone).then(res => {
|
|
|
- res && countdown()
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- function countdown() {
|
|
|
- let count = 59
|
|
|
- setVerificationDisabled(true)
|
|
|
- setSmsText(`${count--}`)
|
|
|
-
|
|
|
- const interval = setInterval(() => {
|
|
|
- setSmsText(`${count--}`)
|
|
|
- if (interval && count === 0) {
|
|
|
- clearInterval(interval)
|
|
|
- setVerificationDisabled(false)
|
|
|
- setSmsText('获取验证码')
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- }
|
|
|
-
|
|
|
- function validator() {
|
|
|
- const phone = form.getFieldValue('phone')
|
|
|
-
|
|
|
- if (!phone)
|
|
|
- return Promise.resolve()
|
|
|
-
|
|
|
- const phoneRegx = /^1[3456789]\d{9}$/
|
|
|
-
|
|
|
- if (phoneRegx.test(phone))
|
|
|
- return Promise.resolve()
|
|
|
+// function SMSlogin({ onLogin, onEditPassword, activeTab }: LoginTypeProps) {
|
|
|
+// const [smsText, setSmsText] = useState('获取验证码')
|
|
|
+// const [verificationDisabled, setVerificationDisabled] = useState(false)
|
|
|
+// const [form] = Form.useForm()
|
|
|
+
|
|
|
+// useEffect(() => {
|
|
|
+// form.resetFields()
|
|
|
+// }, [activeTab])
|
|
|
+
|
|
|
+// function login() {
|
|
|
+// form.validateFields().then(res => {
|
|
|
+// const { verificationCode, phone } = res
|
|
|
+// fetchLogin(phone, verificationCode)
|
|
|
+// })
|
|
|
+// }
|
|
|
+
|
|
|
+// const fetchLogin = debounce((phone, verificationCode) => {
|
|
|
+// sso.loginBySendCode(phone, verificationCode).then(res => {
|
|
|
+// res && onLogin()
|
|
|
+// })
|
|
|
+// }, 500)
|
|
|
+
|
|
|
+// function verificationCode() {
|
|
|
+// form.validateFields(['phone']).then(res => {
|
|
|
+// const { phone } = res
|
|
|
+// sso.sendCode(phone).then(res => {
|
|
|
+// res && countdown()
|
|
|
+// })
|
|
|
+// })
|
|
|
+// }
|
|
|
+
|
|
|
+// function countdown() {
|
|
|
+// let count = 59
|
|
|
+// setVerificationDisabled(true)
|
|
|
+// setSmsText(`${count--}`)
|
|
|
+
|
|
|
+// const interval = setInterval(() => {
|
|
|
+// setSmsText(`${count--}`)
|
|
|
+// if (interval && count === 0) {
|
|
|
+// clearInterval(interval)
|
|
|
+// setVerificationDisabled(false)
|
|
|
+// setSmsText('获取验证码')
|
|
|
+// }
|
|
|
+// }, 1000)
|
|
|
+// }
|
|
|
+
|
|
|
+// function validator() {
|
|
|
+// const phone = form.getFieldValue('phone')
|
|
|
+
|
|
|
+// if (!phone)
|
|
|
+// return Promise.resolve()
|
|
|
+
|
|
|
+// const phoneRegx = /^1[3456789]\d{9}$/
|
|
|
+
|
|
|
+// if (phoneRegx.test(phone))
|
|
|
+// return Promise.resolve()
|
|
|
|
|
|
- return Promise.reject('请输入合法手机号')
|
|
|
- }
|
|
|
-
|
|
|
- return (
|
|
|
- <div className={styles['sms-login']}>
|
|
|
- <Form form={form}>
|
|
|
- <Form.Item name='phone' validateTrigger='onBlur' rules={[{ required: true, message: '请输入手机号' }, { validator }]}>
|
|
|
- <Input placeholder='请输入手机号' allowClear />
|
|
|
- </Form.Item>
|
|
|
- <Form.Item name='verificationCode' rules={[{ required: true, message: '请输入验证码' }]}>
|
|
|
- <div className={styles['msg-password']}>
|
|
|
- <Input placeholder='请输入验证码' allowClear />
|
|
|
- <Button type="primary" onClick={verificationCode} disabled={verificationDisabled}>
|
|
|
- {smsText}
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </Form.Item>
|
|
|
- <Form.Item name='loginBtn'>
|
|
|
- <Button type="primary" block onClick={login}>登录</Button>
|
|
|
- </Form.Item>
|
|
|
- </Form>
|
|
|
- <p className={styles['forget-password']} onClick={onEditPassword}>忘记密码?</p>
|
|
|
- </div>
|
|
|
- )
|
|
|
-}
|
|
|
+// return Promise.reject('请输入合法手机号')
|
|
|
+// }
|
|
|
+
|
|
|
+// return (
|
|
|
+// <div className={styles['sms-login']}>
|
|
|
+// <Form form={form}>
|
|
|
+// <Form.Item name='phone' validateTrigger='onBlur' rules={[{ required: true, message: '请输入手机号' }, { validator }]}>
|
|
|
+// <Input placeholder='请输入手机号' allowClear />
|
|
|
+// </Form.Item>
|
|
|
+// <Form.Item name='verificationCode' rules={[{ required: true, message: '请输入验证码' }]}>
|
|
|
+// <div className={styles['msg-password']}>
|
|
|
+// <Input placeholder='请输入验证码' allowClear />
|
|
|
+// <Button type="primary" onClick={verificationCode} disabled={verificationDisabled}>
|
|
|
+// {smsText}
|
|
|
+// </Button>
|
|
|
+// </div>
|
|
|
+// </Form.Item>
|
|
|
+// <Form.Item name='loginBtn'>
|
|
|
+// <Button type="primary" block onClick={login}>登录</Button>
|
|
|
+// </Form.Item>
|
|
|
+// </Form>
|
|
|
+// <p className={styles['forget-password']} onClick={onEditPassword}>忘记密码?</p>
|
|
|
+// </div>
|
|
|
+// )
|
|
|
+// }
|
|
|
|
|
|
// 忘记密码
|
|
|
function Register({ backToLogin }: RegisterType) {
|