Yansen 1 year ago
parent
commit
9d6a5300ca
3 changed files with 8 additions and 2 deletions
  1. 2
    2
      config/dev.js
  2. 5
    0
      src/pages/login/components/Bottom.jsx
  3. 1
    0
      src/store/user.js

+ 2
- 2
config/dev.js View File

@@ -3,8 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"',
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"http://127.0.0.1:9087"',
7
-    // HOST: '""',
6
+    // HOST: '"http://127.0.0.1:9087"',
7
+    HOST: '""',
8 8
     // HOST: '"https://wmcj.huoshannews.com"',
9 9
     MAPHOST: '"/api2"',
10 10
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',

+ 5
- 0
src/pages/login/components/Bottom.jsx View File

@@ -17,6 +17,11 @@ export default (props) => {
17 17
   }
18 18
 
19 19
   const onClick = () => {
20
+    if (process.env.NODE_ENV === "development") {
21
+      signup({ openid: '123', phone: '123' }).then(props.onSuccess)
22
+      return
23
+    }
24
+
20 25
     // eslint-disable-next-line no-undef
21 26
     SmartCity.getUserInfo(function(res){
22 27
       console.log(res);

+ 1
- 0
src/store/user.js View File

@@ -69,6 +69,7 @@ export default function useUser() {
69 69
       signup(data).then(res => {
70 70
         setPerson(res.person);
71 71
         setUser(res.user);
72
+        initDuty(res.user);
72 73
         resolve(res);
73 74
       }).catch(reject);
74 75
     });