Commit 572a1493 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 注册登录修改密码国际化

parent 56cbeb19
......@@ -21,6 +21,7 @@ import purchaserEvaluation from './zh-CN/purchaserEvaluation'
import stockSellStorage from './zh-CN/stockSellStorage'
import supplierEvaluation from './zh-CN/supplierEvaluation'
import transactionComponents from './zh-CN/transaction_components'
import user from './zh-CN/user'
import content from './zh-CN/content'
import commodity from './zh-CN/commodity'
import trademark from './zh-CN/trademark'
......@@ -57,6 +58,7 @@ export default {
...stockSellStorage,
...supplierEvaluation,
...transactionComponents,
...user,
...content,
...processRuleSetting,
}
export default {
'user.tijiao': '提交',
'user.zhaohuimima': '找回密码',
'user.youxiangbucunzaiqing': '邮箱不存在, 请检查',
'user.liangcimimashurubuyi': '两次密码输入不一致',
'user.fanhuidengluye': '返回登录页',
'user.yonghudenglu': '用户登录',
'user.shiyongzhanghaomimadenglu': '使用账号密码登录',
'user.dakaiApp': '打开 App',
'user.saoyisaodenglu': '扫一扫登录',
'user.huanyingnin': '欢迎您',
'user.mianfeizhuce': '免费注册',
'user.wangjimima': '忘记密码',
'user.yiquanliguishu': '一、权利归属',
'user.11tuyawangzhandeLogo':
'1.1. 涂鸦网站的Logo、“涂鸦”、“涂鸦智能”、“tuya”等文字、图形及其组合,以及涂鸦网站的其他标识、徽记、涂鸦服务的名称等为涂鸦及其关联公司在中国和其他国家的注册商标。未经涂鸦书面授权,任何人不得以任何方式展示、使用或做其他处理(包括但不限于复制、传播、展示、镜像、上传、下载),也不得向他人表明您有权展示、使用或做其他处理。',
'user.12tuyawangzhansuoyou':
'1.2. 涂鸦网站所有的产品、服务、技术与所有程序(以下或简称“技术服务”)的知识产权均归属于涂鸦或归其权利人所有。',
'user.13chufeituyalingxing':
'1.3. 除非涂鸦另行声明,涂鸦拥有涂鸦在网站内发布文档等信息(包括但不限于文字、图形、图片、照片、音频、视频、图标、色彩、版面设计、电子文档)的所有权利(包括但不限于版权、商标权、专利权、商业秘密和其他所有相关权利)。未经涂鸦许可,任何人不得擅自使用如上内容(包括但不限于通过程序或设备监视、复制、转播、展示、镜像、上传、下载涂鸦网站内的任何内容)。被授权浏览、复制、打印和传播属于涂鸦网站内信息内容的,该等内容都不得用于商业目的且所有信息内容及其任何部分的使用都必须包括此权利声明。',
'user.23chufeituyalingxing':
'2.3. 除非涂鸦另行声明,涂鸦拥有涂鸦在网站内发布文档等信息(包括但不限于文字、图形、图片、照片、音频、视频、图标、色彩、版面设计、电子文档)的所有权利(包括但不限于版权、商标权、专利权、商业秘密和其他所有相关权利)。未经涂鸦许可,任何人不得擅自使用如上内容(包括但不限于通过程序或设备监视、复制、转播、展示、镜像、上传、下载涂鸦网站内的任何内容)。被授权浏览、复制、打印和传播属于涂鸦网站内信息内容的,该等内容都不得用于商业目的且所有信息内容及其任何部分的使用都必须包括此权利声明。',
'user.22tuyawangzhansuoyou':
'2.2. 涂鸦网站所有的产品、服务、技术与所有程序(以下或简称“技术服务”)的知识产权均归属于涂鸦或归其权利人所有。',
'user.21tuyawangzhandeLogo':
'2.1. 涂鸦网站的Logo、“涂鸦”、“涂鸦智能”、“tuya”等文字、图形及其组合,以及涂鸦网站的其他标识、徽记、涂鸦服务的名称等为涂鸦及其关联公司在中国和其他国家的注册商标。未经涂鸦书面授权,任何人不得以任何方式展示、使用或做其他处理(包括但不限于复制、传播、展示、镜像、上传、下载),也不得向他人表明您有权展示、使用或做其他处理。',
'user.erzerenxianzhi': '二、责任限制',
'user.yinsizhengce': '隐私政策',
'user.qingxiantongyigouxuanxieyi': '请先同意勾选协议',
'user.tianxiexinxi': '填写信息',
'user.wanshanziliao': '完善资料',
'user.dengdaishenhe': '等待审核',
'user.zhucechenggong': '注册成功',
'user.zhixingdenglutiaozhuan': '执行登录跳转!',
'user.fujiandaxiaobunengchaoguo': '附件大小不能超过5M!',
'user.huoquyanzhengma': '获取验证码',
'user.yonghuzhuce': '用户注册',
'user.yuedubingtongyi': '阅读并同意',
'user.qingxuanzenindeshenfen': '请选择您的身份',
'user.qingxuanzeninyaokaizhande': '请选择您要开展的业务',
'user.tongyixieyibingzhuce': '同意协议并注册',
'user.xiayibujixuwanshan': '下一步:继续完善',
'user.tijiaozhuceziliao': '提交注册资料',
'user.nindezhuceziliaoyijing': '您的注册资料已经提交成功,请等待平台审核',
'user.shenhejieguohuiyiduanxin': '审核结果会以短信通知您',
'user.ninyekeyidenglupingtai': '您也可以登录平台查看审核结果',
'user.houzidongtiaozhuanzhidenglu': '后自动跳转至登录页',
'user.lijitiaozhuan': '立即跳转',
'user.yiyoupingtaizhanghao': '已有平台账号?',
'user.qudenglu': '去登录',
'user.dengluchenggong': '登录成功',
'user.dangqianshoujihaoma': '当前手机号码',
'user.qingshiyongpingtaizhanghaodeng': '请使用平台账号登录',
'user.dianjidenglu': '点击登录',
'user.qingshuruzhengquedeyonghu': '请输入正确的用户名',
'user.yonghumingshoujihao': '用户名/手机号',
'user.qingshurumima': '请输入密码',
'user.dianjijinhangyanzheng': '点击进行验证',
'user.denglu': '登录',
'user.qingshuruzhengquedemima': '请输入正确的密码',
'user.mimachangdu820gezifu': '密码长度8-20个字符',
'user.mimabunengbaohankongge': '密码不能包含空格',
'user.mimabixubaohandaxie': '密码必须包含大写字母、小写字母和数字',
'user.qingshezhinidedenglumi': '请设置你的登录密码',
'user.saomadenglu': '扫码登录',
'user.qingtianxieshoujihao': '请填写手机号',
'user.qingshurunindeshoujihao': '请输入您的手机号码',
'user.qingtianxieyanzhengma': '请填写验证码',
'user.qingshuruzhengquede6wei': '请输入正确的6位验证码',
'user.qingtianxiedenglumima': '请填写登录密码',
'user.qingzaicishurunidedeng': '请再次输入你的登录密码',
'user.qingshuruzhengquedeyouxiang': '请输入正确的邮箱',
'user.qingshurunideyouxiang': '请输入你的邮箱(选填)',
'user.qingxuanzeyewu': '请选择业务',
'user.qingshuruzhengquedeyouxiang1': '请输入正确的邮箱/手机号',
'user.qingninshuruyouxiangshou': '请您输入邮箱/手机',
'user.qingshuruyanzhengma': '请输入验证码',
'user.qingshezhinidexinmima': '请设置你的新密码',
'user.qingzaicishurumima': '请再次输入密码',
}
import React, { useState } from 'react'
import { history } from 'umi'
import { getIntl, history } from 'umi'
import { Form, Row, Col, Input, Button, message } from 'antd'
import {
UserOutlined,
......@@ -11,7 +11,7 @@ import { setAuth, setRouters } from '@/utils/auth';
import { encryptedByAES } from '@/utils/cryptoAes';
import { setUserCookie } from '@/utils/siteCookie';
import { omit } from '@/utils';
const intl = getIntl();
const LoginWrap: React.FC = () => {
const { redirect } = history.location.query
const [validFrame, setValidFrame] = useState(false)
......@@ -25,7 +25,7 @@ const LoginWrap: React.FC = () => {
const { data, code } = res
if (code === 1000) {
message.destroy()
message.success("登录成功")
message.success(intl.formatMessage({id: 'user.dengluchenggong'}))
setRouters(data.urls)
// 设置同域名cookie缓存
setAuth(data)
......@@ -45,7 +45,7 @@ const LoginWrap: React.FC = () => {
return (
<>
<p>{validFrame ? '当前手机号码:xxxxxxxxx' : '请使用平台账号登录'}</p>
<p>{validFrame ? `${intl.formatMessage({id: 'user.dangqianshoujihaoma'})}:xxxxxxxxx` : intl.formatMessage({id: 'user.qingshiyongpingtaizhanghaodeng'})}</p>
{
validFrame ?
<>
......@@ -54,12 +54,12 @@ const LoginWrap: React.FC = () => {
<Input size='large' />
</Col>
<Col offset={1} span={7}>
<Button type='default' size='large'>获取验证码</Button>
<Button type='default' size='large'>{intl.formatMessage({id: 'user.huoquyanzhengma'})}</Button>
</Col>
</Row>
<Row>
<Col span={24}>
<Button type='primary' size='large' htmlType='submit' block>点击登录</Button>
<Button type='primary' size='large' htmlType='submit' block>{intl.formatMessage({id: 'user.dianjidenglu'})}</Button>
</Col>
</Row>
</>
......@@ -73,12 +73,12 @@ const LoginWrap: React.FC = () => {
[
{
required: true,
message: <><ExclamationCircleFilled style={{ marginRight: 6 }} /><span>请输入正确的用户名</span></>
message: <><ExclamationCircleFilled style={{ marginRight: 6 }} /><span>{intl.formatMessage({id: 'user.qingshuruzhengquedeyonghu'})}</span></>
}
]
}
>
<Input prefix={<UserOutlined />} placeholder='用户名/手机号' size='large' />
<Input prefix={<UserOutlined />} placeholder={intl.formatMessage({id: 'user.yonghumingshoujihao'})} size='large' />
</Form.Item>
<Form.Item
name='password'
......@@ -86,21 +86,21 @@ const LoginWrap: React.FC = () => {
[
{
required: true,
message: <><ExclamationCircleFilled style={{ marginRight: 6 }} /><span>请输入正确的密码</span></>
message: <><ExclamationCircleFilled style={{ marginRight: 6 }} /><span>{intl.formatMessage({id: 'user.qingshuruzhengquedemima'})}</span></>
}
]
}
>
<Input.Password prefix={<LockOutlined />} placeholder='请输入密码' size='large' />
<Input.Password prefix={<LockOutlined />} placeholder={intl.formatMessage({id: 'user.qingshurumima'})} size='large' />
</Form.Item>
{validButton && (<Form.Item
className={'loginVerBtn'}
>
<Button ghost type='primary' block size='large'>点击进行验证</Button>
<Button ghost type='primary' block size='large'>{intl.formatMessage({id: 'user.dianjijinhangyanzheng'})}</Button>
</Form.Item>)
}
<Form.Item>
<Button type='primary' loading={loginLoading} size='large' htmlType='submit' block>登录</Button>
<Button type='primary' loading={loginLoading} size='large' htmlType='submit' block>{intl.formatMessage({id: 'user.denglu'})}</Button>
</Form.Item>
</Form>
}
......
import React, { useEffect } from 'react'
import { Input, Tooltip, Form } from 'antd'
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons'
import { PATTERN_MAPS } from '@/constants/regExp';
import styles from './index.less'
interface PasswordInputPropsType {
value: string,
type: string,
placeholder: string,
size: any,
styles?: any,
onChange: Function,
}
const PasswordInput: React.FC<PasswordInputPropsType> & { isFieldComponent: boolean } = (props) => {
const { type, placeholder, size, value, onChange } = props
const LengthReg = /^[a-zA-Z\d]{8,20}$/
const wordReg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z\d]*$/
const showPasswordTip = () => {
return <div className={styles.passwordInputTip}>
<div className={styles.tipItem}>
{
LengthReg.test(value) ? <CheckCircleOutlined style={{color: '#00b47b'}} /> : <CloseCircleOutlined style={{color: '#e63f3c'}} />
}
<span className={styles.tiptext}>密码长度8-20个字符</span>
</div>
<div className={styles.tipItem}>
{
value.indexOf(" ") === -1 ? <CheckCircleOutlined style={{color: '#00b47b'}} /> : <CloseCircleOutlined style={{color: '#e63f3c'}} />
}
<span className={styles.tiptext}>密码不能包含空格</span>
</div>
<div className={styles.tipItem}>
{
wordReg.test(value) ? <CheckCircleOutlined style={{color: '#00b47b'}} /> : <CloseCircleOutlined style={{color: '#e63f3c'}} />
}
<span className={styles.tiptext}>密码必须包含大写字母、小写字母和数字</span>
</div>
</div>
}
const handleChange = (value) => {
onChange(value)
}
return (
<div style={{ width: '100%'}} className={styles.customInput}>
<Tooltip
placement="right"
title={showPasswordTip}
color="#FFF"
>
<Form.Item
name="password"
style={{ marginBottom: 0 }}
rules={[{pattern: PATTERN_MAPS.password, message: '请输入正确的密码'}]}
>
<Input placeholder={placeholder} value={value} size={size} type={type} onChange={handleChange} />
</Form.Item>
</Tooltip>
</div>
)
}
PasswordInput.defaultProps = {
type: 'password',
placeholder: '请设置你的登录密码',
size: 'large',
value: "",
};
PasswordInput.isFieldComponent = false;
export default PasswordInput;
import React, { useEffect } from 'react'
import { Input, Tooltip, Form } from 'antd'
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons'
import { PATTERN_MAPS } from '@/constants/regExp';
import styles from './index.less'
import { getIntl } from 'umi';
interface PasswordInputPropsType {
value: string,
type: string,
placeholder: string,
size: any,
styles?: any,
onChange: Function,
}
const intl = getIntl();
const PasswordInput: React.FC<PasswordInputPropsType> & { isFieldComponent: boolean } = (props) => {
const { type, placeholder, size, value, onChange } = props
const LengthReg = /^[a-zA-Z\d]{8,20}$/
const wordReg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z\d]*$/
const showPasswordTip = () => {
return <div className={styles.passwordInputTip}>
<div className={styles.tipItem}>
{
LengthReg.test(value) ? <CheckCircleOutlined style={{color: '#00b47b'}} /> : <CloseCircleOutlined style={{color: '#e63f3c'}} />
}
<span className={styles.tiptext}>{intl.formatMessage({id: 'user.mimachangdu820gezifu'})}</span>
</div>
<div className={styles.tipItem}>
{
value.indexOf(" ") === -1 ? <CheckCircleOutlined style={{color: '#00b47b'}} /> : <CloseCircleOutlined style={{color: '#e63f3c'}} />
}
<span className={styles.tiptext}>{intl.formatMessage({id: 'user.mimabunengbaohankongge'})}</span>
</div>
<div className={styles.tipItem}>
{
wordReg.test(value) ? <CheckCircleOutlined style={{color: '#00b47b'}} /> : <CloseCircleOutlined style={{color: '#e63f3c'}} />
}
<span className={styles.tiptext}>{intl.formatMessage({id: 'user.mimabixubaohandaxie'})}</span>
</div>
</div>
}
const handleChange = (value) => {
onChange(value)
}
return (
<div style={{ width: '100%'}} className={styles.customInput}>
<Tooltip
placement="right"
title={showPasswordTip}
color="#FFF"
>
<Form.Item
name="password"
style={{ marginBottom: 0 }}
rules={[{pattern: PATTERN_MAPS.password, message: intl.formatMessage({id: 'user.qingshuruzhengquedemima'})}]}
>
<Input placeholder={placeholder} value={value} size={size} type={type} onChange={handleChange} />
</Form.Item>
</Tooltip>
</div>
)
}
PasswordInput.defaultProps = {
type: 'password',
placeholder: intl.formatMessage({id: 'user.qingshezhinidedenglumi'}),
size: 'large',
value: "",
};
PasswordInput.isFieldComponent = false;
export default PasswordInput;
import React, { useState, useEffect, useRef } from 'react'
import { message } from 'antd'
import { history } from 'umi';
import { getIntl, history } from 'umi';
import { setAuth, setRouters } from '@/utils/auth';
import QRCode from 'qrcode';
import { postMemberLoginAuthUrl, postMemberLoginInfo } from '@/services/MemberV2Api';
const intl = getIntl();
const ScanLoginWrap: React.FC = () => {
const { redirect } = history.location.query
const [qrCode, setQrCode] = useState('')
......@@ -63,7 +63,7 @@ const ScanLoginWrap: React.FC = () => {
const { data, code } = res
if (code === 1000) {
message.destroy()
message.success("登录成功")
message.success(intl.formatMessage({id: 'user.dengluchenggong'}))
setAuth(data)
setRouters(data.urls)
// 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验
......@@ -89,7 +89,7 @@ const ScanLoginWrap: React.FC = () => {
}, [])
return (
<div className={'scanLoginWrap'}>
<h2>扫码登录</h2>
<h2>{intl.formatMessage({id: 'user.saomadenglu'})}</h2>
<div className={'qrCodeImage'}>
{
qrCode && <img src={qrCode} alt="" />
......
import React, { Fragment } from 'react';
import cx from 'classnames';
import { Row, Button, message } from 'antd';
import { Link, Helmet, history } from 'umi'
import { Link, Helmet, history, getIntl } from 'umi'
import NiceForm from '@/components/NiceForm';
import { forgetPwdSchema } from './schema';
import { PATTERN_MAPS } from '@/constants/regExp';
......@@ -13,7 +13,7 @@ import PasswordInput from './components/PasswordInput'
import './index.less'
const actions = createFormActions()
const intl = getIntl();
const prefixCode = '+86'
const GetBack: React.FC = () => {
......@@ -30,12 +30,12 @@ const GetBack: React.FC = () => {
}
}
const SubmitBtn = <Button type='primary' block htmlType='submit'>提交</Button>
const SubmitBtn = <Button type='primary' block htmlType='submit'>{intl.formatMessage({id: 'user.tijiao'})}</Button>
return (
<Fragment>
<Helmet>
<title>找回密码</title>
<title>{intl.formatMessage({id: 'user.zhaohuimima'})}</title>
</Helmet>
<Row className={'getBackBox'}>
......@@ -66,7 +66,7 @@ const GetBack: React.FC = () => {
}, { ctlType: 'none', useCache: true, ttl: 60 * 1000 }).then(({ code, data }) => {
if (code === 1000) {
setFieldState('account', state => {
state.errors = ['邮箱不存在, 请检查']
state.errors = [intl.formatMessage({id: 'user.youxiangbucunzaiqing'})]
})
} else {
message.destroy()
......@@ -92,7 +92,7 @@ const GetBack: React.FC = () => {
// })
setFieldState('confirmPassword', state => {
if (selfValue && otherValue && selfValue !== otherValue) {
state.errors = ['两次密码输入不一致']
state.errors = [intl.formatMessage({id: 'user.liangcimimashurubuyi'})]
} else {
state.errors = ['']
}
......@@ -102,7 +102,7 @@ const GetBack: React.FC = () => {
/>
<p className={'formBox'}>
<Link className='back' to={'/user/login'}>返回登录页</Link>
<Link className='back' to={'/user/login'}>{intl.formatMessage({id: 'user.fanhuidengluye'})}</Link>
</p>
</div>
</Row>
......
......@@ -8,7 +8,7 @@ import TextLink from '@/components/TextLink';
import {
ScanOutlined
} from '@ant-design/icons'
import { Link, history, Helmet } from 'umi'
import { Link, history, Helmet, getIntl } from 'umi'
import ScanLoginWrap from './components/ScanLoginWrap';
// import leftPicture from '../../../mockStatic/image_ad.png'
import { getManageContentImageFindAllByUseSceneAndPosition } from '@/services/ManageV2Api'
......@@ -16,7 +16,7 @@ import wechat from '../../../mockStatic/Wechat.png'
import qq from '../../../mockStatic/QQ.png'
import alipay from '../../../mockStatic/Alipay.png'
import LoginWrap from './components/LoginWrap'
const intl = getIntl();
const User: React.FC = () => {
const [isScanQrCode, setIsScanQrCode] = useState(false)
const [sceneList, setSceneList] = useState<any>()
......@@ -27,7 +27,7 @@ const User: React.FC = () => {
const forgetPassword = () => {
history.push('/user/forget')
console.log('找回密码')
console.log(intl.formatMessage({id: 'user.zhaohuimima'}))
}
useEffect(() => {
......@@ -58,7 +58,7 @@ const User: React.FC = () => {
return (
<Fragment>
<Helmet>
<title>用户登录</title>
<title>{intl.formatMessage({id: 'user.yonghudenglu'})}</title>
</Helmet>
<Row className={cx('loginWrap', globalStyles.lingxiBusinessContent1024)}>
<Col className={cx('loginItem', 'loginDesc')}>
......@@ -74,22 +74,22 @@ const User: React.FC = () => {
<div className={'loginMain'}>
{isScanQrCode ? (
<>
<a onClick={() => handleGuideLogin(false)} className={'clickUsernameLogin'}>使用账号密码登录</a>
<a onClick={() => handleGuideLogin(false)} className={'clickUsernameLogin'}>{intl.formatMessage({id: 'user.shiyongzhanghaomimadenglu'})}</a>
<ScanLoginWrap />
<div className={'scanTips'}>
<ScanOutlined className={'scanIcon'} />
<span>打开 App<br />扫一扫登录</span>
<span>{intl.formatMessage({id: 'user.dakaiApp'})}<br />{intl.formatMessage({id: 'user.saoyisaodenglu'})}</span>
</div>
</>
) : (
<>
<a onClick={() => handleGuideLogin(true)} className={'clickScanLogin'} />
<h2>欢迎您</h2>
<h2>{intl.formatMessage({id: 'user.huanyingnin'})}</h2>
<LoginWrap />
<Row justify='end' style={{ marginTop: 16 }}>
<Space size={32}>
<TextLink><Link to='/user/register' style={{ color: '#909399' }}>免费注册</Link></TextLink>
<TextLink><a onClick={forgetPassword} style={{ color: '#909399' }}>忘记密码</a></TextLink>
<TextLink><Link to='/user/register' style={{ color: '#909399' }}>{intl.formatMessage({id: 'user.mianfeizhuce'})}</Link></TextLink>
<TextLink><a onClick={forgetPassword} style={{ color: '#909399' }}>{intl.formatMessage({id: 'user.wangjimima'})}</a></TextLink>
</Space>
</Row>
</>
......
......@@ -2,24 +2,25 @@ import React from 'react'
import cx from 'classnames'
import styles from './index.less'
import globalStyles from '@/global/styles/global.less'
import { getIntl } from 'umi';
const intl = getIntl();
const Policy = (props) => {
return <div className={styles.policyBox}>
<h1>隐私政策</h1>
<h1>{intl.formatMessage({id: 'user.yinsizhengce'})}</h1>
<div className={globalStyles.lingxiBusinessMarginContent}>
<article>
<h4>一、权利归属</h4>
<h4>{intl.formatMessage({id: 'user.yiquanliguishu'})}</h4>
<main>
<p>1.1. 涂鸦网站的Logo、“涂鸦”、“涂鸦智能”、“tuya”等文字、图形及其组合,以及涂鸦网站的其他标识、徽记、涂鸦服务的名称等为涂鸦及其关联公司在中国和其他国家的注册商标。未经涂鸦书面授权,任何人不得以任何方式展示、使用或做其他处理(包括但不限于复制、传播、展示、镜像、上传、下载),也不得向他人表明您有权展示、使用或做其他处理。</p>
<p>1.2. 涂鸦网站所有的产品、服务、技术与所有程序(以下或简称“技术服务”)的知识产权均归属于涂鸦或归其权利人所有。</p>
<p>1.3. 除非涂鸦另行声明,涂鸦拥有涂鸦在网站内发布文档等信息(包括但不限于文字、图形、图片、照片、音频、视频、图标、色彩、版面设计、电子文档)的所有权利(包括但不限于版权、商标权、专利权、商业秘密和其他所有相关权利)。未经涂鸦许可,任何人不得擅自使用如上内容(包括但不限于通过程序或设备监视、复制、转播、展示、镜像、上传、下载涂鸦网站内的任何内容)。被授权浏览、复制、打印和传播属于涂鸦网站内信息内容的,该等内容都不得用于商业目的且所有信息内容及其任何部分的使用都必须包括此权利声明。</p>
<p>{intl.formatMessage({id: 'user.11tuyawangzhandeLogo'})}</p>
<p>{intl.formatMessage({id: 'user.12tuyawangzhansuoyou'})}</p>
<p>{intl.formatMessage({id: 'user.13chufeituyalingxing'})}</p>
</main>
<h4>二、责任限制</h4>
<h4>{intl.formatMessage({id: 'user.erzerenxianzhi'})}</h4>
<main>
<p>2.1. 涂鸦网站的Logo、“涂鸦”、“涂鸦智能”、“tuya”等文字、图形及其组合,以及涂鸦网站的其他标识、徽记、涂鸦服务的名称等为涂鸦及其关联公司在中国和其他国家的注册商标。未经涂鸦书面授权,任何人不得以任何方式展示、使用或做其他处理(包括但不限于复制、传播、展示、镜像、上传、下载),也不得向他人表明您有权展示、使用或做其他处理。</p>
<p>2.2. 涂鸦网站所有的产品、服务、技术与所有程序(以下或简称“技术服务”)的知识产权均归属于涂鸦或归其权利人所有。</p>
<p>2.3. 除非涂鸦另行声明,涂鸦拥有涂鸦在网站内发布文档等信息(包括但不限于文字、图形、图片、照片、音频、视频、图标、色彩、版面设计、电子文档)的所有权利(包括但不限于版权、商标权、专利权、商业秘密和其他所有相关权利)。未经涂鸦许可,任何人不得擅自使用如上内容(包括但不限于通过程序或设备监视、复制、转播、展示、镜像、上传、下载涂鸦网站内的任何内容)。被授权浏览、复制、打印和传播属于涂鸦网站内信息内容的,该等内容都不得用于商业目的且所有信息内容及其任何部分的使用都必须包括此权利声明。</p>
<p>{intl.formatMessage({id: 'user.21tuyawangzhandeLogo'})}</p>
<p>{intl.formatMessage({id: 'user.22tuyawangzhansuoyou'})}</p>
<p>{intl.formatMessage({id: 'user.23chufeituyalingxing'})}</p>
</main>
</article>
</div>
......
......@@ -6,7 +6,7 @@ import {
import './index.less'
import globalStyles from '@/global/styles/global.less'
import cx from 'classnames'
import { Link, history, Helmet } from 'umi'
import { Link, history, Helmet, getIntl } from 'umi'
import im_success from '../../../mockStatic/im_success.png'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import useCountDown from '@/utils/hooks';
......@@ -19,7 +19,7 @@ import schemas from './schema';
import { encryptedByAES } from '@/utils/cryptoAes';
import PasswordInput from './components/PasswordInput'
import godEvent from '@/utils/event'
const intl = getIntl();
const eventEmitter = godEvent
const { onFieldValueChange$, onFieldInputChange$, onFieldValidateEnd$ } = FormEffectHooks
......@@ -53,7 +53,7 @@ const useLinkageValidateEffects = () => {
const otherValue = getFieldState('password', state => state.value)
setFieldState('confirmPassword', state => {
if (selfValue && otherValue && selfValue !== otherValue) {
state.errors = ['两次密码输入不一致']
state.errors = [intl.formatMessage({id: 'user.liangcimimashurubuyi'})]
} else {
state.errors = ['']
}
......@@ -64,7 +64,7 @@ const useLinkageValidateEffects = () => {
console.log(fieldState, "fieldState")
if(!fieldState.value) {
setFieldState('isRead', state => {
state.errors = ['请先同意勾选协议']
state.errors = [intl.formatMessage({id: 'user.qingxiantongyigouxuanxieyi'})]
})
} else {
setFieldState('isRead', state => {
......@@ -85,10 +85,10 @@ const UserRegistry = () => {
const [agreementList, setAgreementList] = useState([])
const stepList = [
{ title: '填写信息', key: 'message', name: 'message' },
{ title: '完善资料', key: 'over', name: 'over' },
{ title: '等待审核', key: 'wait', name: 'wait' },
{ title: '注册成功', key: 'success', name: 'success' },
{ title: intl.formatMessage({id: 'user.tianxiexinxi'}), key: 'message', name: 'message' },
{ title: intl.formatMessage({id: 'user.wanshanziliao'}), key: 'over', name: 'over' },
{ title: intl.formatMessage({id: 'user.dengdaishenhe'}), key: 'wait', name: 'wait' },
{ title: intl.formatMessage({id: 'user.zhucechenggong'}), key: 'success', name: 'success' },
]
useEffect(() => {
......@@ -126,7 +126,7 @@ const UserRegistry = () => {
clearInterval(timeChange)
setTime(60)
history.push('/user/login')
console.log('执行登录跳转!')
console.log(intl.formatMessage({id: 'user.zhixingdenglutiaozhuan'}))
}
}, [time])
......@@ -149,7 +149,7 @@ const UserRegistry = () => {
if (isLt5M) {
return Promise.resolve();
} else {
return Promise.reject('附件大小不能超过5M!');
return Promise.reject(intl.formatMessage({id: 'user.fujiandaxiaobunengchaoguo'}));
}
} else {
return Promise.reject();
......@@ -159,7 +159,7 @@ const UserRegistry = () => {
const beforeUpload = (file: any) => {
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
message.error('附件大小不能超过5M!');
message.error(intl.formatMessage({id: 'user.fujiandaxiaobunengchaoguo'}));
}
console.log(isLt5M)
return isLt5M;
......@@ -168,7 +168,7 @@ const UserRegistry = () => {
const { text, isActive, start } = useCountDown({
maxTime: 60,
minTime: 0,
initText: '获取验证码',
initText: intl.formatMessage({id: 'user.huoquyanzhengma'}),
onEnd: () => { console.log("end") },
decayRate: 1,
delay: 1 * 1000
......@@ -253,7 +253,7 @@ const UserRegistry = () => {
return (
<Fragment>
<Helmet>
<title>用户注册</title>
<title>{intl.formatMessage({id: 'user.yonghuzhuce'})}</title>
</Helmet>
<div className={cx('register', globalStyles.lingxiBusinessContent1024)}>
{/* <h3>欢迎您注册数商云账号</h3> */}
......@@ -291,47 +291,47 @@ const UserRegistry = () => {
current: false,
phoneBefore: <div className={'formBefore'}>+86</div>,
smsCodeAfter: <Button disabled={isActive} style={{ minWidth: 110, marginLeft: 8 }} size='large' onClick={handleSendSMS}>{text}</Button>,
checkBoxChildren: <span style={{ fontSize: 12 }}>阅读并同意<span className='commonPickColor'>
checkBoxChildren: <span style={{ fontSize: 12 }}>{intl.formatMessage({id: 'user.yuedubingtongyi'})}<span className='commonPickColor'>
{
agreementList && agreementList.map(item => (<a key={`aggreem_${item.id}`} href={`/user/agreement?id=${item.id}`} target="_blank" rel="noreferrer">{item.title}</a>))
}
</span>
</span>,
memberTypeTitle: <span className={'commonPanelTitle'}>请选择您的身份</span>,
businessTypeTitle: <span className={'commonPanelTitle'}>请选择您要开展的业务</span>,
memberTypeTitle: <span className={'commonPanelTitle'}>{intl.formatMessage({id: 'user.qingxuanzenindeshenfen'})}</span>,
businessTypeTitle: <span className={'commonPanelTitle'}>{intl.formatMessage({id: 'user.qingxuanzeninyaokaizhande'})}</span>,
}}
/>
<div className={cx('registerForm', 'global-block-center')}>
{
current === 0 &&
<Button type='primary' className={'continueButton'} onClick={handleActionBtn}>同意协议并注册</Button>
<Button type='primary' className={'continueButton'} onClick={handleActionBtn}>{intl.formatMessage({id: 'user.tongyixieyibingzhuce'})}</Button>
}
{
current === 1 && !subStep &&
<Button type='primary' className={'continueButton'} onClick={nextStepAction} loading={submitLoading}>下一步:继续完善</Button>
<Button type='primary' className={'continueButton'} onClick={nextStepAction} loading={submitLoading}>{intl.formatMessage({id: 'user.xiayibujixuwanshan'})}</Button>
}
{
current === 1 && subStep &&
<Button type='primary' className={'continueButton'} onClick={submitForm} loading={submitLoading}>提交注册资料</Button>
<Button type='primary' className={'continueButton'} onClick={submitForm} loading={submitLoading}>{intl.formatMessage({id: 'user.tijiaozhuceziliao'})}</Button>
}
</div>
{
current === 2 &&
<div className={'formBoxStep3'}>
<img src={im_success} alt="待审核" />
<h2>您的注册资料已经提交成功,请等待平台审核</h2>
<h2>{intl.formatMessage({id: 'user.nindezhuceziliaoyijing'})}</h2>
<div className={'description'}>
<p>审核结果会以短信通知您</p>
<p>您也可以登录平台查看审核结果</p>
<p>{intl.formatMessage({id: 'user.shenhejieguohuiyiduanxin'})}</p>
<p>{intl.formatMessage({id: 'user.ninyekeyidenglupingtai'})}</p>
</div>
<p className={'guid'}>
<span>{time}s 后自动跳转至登录页</span>
<span>{time}s {intl.formatMessage({id: 'user.houzidongtiaozhuanzhidenglu'})}</span>
<br />
<span><Link to="/user/login">立即跳转</Link></span>
<span><Link to="/user/login">{intl.formatMessage({id: 'user.lijitiaozhuan'})}</Link></span>
</p>
</div>
}
<p className={'readyLogin'}>已有平台账号? <Link to="/user/login">去登录</Link></p>
<p className={'readyLogin'}>{intl.formatMessage({id: 'user.yiyoupingtaizhanghao'})} <Link to="/user/login">{intl.formatMessage({id: 'user.qudenglu'})}</Link></p>
</div>
</div>
</Fragment>
......
......@@ -2,7 +2,8 @@ import { ISchema, ISchemaFormActions } from '@formily/antd';
import { PATTERN_MAPS } from '@/constants/regExp';
import { GlobalConfig } from '@/global/config';
import { postMemberRegisterPswSms, postMemberRegisterPswEmail } from '@/services/MemberV2Api';
import { getIntl } from 'umi';
const intl = getIntl();
export const registerStep0Schema: ISchema = {
type: 'object',
properties: {
......@@ -19,16 +20,16 @@ export const registerStep0Schema: ISchema = {
"x-rules": [
{
required: true,
message: '请填写手机号'
message: intl.formatMessage({id: 'user.qingtianxieshoujihao'})
},
{
pattern: PATTERN_MAPS.phone,
message: '请填写手机号'
message: intl.formatMessage({id: 'user.qingtianxieshoujihao'})
}
],
triggerType: 'onBlur',
"x-component-props": {
placeholder: '请输入您的手机号码',
placeholder: intl.formatMessage({id: 'user.qingshurunindeshoujihao'}),
size: 'large'
},
"x-props": {
......@@ -41,11 +42,11 @@ export const registerStep0Schema: ISchema = {
"x-rules": [
{
required: true,
message: '请填写验证码'
message: intl.formatMessage({id: 'user.qingtianxieyanzhengma'})
},
{
pattern: PATTERN_MAPS.smsCode,
message: '请输入正确的6位验证码'
message: intl.formatMessage({id: 'user.qingshuruzhengquede6wei'})
}
],
"x-component-props": {
......@@ -58,12 +59,12 @@ export const registerStep0Schema: ISchema = {
"x-rules": [
{
required: true,
message: '请填写登录密码'
message: intl.formatMessage({id: 'user.qingtianxiedenglumima'})
},
],
"x-component-props": {
type: 'password',
placeholder: '请设置你的登录密码',
placeholder: intl.formatMessage({id: 'user.qingshezhinidedenglumi'}),
size: 'large'
}
},
......@@ -90,7 +91,7 @@ export const registerStep0Schema: ISchema = {
"x-rules": [
{
required: true,
message: '请输入密码'
message: intl.formatMessage({id: 'user.qingshurumima'})
},
// {
// pattern: PATTERN_MAPS.password,
......@@ -99,7 +100,7 @@ export const registerStep0Schema: ISchema = {
],
"x-component-props": {
type: 'password',
placeholder: '请再次输入你的登录密码',
placeholder: intl.formatMessage({id: 'user.qingzaicishurunidedeng'}),
size: 'large',
}
},
......@@ -108,11 +109,11 @@ export const registerStep0Schema: ISchema = {
"x-rules": [
{
pattern: PATTERN_MAPS.email,
message: '请输入正确的邮箱'
message: intl.formatMessage({id: 'user.qingshuruzhengquedeyouxiang'})
}
],
"x-component-props": {
placeholder: '请输入你的邮箱(选填)',
placeholder: intl.formatMessage({id: 'user.qingshurunideyouxiang'}),
size: 'large',
type: 'email'
}
......@@ -121,7 +122,7 @@ export const registerStep0Schema: ISchema = {
"x-rules": [
{
required: true,
message: '请先同意勾选协议'
message: intl.formatMessage({id: 'user.qingxiantongyigouxuanxieyi'})
},
],
default: false,
......@@ -188,7 +189,7 @@ export const registerStep1Schema: ISchema = {
"x-rules": [
{
required: true,
message: '请选择业务'
message: intl.formatMessage({id: 'user.qingxuanzeyewu'})
}
]
},
......@@ -217,15 +218,15 @@ export const forgetPwdSchema: ISchema = {
"x-rules": [
{
required: true,
message: '请输入正确的邮箱/手机号'
message: intl.formatMessage({id: 'user.qingshuruzhengquedeyouxiang1'})
},
{
pattern: PATTERN_MAPS.phoneAndEmail,
message: '请输入正确的邮箱/手机号'
message: intl.formatMessage({id: 'user.qingshuruzhengquedeyouxiang1'})
},
],
"x-component-props": {
placeholder: '请您输入邮箱/手机',
placeholder: intl.formatMessage({id: 'user.qingninshuruyouxiangshou'}),
size: 'large'
}
},
......@@ -239,16 +240,16 @@ export const forgetPwdSchema: ISchema = {
"x-rules": [
{
required: true,
message: '请输入验证码'
message: intl.formatMessage({id: 'user.qingshuruyanzhengma'})
},
{
pattern: PATTERN_MAPS.smsCode,
message: '请输入正确的6位验证码'
message: intl.formatMessage({id: 'user.qingshuruzhengquede6wei'})
}
],
"x-component-props": {
size: 'large',
placeholder: '请输入验证码',
placeholder: intl.formatMessage({id: 'user.qingshuruyanzhengma'}),
smsFn: (form: ISchemaFormActions, setLoading, callback) => {
form.validate('account').then((res) => {
const state = form.getFieldState('account')
......@@ -294,7 +295,7 @@ export const forgetPwdSchema: ISchema = {
"x-component": 'PasswordInput',
"x-component-props": {
type: 'password',
placeholder: '请设置你的新密码',
placeholder: intl.formatMessage({id: 'user.qingshezhinidexinmima'}),
size: 'large'
}
},
......@@ -321,7 +322,7 @@ export const forgetPwdSchema: ISchema = {
"x-rules": [
{
required: true,
message: '请输入密码'
message: intl.formatMessage({id: 'user.qingshurumima'})
},
// {
// pattern: PATTERN_MAPS.password,
......@@ -330,7 +331,7 @@ export const forgetPwdSchema: ISchema = {
],
"x-component-props": {
type: 'password',
placeholder: '请再次输入密码',
placeholder: intl.formatMessage({id: 'user.qingzaicishurumima'}),
size: 'large',
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment