[baozhangchao] 3 년 전
부모
커밋
325f1f0bf0
2개의 변경된 파일11개의 추가작업 그리고 15개의 파일을 삭제
  1. 10
    15
      src/pages/index/index.jsx
  2. 1
    0
      src/store/userData.js

+ 10
- 15
src/pages/index/index.jsx 파일 보기

24
   const [isDidShow, setIsDidShow] = useState(0)
24
   const [isDidShow, setIsDidShow] = useState(0)
25
 
25
 
26
   useDidShow(() => {
26
   useDidShow(() => {
27
-    if (!person?.phone) {
28
-      console.log("🚀 ~ file: index.jsx ~ line 28 ~ useDidShow ~ person?.phone", person?.phone)
29
-      Taro.navigateTo({ url: `/pages/UserLogin/index` })
30
-    } else {
31
-
32
-      setIsDidShow(isDidShow + 1)
33
-
34
-    }
35
-  }, [person?.phone])
27
+    setIsDidShow(isDidShow + 1)
28
+  })
36
 
29
 
37
   useEffect(() => {
30
   useEffect(() => {
38
     if (tab) {
31
     if (tab) {
42
 
35
 
43
 
36
 
44
   const handleTabChange = (e) => {
37
   const handleTabChange = (e) => {
45
-    if (!person?.phone) {
46
-      Taro.navigateTo({ url: `/pages/UserLogin/index` })
38
+    const { index } = e.detail
39
+    setCurrentTab(index)
40
+    // if (!person?.phone) {
41
+    //   Taro.navigateTo({ url: `/pages/UserLogin/index` })
47
 
42
 
48
-    } else {
49
-      const { index } = e.detail
50
-      setCurrentTab(index)
43
+    // } else {
44
+    //   const { index } = e.detail
45
+    //   setCurrentTab(index)
51
 
46
 
52
-    }
47
+    // }
53
 
48
 
54
   }
49
   }
55
 
50
 

+ 1
- 0
src/store/userData.js 파일 보기

20
   const logins = (params) => {
20
   const logins = (params) => {
21
     login(params).then((res) => {
21
     login(params).then((res) => {
22
       const { person: taPerson, sessionKey: skey } = res;
22
       const { person: taPerson, sessionKey: skey } = res;
23
+      // taPerson.phone = null
23
       setPerson(taPerson);
24
       setPerson(taPerson);
24
       setSessionKey(skey);
25
       setSessionKey(skey);
25
     })
26
     })