lanjianrong 3 anni fa
parent
commit
3065343dd4

+ 3 - 55
README.md

@@ -1,57 +1,5 @@
-# Ant Design Pro
+## 启动项目
 
-This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.
+`npm run dev`
 
-## Environment Prepare
-
-Install `node_modules`:
-
-```bash
-npm install
-```
-
-or
-
-```bash
-yarn
-```
-
-## Provided Scripts
-
-Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.
-
-Scripts provided in `package.json`. It's safe to modify or add additional script:
-
-### Start project
-
-```bash
-npm start
-```
-
-### Build project
-
-```bash
-npm run build
-```
-
-### Check code style
-
-```bash
-npm run lint
-```
-
-You can also use script to auto fix some lint error:
-
-```bash
-npm run lint:fix
-```
-
-### Test code
-
-```bash
-npm test
-```
-
-## More
-
-You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).
+## 端口: localhost:8090

+ 2 - 1
package.json

@@ -6,6 +6,7 @@
   "scripts": {
     "analyze": "cross-env ANALYZE=1 umi build",
     "build": "umi build",
+    "deploy:dev": "cross-env REACT_APP_ENV=dev auto-deploy build -t dev",
     "deploy:qa": "cross-env REACT_APP_ENV=dev auto-deploy build -t qa",
     "deploy:uat": "cross-env REACT_APP_ENV=dev auto-deploy build -t uat",
     "dev": "npm run start:dev",
@@ -23,7 +24,7 @@
     "precommit": "lint-staged",
     "prettier": "prettier -c --write \"src/**/*\"",
     "start": "cross-env UMI_ENV=dev umi dev",
-    "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev",
+    "start:dev": "cross-env PORT=8090 REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev",
     "start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
     "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",
     "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev umi dev",

+ 35 - 35
src/pages/Schema/Designable/antd/components/Field/shared.ts

@@ -33,37 +33,37 @@ export const createComponentSchema = (component: ISchema, decorator: ISchema) =>
       properties: {
         'x-decorator-props': decorator
       }
-    },
-    'component-style-group': {
-      type: 'void',
-      'x-component': 'CollapseItem',
-      'x-component-props': { defaultExpand: false },
-      'x-reactions': {
-        fulfill: {
-          state: {
-            visible: '{{!!$form.values["x-component"]}}'
-          }
-        }
-      },
-      properties: {
-        'x-component-props.style': AllSchemas.CSSStyle
-      }
-    },
-    'decorator-style-group': {
-      type: 'void',
-      'x-component': 'CollapseItem',
-      'x-component-props': { defaultExpand: false },
-      'x-reactions': {
-        fulfill: {
-          state: {
-            visible: '{{!!$form.values["x-decorator"]}}'
-          }
-        }
-      },
-      properties: {
-        'x-decorator-props.style': AllSchemas.CSSStyle
-      }
     }
+    // 'component-style-group': {
+    //   type: 'void',
+    //   'x-component': 'CollapseItem',
+    //   'x-component-props': { defaultExpand: false },
+    //   'x-reactions': {
+    //     fulfill: {
+    //       state: {
+    //         visible: '{{!!$form.values["x-component"]}}'
+    //       }
+    //     }
+    //   },
+    //   properties: {
+    //     'x-component-props.style': AllSchemas.CSSStyle
+    //   }
+    // },
+    // 'decorator-style-group': {
+    //   type: 'void',
+    //   'x-component': 'CollapseItem',
+    //   'x-component-props': { defaultExpand: false },
+    //   'x-reactions': {
+    //     fulfill: {
+    //       state: {
+    //         visible: '{{!!$form.values["x-decorator"]}}'
+    //       }
+    //     }
+    //   },
+    //   properties: {
+    //     'x-decorator-props.style': AllSchemas.CSSStyle
+    //   }
+    // }
   }
 }
 
@@ -78,11 +78,11 @@ export const createFieldSchema = (
         type: 'void',
         'x-component': 'CollapseItem',
         properties: {
-          name: {
-            type: 'string',
-            'x-decorator': 'FormItem',
-            'x-component': 'Input'
-          },
+          // name: {
+          //   type: 'string',
+          //   'x-decorator': 'FormItem',
+          //   'x-component': 'Input'
+          // },
           title: {
             type: 'string',
             'x-decorator': 'FormItem',

+ 2 - 2
src/pages/user/Login/index.tsx

@@ -37,7 +37,7 @@ const Login: React.FC = () => {
   const [type] = useState<string>('account')
   const { initialState, setInitialState } = useModel('@@initialState')
 
-  const { run, loading } = useRequest(queryCurrentUser, {
+  const { run: tryGetUserInfo, loading } = useRequest(queryCurrentUser, {
     manual: true,
     onSuccess: async result => {
       setInitialState({
@@ -65,7 +65,7 @@ const Login: React.FC = () => {
     onSuccess: async result => {
       window.localStorage.setItem('TOKEN_ID', result)
       message.success('登录成功')
-      await run()
+      await tryGetUserInfo()
       // await fetchUserInfo()
     },
     onError: () => {