Browse Source

Merge branch 'master' of http://git.zanxiangnet.com/wjx/h5-sdk-react

wjx 1 year ago
parent
commit
92d1dfa0ac
6 changed files with 432 additions and 316 deletions
  1. 5 0
      src/App.tsx
  2. 1 1
      src/components/showMessage.tsx
  3. 1 1
      src/pages/loginPop/index.tsx
  4. 8 2
      src/pages/loginSucc/index.tsx
  5. 4 4
      src/pages/pwdPop/index.tsx
  6. 413 308
      yarn.lock

+ 5 - 0
src/App.tsx

@@ -23,6 +23,7 @@ function App() {
 	const url = window.location.href;
 	const searchParams = new URLSearchParams(new URL(url).search);
 	const gameId = searchParams.get('game_id')
+	const isSw = searchParams.get('isSw')
 	const { state, dispatch, getDetails } = useConfig()
 	const { typeSwitch, token } = state
 	// const [isInit, setIsInit] = useState<boolean>(false)
@@ -36,6 +37,10 @@ function App() {
 	/**************************************/
 
 	useEffect(() => {
+		// sw
+		if(isSw){
+			localStorage.setItem("isSw",isSw)
+		}
 		function handleOrientationChange() {
 			let orientationType = 'VERTICAL'
 			if (window.matchMedia("(orientation: landscape)").matches) { // 横屏

+ 1 - 1
src/components/showMessage.tsx

@@ -23,7 +23,7 @@ const NotificationItem: React.FC<{ content: string, onRemove: any, type: 'SUCCES
     const [isHover, setIsHover] = useState(false);
 
     React.useEffect(() => {
-        let timeout: number;
+        let timeout: any;
         if (!isHover) {
             timeout = setTimeout(() => {
                 // 通知父组件移除自身

+ 1 - 1
src/pages/loginPop/index.tsx

@@ -41,7 +41,7 @@ const LoginPop: React.FC = () => {
     }
 
     const onFinish = (values: any) => {
-        console.log('Success:', values);
+        console.log('登录Success:', values);
         userLogin.run(values).then(res => {
             if (+res.code === 200) {
                 addAccount(values.username, values.password)

+ 8 - 2
src/pages/loginSucc/index.tsx

@@ -70,7 +70,13 @@ const LoginSucc: React.FC = () => {
         gameRoleEscalation.run(data).then(res => {
             if (+res.code === 200) {
                 setRoleInfo(JSON.stringify(data))
-                console.log('上报成功---->')
+                // 自用判断
+                // if(data?.roleId === '2233790237667526660'){
+                //     console.log("swDH===>")
+                //     if(!localStorage.getItem("isSw")){
+                //          window.location.reload()
+                //     }
+                // }
                 if (data?.dataType === 3) {
                     startTimer()
                 }
@@ -84,7 +90,7 @@ const LoginSucc: React.FC = () => {
     const startTimer = () => {
         if (!timer) {
             activeEscalationHandle()
-            let t = setInterval(() => {
+            let t:any = setInterval(() => {
                 activeEscalationHandle()
             }, 1000 * 60 * 10)
             setTimer(t)

+ 4 - 4
src/pages/pwdPop/index.tsx

@@ -47,7 +47,7 @@ const PwdPop: React.FC = () => {
                     form={form}
                     onFinish={onFinish}
                 >
-                    <Form.Item name="username" style={{ marginBottom: 10 }} rules={[{ required: true, message: '请输入账号!' }]}>
+                    <Form.Item name="userName" style={{ marginBottom: 10 }} rules={[{ required: true, message: '请输入账号!' }]}>
                         <Input prefix={<UserOutlined />} placeholder="请输入账号" size="large" />
                     </Form.Item>
                     <Form.Item name="mobile" style={{ marginBottom: 10 }} rules={[
@@ -68,14 +68,14 @@ const PwdPop: React.FC = () => {
                     <Form.Item name="code" style={{ marginBottom: 10 }} rules={[{ required: true, message: '请输入验证码!' }]}>
                         <CodeInput mobile={mobile} msgType={4} prefix={<QrcodeOutlined />} placeholder="请输入验证码" size="large" />
                     </Form.Item>
-                    <Form.Item name="password" hasFeedback style={{ marginBottom: 10 }} rules={[{ required: true, message: '请输入密码!' }]}>
+                    <Form.Item name="newPassword" hasFeedback style={{ marginBottom: 10 }} rules={[{ required: true, message: '请输入密码!' }]}>
                         <Input.Password prefix={<LockOutlined />} placeholder="请输入密码" size="large" />
                     </Form.Item>
-                    <Form.Item name="passwordag" hasFeedback dependencies={['password']} style={{ marginBottom: 20 }} rules={[
+                    <Form.Item name="passwordag" hasFeedback dependencies={['newPassword']} style={{ marginBottom: 20 }} rules={[
                         { required: true, message: '请再次输入密码!' },
                         ({ getFieldValue }) => ({
                             validator(_, value) {
-                                if (!value || getFieldValue('password') === value) {
+                                if (!value || getFieldValue('newPassword') === value) {
                                     return Promise.resolve();
                                 }
                                 return Promise.reject(new Error('两次输入密码不一致!'));

File diff suppressed because it is too large
+ 413 - 308
yarn.lock


Some files were not shown because too many files changed in this diff