1.移动端 基于react 登录弹框
import React, {
useEffect, useState } from 'react';
import {
history } from 'umi';
import styles from '@/assets/style/LoginModal.less';
import {
Button, Modal } from 'antd-mobile';
import {
observer } from 'mobx-react';
import classNames from 'classnames';
import {
appState } from '@/store';
import {
login } from '@/api';
import {
getChannel, loginSuccess, toast } from '@/utils';
import Cookie from 'js-cookie';
import useSendCode from '@/components/hooks/useSendCode';
2.数据处理
const LoginModal = () => {
const [mobile, setMobile] = useState<string>('');
const [code, setCode] = useState<string>('');
useEffect(() => {
if (!appState.loginModalVisible) {
// setMobile('');
setCode('')