Commit e7e83c0b by zhangleyuan

feat:登录验证码长度限制

parent 4ea28862
...@@ -28,7 +28,7 @@ const CropperModal = (props: CropperModalProps) => { ...@@ -28,7 +28,7 @@ const CropperModal = (props: CropperModalProps) => {
const { title, close, save } = props; const { title, close, save } = props;
const [imgUrl, setImgUrl] = useState(props.imgUrl ? `${props.imgUrl}` : baseImg); const [imgUrl, setImgUrl] = useState(props.imgUrl ? `${props.imgUrl}` : baseImg);
const [clickStatus,setClickStatus] = useState(false);
useEffect(() => { useEffect(() => {
imgUrl && initCropper(); imgUrl && initCropper();
}, [imgUrl]); }, [imgUrl]);
...@@ -64,6 +64,13 @@ const CropperModal = (props: CropperModalProps) => { ...@@ -64,6 +64,13 @@ const CropperModal = (props: CropperModalProps) => {
function _handleSave(): any { function _handleSave(): any {
if (clickStatus) {
return;
}
setClickStatus(true);
setTimeout(() => {
setClickStatus(false);
}, 1000);
const $image = $('#image'); const $image = $('#image');
($image as any).cropper('getCroppedCanvas').toBlob((blob: any) => { ($image as any).cropper('getCroppedCanvas').toBlob((blob: any) => {
console.log("blob",blob); console.log("blob",blob);
......
...@@ -148,6 +148,7 @@ function Login(props) { ...@@ -148,6 +148,7 @@ function Login(props) {
placeholder="验证码" placeholder="验证码"
autoComplete="off" autoComplete="off"
value={phoneverify} value={phoneverify}
maxLength={4}
onChange={(e) => { setPhoneverify(e.target.value) }} onChange={(e) => { setPhoneverify(e.target.value) }}
/> />
<Popover <Popover
......
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