3 Commits 355612bb96 ... f7afd73b3b

Autore SHA1 Messaggio Data
  jiangmaniu f7afd73b3b feat: update api methods 4 mesi fa
  jiangmaniu fdc7fa385f fix: columns error 4 mesi fa
  jiangmaniu c3bb9c0578 fix: some bugs 4 mesi fa
48 ha cambiato i file con 15225 aggiunte e 14002 eliminazioni
  1. 34 10
      config/config.ts
  2. 0 593
      config/oneapi.json
  3. 1 1
      config/proxy.ts
  4. 0 1
      config/routes.ts
  5. 5 0
      config/util.ts
  6. 0 176
      mock/listTableList.ts
  7. 0 31
      mock/login.ts
  8. 0 115
      mock/notices.ts
  9. 0 324
      mock/requestRecord.mock.js
  10. 0 5
      mock/route.ts
  11. 0 203
      mock/user.ts
  12. 2 0
      package.json
  13. 14003 11192
      pnpm-lock.yaml
  14. 1 3
      src/access.ts
  15. 36 22
      src/app.tsx
  16. 2 2
      src/components/RightContent/AvatarDropdown.tsx
  17. 0 3
      src/pages/Content/HeadLines.tsx
  18. 34 71
      src/pages/Settings/Menu.tsx
  19. 73 80
      src/pages/Settings/Role.tsx
  20. 22 61
      src/pages/Settings/Settings.tsx
  21. 51 95
      src/pages/Settings/Staff.tsx
  22. 17 46
      src/pages/Settings/Users.tsx
  23. 2 2
      src/pages/TableList/components/UpdateForm.tsx
  24. 9 9
      src/pages/TableList/index.tsx
  25. 6 6
      src/pages/User/Login/index.tsx
  26. 0 27
      src/pages/User/Login/service.ts
  27. 0 94
      src/services/ant-design-pro/api.ts
  28. 0 10
      src/services/ant-design-pro/index.ts
  29. 0 21
      src/services/ant-design-pro/login.ts
  30. 0 101
      src/services/ant-design-pro/typings.d.ts
  31. 41 0
      src/services/swagger/clientsAuth.ts
  32. 16 6
      src/services/swagger/index.ts
  33. 63 0
      src/services/swagger/menuAdmin.ts
  34. 0 153
      src/services/swagger/pet.ts
  35. 71 0
      src/services/swagger/roleAdmin.ts
  36. 86 0
      src/services/swagger/staffAdmin.ts
  37. 0 48
      src/services/swagger/store.ts
  38. 347 67
      src/services/swagger/typings.d.ts
  39. 0 100
      src/services/swagger/user.ts
  40. 48 0
      src/services/swagger/userAdmin.ts
  41. 45 0
      src/services/swagger/userConfigClients.ts
  42. 27 0
      src/services/swagger/yonghuqiandaokehuduanApi.ts
  43. 87 0
      src/services/swagger/zidianpeizhiguanlihoutaiApi.ts
  44. 85 0
      src/utils/tree.ts
  45. 5 0
      src/utils/util.ts
  46. 0 324
      types/cache/mock/login.mock.cache.js
  47. 0 0
      types/cache/mock/mock.cache.js
  48. 6 0
      types/index.d.ts

+ 34 - 10
config/config.ts

@@ -1,9 +1,10 @@
 // https://umijs.org/config/
 import { defineConfig } from '@umijs/max';
-import { join } from 'path';
 import defaultSettings from './defaultSettings';
 import proxy from './proxy';
 import routes from './routes';
+import { toHump } from './util';
+
 
 const { REACT_APP_ENV = 'dev' } = process.env;
 
@@ -150,17 +151,40 @@ export default defineConfig({
    * @doc https://pro.ant.design/zh-cn/docs/openapi/
    */
   openAPI: [
+    // {
+    //   requestLibPath: "import { request } from '@umijs/max'",
+    //   // 或者使用在线的版本
+    //   // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
+    //   schemaPath: join(__dirname, 'oneapi.json'),
+    //   mock: false,
+    // },
+    // {
+    //   requestLibPath: "import { request } from '@umijs/max'",
+    //   schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json',
+
     {
-      requestLibPath: "import { request } from '@umijs/max'",
-      // 或者使用在线的版本
-      // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
-      schemaPath: join(__dirname, 'oneapi.json'),
-      mock: false,
-    },
-    {
-      requestLibPath: "import { request } from '@umijs/max'",
-      schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
+      requestLibPath: "import { invoke as request } from '@/core/network'",
+      schemaPath: 'https://sect.nosum.cn/v3/api-docs',
+      namespace: 'SectApi',
       projectName: 'swagger',
+      hook: {
+        customFunctionName: (...arg: any[]) => {
+          const [data] = arg
+
+          const names = data.path.replace(/\/apis\/clients/g, '').replace(/\/apis\/admin/g, '').split('/')
+          const rawName = names.reduce((acc: string, name: string) => {
+            if(!name || ['apis', 'admin', 'clients'].includes(name)) return acc
+            return acc + '_' +name
+          }, data.method) + 'Api'
+
+          const name = toHump(rawName)
+
+          return name
+        },
+        // customClassName: (...arg) => {
+        //   console.log('sect customClassName:', ...arg)
+        // }
+      }
     },
   ],
   mfsu: {

+ 0 - 593
config/oneapi.json

@@ -1,593 +0,0 @@
-{
-  "openapi": "3.0.1",
-  "info": {
-    "title": "Ant Design Pro",
-    "version": "1.0.0"
-  },
-  "servers": [
-    {
-      "url": "http://localhost:8000/"
-    },
-    {
-      "url": "https://localhost:8000/"
-    }
-  ],
-  "paths": {
-    "/api/currentUser": {
-      "get": {
-        "tags": ["api"],
-        "description": "获取当前的用户",
-        "operationId": "currentUser",
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/CurrentUser"
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/ErrorResponse"
-                }
-              }
-            }
-          }
-        }
-      },
-      "x-swagger-router-controller": "api"
-    },
-    "/api/login/captcha": {
-      "post": {
-        "description": "发送验证码",
-        "operationId": "getFakeCaptcha",
-        "tags": ["login"],
-        "parameters": [
-          {
-            "name": "phone",
-            "in": "query",
-            "description": "手机号",
-            "schema": {
-              "type": "string"
-            }
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/FakeCaptcha"
-                }
-              }
-            }
-          }
-        }
-      }
-    },
-    "/api/login/outLogin": {
-      "post": {
-        "description": "登录接口",
-        "operationId": "outLogin",
-        "tags": ["login"],
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "type": "object"
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/ErrorResponse"
-                }
-              }
-            }
-          }
-        }
-      },
-      "x-swagger-router-controller": "api"
-    },
-    "/api/login/account": {
-      "post": {
-        "tags": ["login"],
-        "description": "登录接口",
-        "operationId": "login",
-        "requestBody": {
-          "description": "登录系统",
-          "content": {
-            "application/json": {
-              "schema": {
-                "$ref": "#/components/schemas/LoginParams"
-              }
-            }
-          },
-          "required": true
-        },
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/LoginResult"
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/ErrorResponse"
-                }
-              }
-            }
-          }
-        },
-        "x-codegen-request-body-name": "body"
-      },
-      "x-swagger-router-controller": "api"
-    },
-    "/api/notices": {
-      "summary": "getNotices",
-      "description": "NoticeIconItem",
-      "get": {
-        "tags": ["api"],
-        "operationId": "getNotices",
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/NoticeIconList"
-                }
-              }
-            }
-          }
-        }
-      }
-    },
-    "/api/rule": {
-      "get": {
-        "tags": ["rule"],
-        "description": "获取规则列表",
-        "operationId": "rule",
-        "parameters": [
-          {
-            "name": "current",
-            "in": "query",
-            "description": "当前的页码",
-            "schema": {
-              "type": "number"
-            }
-          },
-          {
-            "name": "pageSize",
-            "in": "query",
-            "description": "页面的容量",
-            "schema": {
-              "type": "number"
-            }
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/RuleList"
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/ErrorResponse"
-                }
-              }
-            }
-          }
-        }
-      },
-      "post": {
-        "tags": ["rule"],
-        "description": "新建规则",
-        "operationId": "addRule",
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/RuleListItem"
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/ErrorResponse"
-                }
-              }
-            }
-          }
-        }
-      },
-      "put": {
-        "tags": ["rule"],
-        "description": "新建规则",
-        "operationId": "updateRule",
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/RuleListItem"
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/ErrorResponse"
-                }
-              }
-            }
-          }
-        }
-      },
-      "delete": {
-        "tags": ["rule"],
-        "description": "删除规则",
-        "operationId": "removeRule",
-        "responses": {
-          "200": {
-            "description": "Success",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "type": "object"
-                }
-              }
-            }
-          },
-          "401": {
-            "description": "Error",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/ErrorResponse"
-                }
-              }
-            }
-          }
-        }
-      },
-      "x-swagger-router-controller": "api"
-    },
-    "/swagger": {
-      "x-swagger-pipe": "swagger_raw"
-    }
-  },
-  "components": {
-    "schemas": {
-      "CurrentUser": {
-        "type": "object",
-        "properties": {
-          "name": {
-            "type": "string"
-          },
-          "avatar": {
-            "type": "string"
-          },
-          "userid": {
-            "type": "string"
-          },
-          "email": {
-            "type": "string"
-          },
-          "signature": {
-            "type": "string"
-          },
-          "title": {
-            "type": "string"
-          },
-          "group": {
-            "type": "string"
-          },
-          "tags": {
-            "type": "array",
-            "items": {
-              "type": "object",
-              "properties": {
-                "key": {
-                  "type": "string"
-                },
-                "label": {
-                  "type": "string"
-                }
-              }
-            }
-          },
-          "notifyCount": {
-            "type": "integer",
-            "format": "int32"
-          },
-          "unreadCount": {
-            "type": "integer",
-            "format": "int32"
-          },
-          "country": {
-            "type": "string"
-          },
-          "access": {
-            "type": "string"
-          },
-          "geographic": {
-            "type": "object",
-            "properties": {
-              "province": {
-                "type": "object",
-                "properties": {
-                  "label": {
-                    "type": "string"
-                  },
-                  "key": {
-                    "type": "string"
-                  }
-                }
-              },
-              "city": {
-                "type": "object",
-                "properties": {
-                  "label": {
-                    "type": "string"
-                  },
-                  "key": {
-                    "type": "string"
-                  }
-                }
-              }
-            }
-          },
-          "address": {
-            "type": "string"
-          },
-          "phone": {
-            "type": "string"
-          }
-        }
-      },
-      "LoginResult": {
-        "type": "object",
-        "properties": {
-          "status": {
-            "type": "string"
-          },
-          "type": {
-            "type": "string"
-          },
-          "currentAuthority": {
-            "type": "string"
-          }
-        }
-      },
-      "PageParams": {
-        "type": "object",
-        "properties": {
-          "current": {
-            "type": "number"
-          },
-          "pageSize": {
-            "type": "number"
-          }
-        }
-      },
-      "RuleListItem": {
-        "type": "object",
-        "properties": {
-          "key": {
-            "type": "integer",
-            "format": "int32"
-          },
-          "disabled": {
-            "type": "boolean"
-          },
-          "href": {
-            "type": "string"
-          },
-          "avatar": {
-            "type": "string"
-          },
-          "name": {
-            "type": "string"
-          },
-          "owner": {
-            "type": "string"
-          },
-          "desc": {
-            "type": "string"
-          },
-          "callNo": {
-            "type": "integer",
-            "format": "int32"
-          },
-          "status": {
-            "type": "integer",
-            "format": "int32"
-          },
-          "updatedAt": {
-            "type": "string",
-            "format": "datetime"
-          },
-          "createdAt": {
-            "type": "string",
-            "format": "datetime"
-          },
-          "progress": {
-            "type": "integer",
-            "format": "int32"
-          }
-        }
-      },
-      "RuleList": {
-        "type": "object",
-        "properties": {
-          "data": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/RuleListItem"
-            }
-          },
-          "total": {
-            "type": "integer",
-            "description": "列表的内容总数",
-            "format": "int32"
-          },
-          "success": {
-            "type": "boolean"
-          }
-        }
-      },
-      "FakeCaptcha": {
-        "type": "object",
-        "properties": {
-          "code": {
-            "type": "integer",
-            "format": "int32"
-          },
-          "status": {
-            "type": "string"
-          }
-        }
-      },
-      "LoginParams": {
-        "type": "object",
-        "properties": {
-          "username": {
-            "type": "string"
-          },
-          "password": {
-            "type": "string"
-          },
-          "autoLogin": {
-            "type": "boolean"
-          },
-          "type": {
-            "type": "string"
-          }
-        }
-      },
-      "ErrorResponse": {
-        "required": ["errorCode"],
-        "type": "object",
-        "properties": {
-          "errorCode": {
-            "type": "string",
-            "description": "业务约定的错误码"
-          },
-          "errorMessage": {
-            "type": "string",
-            "description": "业务上的错误信息"
-          },
-          "success": {
-            "type": "boolean",
-            "description": "业务上的请求是否成功"
-          }
-        }
-      },
-      "NoticeIconList": {
-        "type": "object",
-        "properties": {
-          "data": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/NoticeIconItem"
-            }
-          },
-          "total": {
-            "type": "integer",
-            "description": "列表的内容总数",
-            "format": "int32"
-          },
-          "success": {
-            "type": "boolean"
-          }
-        }
-      },
-      "NoticeIconItemType": {
-        "title": "NoticeIconItemType",
-        "description": "已读未读列表的枚举",
-        "type": "string",
-        "properties": {},
-        "enum": ["notification", "message", "event"]
-      },
-      "NoticeIconItem": {
-        "type": "object",
-        "properties": {
-          "id": {
-            "type": "string"
-          },
-          "extra": {
-            "type": "string",
-            "format": "any"
-          },
-          "key": { "type": "string" },
-          "read": {
-            "type": "boolean"
-          },
-          "avatar": {
-            "type": "string"
-          },
-          "title": {
-            "type": "string"
-          },
-          "status": {
-            "type": "string"
-          },
-          "datetime": {
-            "type": "string",
-            "format": "date"
-          },
-          "description": {
-            "type": "string"
-          },
-          "type": {
-            "extensions": {
-              "x-is-enum": true
-            },
-            "$ref": "#/components/schemas/NoticeIconItemType"
-          }
-        }
-      }
-    }
-  }
-}

+ 1 - 1
config/proxy.ts

@@ -5,7 +5,7 @@
 export default {
   dev: {
     '/apis/': {
-      target: 'http://127.0.0.1:8010',
+      target: 'https://sect.nosum.cn',
       changeOrigin: true,
     },
   },

+ 0 - 1
config/routes.ts

@@ -48,7 +48,6 @@ export default [
     path: '/settings',
     name: 'settings',
     icon: 'crown',
-    //  access: 'canAdmin',
     routes: [
       {
         path: '/settings',

+ 5 - 0
config/util.ts

@@ -0,0 +1,5 @@
+export function toHump(name: string) {
+  return name.replace(/_(\w)/g, function(_, letter){
+      return letter.toUpperCase();
+  });
+}

+ 0 - 176
mock/listTableList.ts

@@ -1,176 +0,0 @@
-import { Request, Response } from 'express';
-import moment from 'moment';
-import { parse } from 'url';
-
-// mock tableListDataSource
-const genList = (current: number, pageSize: number) => {
-  const tableListDataSource: API.RuleListItem[] = [];
-
-  for (let i = 0; i < pageSize; i += 1) {
-    const index = (current - 1) * 10 + i;
-    tableListDataSource.push({
-      key: index,
-      disabled: i % 6 === 0,
-      href: 'https://ant.design',
-      avatar: [
-        'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-      ][i % 2],
-      name: `TradeCode ${index}`,
-      owner: '曲丽丽',
-      desc: '这是一段描述',
-      callNo: Math.floor(Math.random() * 1000),
-      status: Math.floor(Math.random() * 10) % 4,
-      updatedAt: moment().format('YYYY-MM-DD'),
-      createdAt: moment().format('YYYY-MM-DD'),
-      progress: Math.ceil(Math.random() * 100),
-    });
-  }
-  tableListDataSource.reverse();
-  return tableListDataSource;
-};
-
-let tableListDataSource = genList(1, 100);
-
-function getRule(req: Request, res: Response, u: string) {
-  let realUrl = u;
-  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
-    realUrl = req.url;
-  }
-  const { current = 1, pageSize = 10 } = req.query;
-  const params = parse(realUrl, true).query as unknown as API.PageParams &
-    API.RuleListItem & {
-      sorter: any;
-      filter: any;
-    };
-
-  let dataSource = [...tableListDataSource].slice(
-    ((current as number) - 1) * (pageSize as number),
-    (current as number) * (pageSize as number),
-  );
-  if (params.sorter) {
-    const sorter = JSON.parse(params.sorter);
-    dataSource = dataSource.sort((prev, next) => {
-      let sortNumber = 0;
-      (Object.keys(sorter) as Array<keyof API.RuleListItem>).forEach((key) => {
-        let nextSort = next?.[key] as number;
-        let preSort = prev?.[key] as number;
-        if (sorter[key] === 'descend') {
-          if (preSort - nextSort > 0) {
-            sortNumber += -1;
-          } else {
-            sortNumber += 1;
-          }
-          return;
-        }
-        if (preSort - nextSort > 0) {
-          sortNumber += 1;
-        } else {
-          sortNumber += -1;
-        }
-      });
-      return sortNumber;
-    });
-  }
-  if (params.filter) {
-    const filter = JSON.parse(params.filter as any) as {
-      [key: string]: string[];
-    };
-    if (Object.keys(filter).length > 0) {
-      dataSource = dataSource.filter((item) => {
-        return (Object.keys(filter) as Array<keyof API.RuleListItem>).some((key) => {
-          if (!filter[key]) {
-            return true;
-          }
-          if (filter[key].includes(`${item[key]}`)) {
-            return true;
-          }
-          return false;
-        });
-      });
-    }
-  }
-
-  if (params.name) {
-    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
-  }
-  const result = {
-    data: dataSource,
-    total: tableListDataSource.length,
-    success: true,
-    pageSize,
-    current: parseInt(`${params.current}`, 10) || 1,
-  };
-
-  return res.json(result);
-}
-
-function postRule(req: Request, res: Response, u: string, b: Request) {
-  let realUrl = u;
-  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
-    realUrl = req.url;
-  }
-
-  const body = (b && b.body) || req.body;
-  const { method, name, desc, key } = body;
-
-  switch (method) {
-    /* eslint no-case-declarations:0 */
-    case 'delete':
-      tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1);
-      break;
-    case 'post':
-      (() => {
-        const i = Math.ceil(Math.random() * 10000);
-        const newRule: API.RuleListItem = {
-          key: tableListDataSource.length,
-          href: 'https://ant.design',
-          avatar: [
-            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-          ][i % 2],
-          name,
-          owner: '曲丽丽',
-          desc,
-          callNo: Math.floor(Math.random() * 1000),
-          status: Math.floor(Math.random() * 10) % 2,
-          updatedAt: moment().format('YYYY-MM-DD'),
-          createdAt: moment().format('YYYY-MM-DD'),
-          progress: Math.ceil(Math.random() * 100),
-        };
-        tableListDataSource.unshift(newRule);
-        return res.json(newRule);
-      })();
-      return;
-
-    case 'update':
-      (() => {
-        let newRule = {};
-        tableListDataSource = tableListDataSource.map((item) => {
-          if (item.key === key) {
-            newRule = { ...item, desc, name };
-            return { ...item, desc, name };
-          }
-          return item;
-        });
-        return res.json(newRule);
-      })();
-      return;
-    default:
-      break;
-  }
-
-  const result = {
-    list: tableListDataSource,
-    pagination: {
-      total: tableListDataSource.length,
-    },
-  };
-
-  res.json(result);
-}
-
-export default {
-  'GET /api/rule': getRule,
-  'POST /api/rule': postRule,
-};

+ 0 - 31
mock/login.ts

@@ -1,31 +0,0 @@
-import { defineMock } from 'umi';
-
-export default defineMock({
-  'POST /apis/admin/staff/login': (req, res) => {
-    res.status(200).send({
-      code: 0,
-      msg: 'OK',
-      data: {
-        token: '',
-      },
-    });
-
-    return;
-  },
-  'GET /apis/admin/image/token': (req, res) => {
-    res.status(200).send({
-      code: 0,
-      msg: 'OK',
-      data: {
-        accessId: 'LTAI5tM57HQzYUmZEBTTgvua',
-        policy:
-          'eyJleHBpcmF0aW9uIjoiMjAyNC0wNi0wM1QwMjowNToyNy42OTBaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCIiXV19',
-        signature: '8LDgLM5ZkWW9IlcQn69W40E2XIU=',
-        dir: '',
-        host: 'https://oss-cn-shenzhen.aliyuncs.com',
-        expire: 1717380327,
-        callbackUrl: 'https://dev.century-info.com/apis/admin/oss/callback',
-      },
-    });
-  },
-});

+ 0 - 115
mock/notices.ts

@@ -1,115 +0,0 @@
-import { Request, Response } from 'express';
-
-const getNotices = (req: Request, res: Response) => {
-  res.json({
-    data: [
-      {
-        id: '000000001',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/MSbDR4FR2MUAAAAAAAAAAAAAFl94AQBr',
-        title: '你收到了 14 份新周报',
-        datetime: '2017-08-09',
-        type: 'notification',
-      },
-      {
-        id: '000000002',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/hX-PTavYIq4AAAAAAAAAAAAAFl94AQBr',
-        title: '你推荐的 曲妮妮 已通过第三轮面试',
-        datetime: '2017-08-08',
-        type: 'notification',
-      },
-      {
-        id: '000000003',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/jHX5R5l3QjQAAAAAAAAAAAAAFl94AQBr',
-        title: '这种模板可以区分多种通知类型',
-        datetime: '2017-08-07',
-        read: true,
-        type: 'notification',
-      },
-      {
-        id: '000000004',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Wr4mQqx6jfwAAAAAAAAAAAAAFl94AQBr',
-        title: '左侧图标用于区分不同的类型',
-        datetime: '2017-08-07',
-        type: 'notification',
-      },
-      {
-        id: '000000005',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Mzj_TbcWUj4AAAAAAAAAAAAAFl94AQBr',
-        title: '内容不要超过两行字,超出时自动截断',
-        datetime: '2017-08-07',
-        type: 'notification',
-      },
-      {
-        id: '000000006',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/eXLzRbPqQE4AAAAAAAAAAAAAFl94AQBr',
-        title: '曲丽丽 评论了你',
-        description: '描述信息描述信息描述信息',
-        datetime: '2017-08-07',
-        type: 'message',
-        clickClose: true,
-      },
-      {
-        id: '000000007',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/w5mRQY2AmEEAAAAAAAAAAAAAFl94AQBr',
-        title: '朱偏右 回复了你',
-        description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
-        datetime: '2017-08-07',
-        type: 'message',
-        clickClose: true,
-      },
-      {
-        id: '000000008',
-        avatar:
-          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/wPadR5M9918AAAAAAAAAAAAAFl94AQBr',
-        title: '标题',
-        description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
-        datetime: '2017-08-07',
-        type: 'message',
-        clickClose: true,
-      },
-      {
-        id: '000000009',
-        title: '任务名称',
-        description: '任务需要在 2017-01-12 20:00 前启动',
-        extra: '未开始',
-        status: 'todo',
-        type: 'event',
-      },
-      {
-        id: '000000010',
-        title: '第三方紧急代码变更',
-        description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
-        extra: '马上到期',
-        status: 'urgent',
-        type: 'event',
-      },
-      {
-        id: '000000011',
-        title: '信息安全考试',
-        description: '指派竹尔于 2017-01-09 前完成更新并发布',
-        extra: '已耗时 8 天',
-        status: 'doing',
-        type: 'event',
-      },
-      {
-        id: '000000012',
-        title: 'ABCD 版本发布',
-        description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
-        extra: '进行中',
-        status: 'processing',
-        type: 'event',
-      },
-    ],
-  });
-};
-
-export default {
-  'GET /api/notices': getNotices,
-};

+ 0 - 324
mock/requestRecord.mock.js

@@ -1,324 +0,0 @@
-module.exports = {
-  'GET /api/currentUser': {
-    data: {
-      name: 'Serati Ma',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
-      userid: '00000001',
-      email: 'antdesign@alipay.com',
-      signature: '海纳百川,有容乃大',
-      title: '交互专家',
-      group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
-      tags: [
-        { key: '0', label: '很有想法的' },
-        { key: '1', label: '专注设计' },
-        { key: '2', label: '辣~' },
-        { key: '3', label: '大长腿' },
-        { key: '4', label: '川妹子' },
-        { key: '5', label: '海纳百川' },
-      ],
-      notifyCount: 12,
-      unreadCount: 11,
-      country: 'China',
-      geographic: {
-        province: { label: '浙江省', key: '330000' },
-        city: { label: '杭州市', key: '330100' },
-      },
-      address: '西湖区工专路 77 号',
-      phone: '0752-268888888',
-    },
-  },
-  'GET /api/rule': {
-    data: [
-      {
-        key: 99,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 99',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 503,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 81,
-      },
-      {
-        key: 98,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 98',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 164,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 12,
-      },
-      {
-        key: 97,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 97',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 174,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 81,
-      },
-      {
-        key: 96,
-        disabled: true,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 96',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 914,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 7,
-      },
-      {
-        key: 95,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 95',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 698,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 82,
-      },
-      {
-        key: 94,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 94',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 488,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 14,
-      },
-      {
-        key: 93,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 93',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 580,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 77,
-      },
-      {
-        key: 92,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 92',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 244,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 58,
-      },
-      {
-        key: 91,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 91',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 959,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 66,
-      },
-      {
-        key: 90,
-        disabled: true,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 90',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 958,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 72,
-      },
-      {
-        key: 89,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 89',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 301,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 2,
-      },
-      {
-        key: 88,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 88',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 277,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 12,
-      },
-      {
-        key: 87,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 87',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 810,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 82,
-      },
-      {
-        key: 86,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 86',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 780,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 22,
-      },
-      {
-        key: 85,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 85',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 705,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 12,
-      },
-      {
-        key: 84,
-        disabled: true,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 84',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 203,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 79,
-      },
-      {
-        key: 83,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 83',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 491,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 59,
-      },
-      {
-        key: 82,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 82',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 73,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 100,
-      },
-      {
-        key: 81,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 81',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 406,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 61,
-      },
-      {
-        key: 80,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 80',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 112,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 20,
-      },
-    ],
-    total: 100,
-    success: true,
-    pageSize: 20,
-    current: 1,
-  },
-  'POST /api/login/outLogin': { data: {}, success: true },
-  'POST /api/login/account': {
-    status: 'ok',
-    type: 'account',
-    currentAuthority: 'admin',
-  },
-};

+ 0 - 5
mock/route.ts

@@ -1,5 +0,0 @@
-export default {
-  '/api/auth_routes': {
-    '/form/advanced-form': { authority: ['admin', 'user'] },
-  },
-};

+ 0 - 203
mock/user.ts

@@ -1,203 +0,0 @@
-import { Request, Response } from 'express';
-
-const waitTime = (time: number = 100) => {
-  return new Promise((resolve) => {
-    setTimeout(() => {
-      resolve(true);
-    }, time);
-  });
-};
-
-async function getFakeCaptcha(req: Request, res: Response) {
-  await waitTime(2000);
-  return res.json('captcha-xxx');
-}
-
-const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env;
-
-/**
- * 当前用户的权限,如果为空代表没登录
- * current user access, if is '', user need login
- * 如果是 pro 的预览,默认是有权限的
- */
-let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : '';
-
-const getAccess = () => {
-  return access;
-};
-
-// 代码中会兼容本地 service mock 以及部署站点的静态数据
-export default {
-  // 支持值为 Object 和 Array
-  'GET /api/currentUser': (req: Request, res: Response) => {
-    if (!getAccess()) {
-      res.status(401).send({
-        data: {
-          isLogin: false,
-        },
-        errorCode: '401',
-        errorMessage: '请先登录!',
-        success: true,
-      });
-      return;
-    }
-    res.send({
-      success: true,
-      data: {
-        name: 'Serati Ma',
-        avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
-        userid: '00000001',
-        email: 'antdesign@alipay.com',
-        signature: '海纳百川,有容乃大',
-        title: '交互专家',
-        group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
-        tags: [
-          {
-            key: '0',
-            label: '很有想法的',
-          },
-          {
-            key: '1',
-            label: '专注设计',
-          },
-          {
-            key: '2',
-            label: '辣~',
-          },
-          {
-            key: '3',
-            label: '大长腿',
-          },
-          {
-            key: '4',
-            label: '川妹子',
-          },
-          {
-            key: '5',
-            label: '海纳百川',
-          },
-        ],
-        notifyCount: 12,
-        unreadCount: 11,
-        country: 'China',
-        access: getAccess(),
-        geographic: {
-          province: {
-            label: '浙江省',
-            key: '330000',
-          },
-          city: {
-            label: '杭州市',
-            key: '330100',
-          },
-        },
-        address: '西湖区工专路 77 号',
-        phone: '0752-268888888',
-      },
-    });
-  },
-  // GET POST 可省略
-  'GET /api/users': [
-    {
-      key: '1',
-      name: 'John Brown',
-      age: 32,
-      address: 'New York No. 1 Lake Park',
-    },
-    {
-      key: '2',
-      name: 'Jim Green',
-      age: 42,
-      address: 'London No. 1 Lake Park',
-    },
-    {
-      key: '3',
-      name: 'Joe Black',
-      age: 32,
-      address: 'Sidney No. 1 Lake Park',
-    },
-  ],
-  'POST /api/login/account': async (req: Request, res: Response) => {
-    const { password, username, type } = req.body;
-    await waitTime(2000);
-    if (password === 'ant.design' && username === 'admin') {
-      res.send({
-        status: 'ok',
-        type,
-        currentAuthority: 'admin',
-      });
-      access = 'admin';
-      return;
-    }
-    if (password === 'ant.design' && username === 'user') {
-      res.send({
-        status: 'ok',
-        type,
-        currentAuthority: 'user',
-      });
-      access = 'user';
-      return;
-    }
-    if (type === 'mobile') {
-      res.send({
-        status: 'ok',
-        type,
-        currentAuthority: 'admin',
-      });
-      access = 'admin';
-      return;
-    }
-
-    res.send({
-      status: 'error',
-      type,
-      currentAuthority: 'guest',
-    });
-    access = 'guest';
-  },
-  'POST /api/login/outLogin': (req: Request, res: Response) => {
-    access = '';
-    res.send({ data: {}, success: true });
-  },
-  'POST /api/register': (req: Request, res: Response) => {
-    res.send({ status: 'ok', currentAuthority: 'user', success: true });
-  },
-  'GET /api/500': (req: Request, res: Response) => {
-    res.status(500).send({
-      timestamp: 1513932555104,
-      status: 500,
-      error: 'error',
-      message: 'error',
-      path: '/base/category/list',
-    });
-  },
-  'GET /api/404': (req: Request, res: Response) => {
-    res.status(404).send({
-      timestamp: 1513932643431,
-      status: 404,
-      error: 'Not Found',
-      message: 'No message available',
-      path: '/base/category/list/2121212',
-    });
-  },
-  'GET /api/403': (req: Request, res: Response) => {
-    res.status(403).send({
-      timestamp: 1513932555104,
-      status: 403,
-      error: 'Forbidden',
-      message: 'Forbidden',
-      path: '/base/category/list',
-    });
-  },
-  'GET /api/401': (req: Request, res: Response) => {
-    res.status(401).send({
-      timestamp: 1513932555104,
-      status: 401,
-      error: 'Unauthorized',
-      message: 'Unauthorized',
-      path: '/base/category/list',
-    });
-  },
-
-  'GET  /api/login/captcha': getFakeCaptcha,
-};

+ 2 - 0
package.json

@@ -52,9 +52,11 @@
     "@umijs/route-utils": "^2.2.2",
     "ali-oss": "^6.20.0",
     "antd": "^5.13.2",
+    "antd-mobile-icons": "^0.3.0",
     "antd-style": "^3.6.1",
     "axios": "^1.7.2",
     "classnames": "^2.5.1",
+    "dayjs": "^1.11.11",
     "lodash": "^4.17.21",
     "moment": "^2.30.1",
     "omit.js": "^2.0.2",

File diff suppressed because it is too large
+ 14003 - 11192
pnpm-lock.yaml


+ 1 - 3
src/access.ts

@@ -1,9 +1,7 @@
 /**
  * @see https://umijs.org/docs/max/access#access
  * */
-export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
-  const { currentUser } = initialState ?? {};
+export default function access() {
   return {
-    canAdmin: currentUser && currentUser.access === 'admin',
   };
 }

+ 36 - 22
src/app.tsx

@@ -4,11 +4,11 @@ import type { Settings as LayoutSettings } from '@ant-design/pro-components';
 import { SettingDrawer } from '@ant-design/pro-components';
 import { history, Link, RequestConfig, RunTimeLayoutConfig } from '@umijs/max';
 import defaultSettings from '../config/defaultSettings';
-import React from 'react';
 import { AxiosResponse } from 'axios';
-import { Service } from '@/pages/User/Login/service';
 import { message } from 'antd';
 import { Response } from '@/core/network';
+import { treeFormatBySymmetry } from './utils/tree';
+import { getStaffMeApi } from './services/swagger/staffAdmin';
 
 const isDev = process.env.NODE_ENV === 'development';
 const loginPath = '/user/login';
@@ -18,33 +18,23 @@ const loginPath = '/user/login';
  * */
 export async function getInitialState(): Promise<{
   settings?: Partial<LayoutSettings>;
-  currentUser?: API.CurrentUser;
+  currentUser?: SectApi.StaffVO;
   loading?: boolean;
-  fetchUserInfo?: () => Promise<API.CurrentUser | undefined>;
+  fetchUserInfo?: (...arg: any[]) => Promise<SectApi.StaffVO | undefined>;
 }> {
   const fetchUserInfo = async () => {
     try {
-      const msg = await Service.me();
+      const rs = await getStaffMeApi({
+        skipErrorHandler: true
+      });
 
-      if (!msg.success) {
-        message.warning(msg.errorMessage);
+      if (!rs.success) {
+        message.warning(rs.errorMessage);
         history.push(loginPath);
         return undefined;
       }
 
-      /**
-       * name: 'Serati Ma',
-       *         avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
-       *         userid: '00000001',
-       *         email: 'antdesign@alipay.com',
-       *         signature: '海纳百川,有容乃大',
-       *         title: '交互专家',
-       */
-      return {
-        name: msg.data.nickname,
-        avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
-        userid: msg.data.id,
-      };
+      return rs.data
     } catch (error) {
       history.push(loginPath);
     }
@@ -71,12 +61,34 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
   return {
     actionsRender: () => [<Question key="doc" />, <SelectLang key="SelectLang" />],
     avatarProps: {
-      src: initialState?.currentUser?.avatar,
+      src: initialState?.currentUser?.thumbAvatar,
       title: <AvatarName />,
       render: (_, avatarChildren) => {
         return <AvatarDropdown>{avatarChildren}</AvatarDropdown>;
       },
     },
+        menu: {
+      params:{
+      },
+      request: async (params, defaultMenuData) => {
+        const authMenus = initialState?.currentUser?.menus ?? []
+
+
+        const routes = treeFormatBySymmetry(defaultMenuData,authMenus, (treeNode, referTreeNode) => {
+          const treeNodePath = treeNode.path?.toLocaleLowerCase()
+          const referTreeNodePath = (referTreeNode?.url || '').toLocaleLowerCase()
+          const isHasAuth = treeNodePath && referTreeNodePath &&  treeNodePath === referTreeNodePath
+
+          if(isHasAuth) {
+            return {
+              ...treeNode,
+            }
+          }
+        } )
+
+        return  routes
+      },
+    },
     // waterMarkProps: {
     //   content: initialState?.currentUser?.name,
     // },
@@ -154,6 +166,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
  */
 export const request: RequestConfig = {
   errorConfig: {},
+
   requestInterceptors: [
     (url, options) => {
       const token = localStorage.getItem('token');
@@ -171,7 +184,8 @@ export const request: RequestConfig = {
     },
   ],
   responseInterceptors: [
-    <T,>(response: AxiosResponse<Response<T>>) => {
+    // @ts-ignore
+    <T extends any>(response: AxiosResponse<Response<T>>) => {
       console.log('response', response);
 
       console.log('res', response.status);

+ 2 - 2
src/components/RightContent/AvatarDropdown.tsx

@@ -16,7 +16,7 @@ export type GlobalHeaderRightProps = {
 export const AvatarName = () => {
   const { initialState } = useModel('@@initialState');
   const { currentUser } = initialState || {};
-  return <span className="anticon">{currentUser?.name}</span>;
+  return <span className="anticon">{currentUser?.nickname}</span>;
 };
 
 const useStyles = createStyles(({ token }) => {
@@ -94,7 +94,7 @@ export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu, childre
 
   const { currentUser } = initialState;
 
-  if (!currentUser || !currentUser.name) {
+  if (!currentUser?.username) {
     return loading;
   }
 

+ 0 - 3
src/pages/Content/HeadLines.tsx

@@ -28,9 +28,6 @@ const Edit: React.FC<{ bundle: EditBundle }> = (props) => {
       onCancel={() => {
         bundle.close();
       }}
-      onClose={() => {
-        bundle.close();
-      }}
       onOk={() => {}}
     >
       <ProForm

+ 34 - 71
src/pages/Settings/Menu.tsx

@@ -12,58 +12,12 @@ import {Button, Card, Modal} from 'antd';
 import React, {useRef} from 'react';
 import {AddOutline} from 'antd-mobile-icons';
 import {EditBundle, useEdit} from '@/core/hooks/useEdit';
-import {invoke} from '@/core/network';
-
-type MenuVO = {
-  id?: number;
-  name: string;
-  sortNum: number;
-  status: number;
-  type: number;
-  parentId?: number;
-  url?: string;
-  target?: string;
-  hasRefresh?: number;
-  perms?: string;
-  icon?: string;
-  children?: MenuVO[];
-};
-
-type MenuList = MenuVO[];
-
-class Service {
-
-  public static async listTree(query: { keyword?: string; status?: number }) {
-    return invoke<MenuList>('/apis/admin/menu/tree/list', {
-      method: 'POST',
-      data: query,
-    });
-  }
-
-  public static async remove(id: number) {
-    return invoke<void>(`/apis/admin/menu/remove?id=${id}`, {
-      method: 'DELETE',
-    });
-  }
-
-  public static async save(menu: Partial<MenuVO>) {
-    return invoke<MenuVO>('/apis/admin/menu/save', {
-      method: 'POST',
-      data: menu,
-    });
-  }
-
-  public static async get(id: number) {
-    return invoke<MenuVO>(`/apis/admin/menu/details?id=${id}`, {
-      method: 'GET',
-    });
-  }
-}
+import { deleteMenuRemoveApi, getMenuDetailsApi, postMenuSaveApi, postMenuTreeListApi } from '@/services/swagger/menuAdmin';
 
 const Edit: React.FC<{ bundle: EditBundle;  onSuccess?: () => void }> = (props) => {
   let {bundle} = props;
 
-  const [form] = ProForm.useForm<MenuVO>();
+  const [form] = ProForm.useForm<SectApi.MenuVO>();
   const [loading, setLoading] = React.useState(false);
   return (
     <Modal
@@ -76,7 +30,7 @@ const Edit: React.FC<{ bundle: EditBundle;  onSuccess?: () => void }> = (props)
         try {
           setLoading(true);
 
-          await Service.save({
+          await postMenuSaveApi({
             id: bundle.id,
             ...form.getFieldsValue(),
           });
@@ -105,26 +59,34 @@ const Edit: React.FC<{ bundle: EditBundle;  onSuccess?: () => void }> = (props)
         request={async () => {
           if (bundle.id !== undefined) {
             console.log(bundle.id, 'bundle');
-            const res = await Service.get(bundle.id);
+            const res = await getMenuDetailsApi({id: bundle.id});
 
             return res.data;
           }
 
           return Promise.resolve({});
         }}
+
+        initialValues={{
+          type: 1 ,
+          status: 2,
+          target: 1,
+          hasRefresh: 0
+        } }
+
       >
 
-        <ProFormRadio.Group name='type' label='类型' value='2'
+        <ProFormRadio.Group name='type' label='类型'
                             options={[
-                              {label: '目录', value: '1',},
-                              {label: '菜单', value: '2'},
-                              {label: '按钮', value: '3'}]}></ProFormRadio.Group>
-        <ProFormRadio.Group name='status' label='状态' value='1'
-                            options={[{label: '正常', value: '1',}, {label: '隐藏', value: '2'}]}/>
-        <ProFormRadio.Group name='target' label='目标' value='1'
-                            options={[{label: '页签', value: '1',}, {label: '新窗口', value: '2'}]}/>
-        <ProFormRadio.Group name='hasRefresh' label='是否刷新' value='1'
-                            options={[{label: '不刷新', value: '0',}, {label: '刷新', value: '1'}]}/>
+                              {label: '目录', value: 1,},
+                              {label: '菜单', value: 2},
+                              {label: '按钮', value: 3}]}></ProFormRadio.Group>
+        <ProFormRadio.Group name='status' label='状态'
+                            options={[{label: '正常', value: 1,}, {label: '隐藏', value: 2}]}/>
+        <ProFormRadio.Group name='target' label='目标'
+                            options={[{label: '页签', value: 1,}, {label: '新窗口', value: 2}]}/>
+        <ProFormRadio.Group name='hasRefresh' label='是否刷新'
+                            options={[{label: '不刷新', value: 0,}, {label: '刷新', value: 1}]}/>
         <ProFormText name='name' label={'菜单名称'} placeholder={'请输入菜单名称'}
                      rules={[{required: true, message: '请输入菜单名称',}, {
                        min: 3,
@@ -138,18 +100,15 @@ const Edit: React.FC<{ bundle: EditBundle;  onSuccess?: () => void }> = (props)
           placeholder="请选择父菜单ID"
           allowClear
           request={async () => {
-            const transformToTreeData = (data: MenuVO[]): any[] =>
+            const transformToTreeData = (data: SectApi.MenuVO[]): any[] =>
               data.map((item) => ({
                 title: item.name,
                 value: item.id,
                 key: item.id,
                 children: item.children ? transformToTreeData(item.children) : [],
               }));
-            const res = await Service.listTree({});
-            if (res.success) {
+            const res = await postMenuTreeListApi({})
               return transformToTreeData(res.data);
-            }
-            return Promise.resolve({});
           }}
         >
         </ProFormTreeSelect>
@@ -174,11 +133,10 @@ const MenuExp: React.FC = () => {
       <PageContainer content={''}>
         {bundle.open && <Edit bundle={bundle} onSuccess={() => ref.current?.reload()}></Edit>}
         <Card>
-          <ProTable<MenuVO>
+          <ProTable<SectApi.MenuVO>
             rowKey={'id'}
-            request={async (params) => {
-              const res = await Service.listTree({});
-
+            request={async () => {
+              const res = await postMenuTreeListApi({})
               return {
                 success: res.success,
                 data: res.data,
@@ -236,8 +194,10 @@ const MenuExp: React.FC = () => {
                   <a
                     key={'delete'}
                     onClick={async () => {
-                      await Service.remove(record.id as number);
-                      ref.current?.reload();
+                      if(record.id) {
+                        await deleteMenuRemoveApi({id:record.id});
+                        ref.current?.reload();
+                      }
                     }}
                   >
                     删除
@@ -246,6 +206,9 @@ const MenuExp: React.FC = () => {
               },
             ]}
 
+
+
+            pagination={false}
             actionRef={ref}
             toolbar={{
               actions: [

+ 73 - 80
src/pages/Settings/Role.tsx

@@ -4,28 +4,16 @@ import {
   ProForm,
   ProFormText, ProFormTreeSelect,
   ProTable,
+  RequestOptionsType,
 } from '@ant-design/pro-components';
 import {Button, Card, Modal} from 'antd';
 import React, {useRef} from 'react';
 import {AddOutline} from 'antd-mobile-icons';
 import {EditBundle, useEdit} from '@/core/hooks/useEdit';
-import {invoke} from '@/core/network';
+import { deleteRoleRemoveApi, getRoleDetailsApi, postRolePageApi, postRoleSaveApi } from '@/services/swagger/roleAdmin';
+import { postMenuTreeListApi } from '@/services/swagger/menuAdmin';
 
-type Role = {
-  id?: number;
-  name: string;
-  sortNum: number;
-  status: number;
-};
-
-type RoleList = {
-  records: Role[];
-  total: number;
-  size: number;
-  current: number;
-};
-
-type MenuVO = {
+export type MenuVO = {
   id?: number;
   name: string;
   sortNum: number;
@@ -40,49 +28,10 @@ type MenuVO = {
   children?: MenuVO[];
 };
 
-type MenuList = MenuVO[];
-
-class Service {
-  public static async list(current: number, size: number) {
-    return invoke<RoleList>('/apis/admin/role/page', {
-      method: 'POST',
-      data: {
-        current,
-        size,
-      },
-    });
-  }
-
-  public static async remove(id: number) {
-    return invoke<void>(`/apis/admin/role/remove?id=${id}`, {
-      method: 'DELETE',
-    });
-  }
-
-  public static async save(member: Partial<Role>) {
-    return invoke<Role>('/apis/admin/role/save', {
-      method: 'POST',
-      data: member,
-    });
-  }
-
-  public static async get(id: number) {
-    return invoke<Role>(`/apis/admin/role/details?id=${id}`, {
-      method: 'GET',
-    });
-  }
-
-  public static async listTree(query: { keyword?: string; status?: number }) {
-    return invoke<MenuList>('/apis/admin/menu/tree/list', {
-      method: 'POST',
-      data: query,
-    });
-  }
-}
 
 const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) => {
   const {bundle} = props;
-  const [form] = ProForm.useForm<Role>();
+  const [form] = ProForm.useForm<SectApi.RoleSaveQuery>();
   const [loading, setLoading] = React.useState(false);
 
   return (
@@ -95,11 +44,11 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
 
         try {
           setLoading(true);
-
-          await Service.save({
+          await postRoleSaveApi({
             id: bundle.id,
             ...form.getFieldsValue(),
-          });
+          })
+
         } finally {
           setLoading(false);
         }
@@ -107,10 +56,6 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
         props.onSuccess?.();
         bundle.close();
       }}
-      onClose={() => {
-        form.resetFields();
-        bundle.close();
-      }}
       onCancel={() => {
         form.resetFields();
         bundle.close();
@@ -125,9 +70,30 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
         request={async () => {
           if (bundle.id !== undefined) {
             console.log(bundle.id, 'bundle');
-            const res = await Service.get(bundle.id);
 
-            return res.data;
+            const res = await getRoleDetailsApi({ id: bundle.id})
+
+
+            const menuIds: number[] = []
+            function getMenuIds (menus?:SectApi.MenuVO[]) {
+              menus?.forEach((menu) => {
+                if(menu.id) {
+                  menuIds.push(menu.id)
+                }
+
+                if(menu.children) {
+                  getMenuIds(menu.children)
+
+                }
+              })
+            }
+
+            getMenuIds(res.data.menus)
+
+            return {
+              ...res.data,
+              menuIds:menuIds
+            };
           }
 
           return Promise.resolve({});
@@ -152,25 +118,47 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
 
         <ProFormTreeSelect
           fieldProps={{
-            'multiple': 'true',
+            'multiple': true,
           }}
-          label='父菜单' name='menuIds'
+          label='父菜单'
+          name='menuIds'
           style={{width: '100%'}}
           placeholder="请选择菜单"
           allowClear
           request={async () => {
-            const transformToTreeData = (data: MenuVO[]): any[] =>
-              data.map((item) => ({
-                title: item.name,
+            const transformToTreeData = (data: SectApi.MenuVO[]): RequestOptionsType[] =>
+              data.map<RequestOptionsType>((item) => ({
+                label: item.name,
                 value: item.id,
-                key: item.id,
                 children: item.children ? transformToTreeData(item.children) : [],
               }));
-            const res = await Service.listTree({});
-            if (res.success) {
-              return transformToTreeData(res.data);
-            }
-            return Promise.resolve({});
+            const rs = await postMenuTreeListApi({});
+            const treeData = transformToTreeData(rs.data);
+            console.log(treeData)
+              return treeData
+
+
+
+          //   export type RequestOptionsType = {
+          //     /**
+          //      * 选项的文本内容,可以是一个 React 组件。
+          //      */
+          //     label?: React.ReactNode;
+          //     /**
+          //      * 选项的值,可以是一个字符串或数字类型。
+          //      */
+          //     value?: string | number | boolean;
+          //     /** 渲染的节点类型 */
+          //     optionType?: 'optGroup' | 'option';
+          //     /**
+          //      * 当节点类型为 optGroup 时,可以使用该属性来定义其包含的子选项,每个子选项也可以使用 RequestOptionsType 类型来定义。
+          //      */
+          //     options?: Omit<RequestOptionsType, 'children' | 'optionType'>[];
+          //     /** 其他自定义属性。 */
+          //     [key: string]: any;
+          // };
+
+
           }}
         >
         </ProFormTreeSelect>
@@ -187,10 +175,13 @@ const RoleExp: React.FC = () => {
     <PageContainer content={''}>
       {bundle.open && <Edit bundle={bundle} onSuccess={() => ref.current?.reload()}></Edit>}
       <Card>
-        <ProTable<Role>
+        <ProTable<SectApi.RoleVO>
           rowKey={'id'}
           request={async (params) => {
-            const res = await Service.list(params.current || 1, params.pageSize || 10);
+            const res = await postRolePageApi({
+              current: params.current || 1,
+              size:params.pageSize || 10,
+            })
 
             return {
               success: res.success,
@@ -217,8 +208,10 @@ const RoleExp: React.FC = () => {
                 <a
                   key={'delete'}
                   onClick={async () => {
-                    await Service.remove(record.id as number);
-                    ref.current?.reload();
+                    if(record.id) {
+                      await deleteRoleRemoveApi({id: record.id })
+                      ref.current?.reload();
+                    }
                   }}
                 >
                   删除

+ 22 - 61
src/pages/Settings/Settings.tsx

@@ -12,11 +12,11 @@ import {
   ProTable,
 } from '@ant-design/pro-components';
 import { Button, Card, Modal } from 'antd';
-import { invoke } from '@/core/network';
 import { AddOutline } from 'antd-mobile-icons';
 import { EditBundle, useEdit } from '@/core/hooks/useEdit';
 import dayjs from 'dayjs';
 import ReactJson from 'react-json-view';
+import { getConfigGetApi, postConfigPageApi, postConfigSaveApi } from '@/services/swagger/zidianpeizhiguanlihoutaiApi';
 
 enum ConfigPermission {
   /**
@@ -35,51 +35,6 @@ enum ConfigPermission {
 
 type ConfigType = 'int' | 'long' | 'str' | 'bool' | 'date' | 'dateTime' | 'json' | 'array';
 
-export interface Config {
-  id: number;
-  type: ConfigType;
-  code: string;
-  remark: string;
-  content: string;
-  permission: ConfigPermission;
-}
-
-export interface ConfigList {
-  records: Config[];
-  total: number;
-  size: number;
-  current: number;
-}
-
-class Service {
-  public static async page(current: number, size: number) {
-    return invoke<ConfigList>('/apis/admin/config/page', {
-      method: 'POST',
-      data: {
-        current,
-        size,
-      },
-    });
-  }
-
-  //save
-  public static async save(config: Partial<Config>) {
-    return invoke<Config>('/apis/admin/config/save', {
-      method: 'POST',
-      data: config,
-    });
-  }
-
-  //get
-  public static async get(code: string) {
-    return invoke<Config>(`/apis/admin/config/get`, {
-      method: 'GET',
-      params: {
-        code,
-      },
-    });
-  }
-}
 
 const Edit: React.FC<{ bundle: EditBundle<string>; onSuccess?: () => void }> = (props) => {
   const { bundle } = props;
@@ -94,7 +49,7 @@ const Edit: React.FC<{ bundle: EditBundle<string>; onSuccess?: () => void }> = (
 
         console.log(values);
 
-        const res = await Service.save({
+        const res = await postConfigSaveApi({
           ...values,
         });
 
@@ -108,24 +63,21 @@ const Edit: React.FC<{ bundle: EditBundle<string>; onSuccess?: () => void }> = (
       onCancel={() => {
         bundle.close();
       }}
-      onClose={() => {
-        bundle.close();
-      }}
     >
-      <ProForm<Partial<Config>>
+      <ProForm<Partial<SectApi.ConfigVO>>
         className={'mt-5'}
         validateTrigger={false}
         form={form}
         submitter={false}
         layout={'horizontal'}
         labelCol={{ span: 4 }}
-        request={async (): Promise<Partial<Config>> => {
+        request={async (): Promise<Partial<SectApi.ConfigVO>> => {
           if (bundle.id) {
-            const res = await Service.get(bundle.id);
+            const res = await getConfigGetApi({code: bundle.id})
 
             return {
               code: res.data.code,
-              type: res.data.type,
+              type: res.data.type as ConfigType,
               remark: res.data.remark,
               content: res.data.content,
             };
@@ -398,7 +350,6 @@ const JSONView: React.FC<{ value: string }> = (props) => {
         <Modal
           title={'JSON'}
           open={open}
-          onClose={() => setOpen(false)}
           footer={false}
           onCancel={() => setOpen(false)}
         >
@@ -431,7 +382,7 @@ const Settings: React.FC = () => {
         />
       )}
       <Card>
-        <ProTable<Config>
+        <ProTable<SectApi.ConfigVO>
           actionRef={ref}
           search={false}
           columns={[
@@ -477,7 +428,7 @@ const Settings: React.FC = () => {
                 switch (record.type) {
                   case 'json':
                   case 'array':
-                    return <JSONView value={record.content}></JSONView>;
+                    return record.content &&  <JSONView value={record.content}></JSONView>;
                   case 'date':
                     return dayjs(record.content).format('YYYY-MM-DD');
                   case 'dateTime':
@@ -507,6 +458,10 @@ const Settings: React.FC = () => {
               title: '操作',
               valueType: 'option',
               render: (_, record) => {
+                if(!record.code) {
+                  return null
+                }
+
                 const opts = [];
 
                 if (record.permission !== ConfigPermission.SYSTEM) {
@@ -514,7 +469,10 @@ const Settings: React.FC = () => {
                     <a
                       key={'edit'}
                       onClick={() => {
-                        edit.update(record.code);
+                        if(record.code)
+                        {
+                          edit.update(record.code);
+                        }
                       }}
                     >
                       编辑
@@ -541,13 +499,16 @@ const Settings: React.FC = () => {
             ],
             settings: [],
           }}
-          request={async (params, sort, filter) => {
-            const res = await Service.page(params.current || 1, params.pageSize || 20);
+          request={async (params) => {
+            const res = await postConfigPageApi({
+              current:params.current || 1,
+              size:params.pageSize || 20
+            });
 
             return {
               data: res.data.records,
               total: res.data.current,
-              success: true,
+              success: res.success,
             };
           }}
         ></ProTable>

+ 51 - 95
src/pages/Settings/Staff.tsx

@@ -3,84 +3,12 @@ import {Button, Card, Modal} from 'antd';
 import React, {useRef} from 'react';
 import {AddOutline} from 'antd-mobile-icons';
 import {EditBundle, useEdit} from '@/core/hooks/useEdit';
-import {invoke} from '@/core/network';
-
-type Member = {
-  id?: number;
-  username: string;
-  password: string;
-  nickname: string;
-  thumbAvatar?: string;
-  level: number;
-  roles: Role[];
-};
-
-type MemberList = {
-  records: Member[];
-  total: number;
-  size: number;
-  current: number;
-};
-
-
-type Role = {
-  id?: number;
-  name: string;
-  sortNum: number;
-  status: number;
-};
-
-type RoleList = {
-  records: Role[];
-  total: number;
-  size: number;
-  current: number;
-};
-
-class Service {
-  public static async list(current: number, size: number) {
-    return invoke<MemberList>('/apis/admin/staff/page', {
-      method: 'POST',
-      data: {
-        current,
-        size,
-      },
-    });
-  }
-
-  public static async listRole() {
-    return invoke<RoleList>('/apis/admin/role/page', {
-      method: 'POST',
-      data: {
-        current: 1,
-        size: 1000,
-      },
-    });
-  }
-
-  public static async remove(id: number) {
-    return invoke<void>(`/apis/admin/staff/remove?id=${id}`, {
-      method: 'DELETE',
-    });
-  }
-
-  public static async save(member: Partial<Member>) {
-    return invoke<Member>('/apis/admin/staff/save', {
-      method: 'POST',
-      data: member,
-    });
-  }
-
-  public static async get(id: number) {
-    return invoke<Member>(`/apis/admin/staff/details?id=${id}`, {
-      method: 'GET',
-    });
-  }
-}
+import { deleteStaffRemoveApi, getStaffDetailsApi, postStaffPageApi, postStaffSaveApi } from '@/services/swagger/staffAdmin';
+import { postRolePageApi } from '@/services/swagger/roleAdmin';
 
 const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) => {
   const {bundle} = props;
-  const [form] = ProForm.useForm<Member>();
+  const [form] = ProForm.useForm<SectApi.StaffSaveQuery>();
   const [loading, setLoading] = React.useState(false);
 
   return (
@@ -94,7 +22,7 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
         try {
           setLoading(true);
 
-          await Service.save({
+          await postStaffSaveApi({
             id: bundle.id,
             ...form.getFieldsValue(),
             thumbAvatar: '',
@@ -107,10 +35,6 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
         props.onSuccess?.();
         bundle.close();
       }}
-      onClose={() => {
-        form.resetFields();
-        bundle.close();
-      }}
       onCancel={() => {
         form.resetFields();
         bundle.close();
@@ -125,9 +49,14 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
         request={async () => {
           if (bundle.id !== undefined) {
             console.log(bundle.id, 'bundle');
-            const res = await Service.get(bundle.id);
+            const res = await getStaffDetailsApi({id: bundle.id});
 
-            return res.data;
+            return {
+              ...res.data,
+              roleIds: res.data.roles?.map((rule) => {
+                return rule.id
+              })
+            }
           }
 
           return Promise.resolve({});
@@ -188,14 +117,13 @@ const Edit: React.FC<{ bundle: EditBundle; onSuccess?: () => void }> = (props) =
           name="roleIds"
           label="角色"
           request={async () => {
-            const res = await Service.listRole();
-            if (res.success) {
-              return res.data.records.map(record => ({
+            const res = await postRolePageApi({        current: 1,
+              size: 1000});
+              const records = res.data.records ?? []
+              return records.map(record => ({
                 label: record.name,
                 value: record.id,
               }))
-            }
-            return Promise.resolve({});
           }}
           placeholder="请选择角色"
           rules={[{required: true, message: '请选择角色'}]}
@@ -209,14 +137,25 @@ const Staff: React.FC = () => {
   const bundle = useEdit();
   const ref = useRef<ActionType>();
 
+
+
   return (
     <PageContainer content={''}>
       {bundle.open && <Edit bundle={bundle} onSuccess={() => ref.current?.reload()}></Edit>}
       <Card>
-        <ProTable<Member>
+        <ProTable<SectApi.StaffVO>
           rowKey={'id'}
-          request={async (params) => {
-            const res = await Service.list(params.current || 1, params.pageSize || 10);
+
+          request={async (params, ...rest) => {
+            console.log(params, ...rest)
+
+            const res = await postStaffPageApi(
+
+              {
+                current: params.current || 1,
+                size: params.pageSize || 10,
+              }
+              );
 
             return {
               success: res.success,
@@ -232,15 +171,21 @@ const Staff: React.FC = () => {
             {
               title: '账号',
               dataIndex: 'username',
+              filters: true,
             },
             {
               title: '姓名',
               dataIndex: 'nickname',
+              copyable: true,
+              ellipsis: true,
             },
             {
               title: '角色列表',
               dataIndex: 'roles',
-              render: (roles: Role[]) => roles.map(role => role.name).join(', '),
+              // @ts-ignore
+              render: (roles: SectApi.RoleVO[]) => {
+                return roles.map(role => role.name).join(', ')
+              },
             },
             {
               title: '操作',
@@ -252,15 +197,26 @@ const Staff: React.FC = () => {
                 <a
                   key={'delete'}
                   onClick={async () => {
-                    await Service.remove(record.id as number);
-                    ref.current?.reload();
+                    if(record.id) {
+                      await deleteStaffRemoveApi({id: record.id})
+                      ref.current?.reload();
+                    }
                   }}
                 >
                   删除
                 </a>,
               ],
             },
-          ]}
+          ]
+          }
+          search={{
+            labelWidth: 'auto',
+          }}
+          form={{
+            ignoreRules: false,
+          }}
+
+
           actionRef={ref}
           toolbar={{
             actions: [
@@ -270,7 +226,7 @@ const Staff: React.FC = () => {
             ],
             settings: [],
           }}
-          search={false}
+
         ></ProTable>
       </Card>
     </PageContainer>

+ 17 - 46
src/pages/Settings/Users.tsx

@@ -1,54 +1,16 @@
 import React, { useRef } from 'react';
 import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
 import { Card, Image, Popconfirm } from 'antd';
-import { invoke } from '@/core/network';
+import { deleteUserRemoveApi, getUserDetailsApi, postUserPageApi } from '@/services/swagger/userAdmin';
 
-type User = {
-  id: number;
-  mobile: string;
-  nickname: string;
-  avatarThumbnail: string;
-  avatarOriginal: string;
-};
-
-type UserList = {
-  records: User[];
-  total: number;
-  size: number;
-  current: number;
-};
-
-class Service {
-  public static async page(current: number, size: number) {
-    return invoke<UserList>('/apis/admin/user/page', {
-      method: 'POST',
-      data: {
-        current,
-        size,
-      },
-    });
-  }
 
-  public static async remove(id: number) {
-    return invoke<void>(`/apis/admin/user/remove?id=${id}`, {
-      method: 'DELETE',
-    });
-  }
-
-  public static async get(id: number) {
-    return invoke<User>(`/apis/admin/user/details?id=${id}`, {
-      method: 'GET',
-    });
-  }
-}
-
-const Users: React.FC<{}> = (props) => {
+const Users = () => {
   const ref = useRef<ActionType>();
 
   return (
     <PageContainer>
       <Card>
-        <ProTable<User>
+        <ProTable<SectApi.UserVO>
           actionRef={ref}
           rowKey="id"
           search={false}
@@ -58,7 +20,11 @@ const Users: React.FC<{}> = (props) => {
           }}
           request={async (params) => {
             const { current, pageSize } = params;
-            const result = await Service.page(current || 1, pageSize || 20);
+            const result = await postUserPageApi({
+              current:current || 1,
+              size:pageSize || 20,
+
+            });
             return {
               data: result.data.records,
               total: result.data.total,
@@ -92,8 +58,10 @@ const Users: React.FC<{}> = (props) => {
                 <a
                   key={'edit'}
                   onClick={async () => {
-                    const user = await Service.get(record.id);
-                    console.log(user);
+                    if(record.id) {
+                      const user = await getUserDetailsApi({id: record.id});
+                      console.log(user);
+                    }
                   }}
                 >
                   编辑
@@ -102,8 +70,11 @@ const Users: React.FC<{}> = (props) => {
                   key={'delete'}
                   title={'确认删除吗?'}
                   onConfirm={async () => {
-                    await Service.remove(record.id);
-                    ref.current?.reload();
+                    if(record.id) {
+                      await deleteUserRemoveApi({id: record.id});
+                      ref.current?.reload();
+                    }
+
                   }}
                 >
                   <a key={'delete'}>删除</a>

+ 2 - 2
src/pages/TableList/components/UpdateForm.tsx

@@ -16,13 +16,13 @@ export type FormValueType = {
   type?: string;
   time?: string;
   frequency?: string;
-} & Partial<API.RuleListItem>;
+} & Partial<SectApi.RuleListItem>;
 
 export type UpdateFormProps = {
   onCancel: (flag?: boolean, formVals?: FormValueType) => void;
   onSubmit: (values: FormValueType) => Promise<void>;
   updateModalOpen: boolean;
-  values: Partial<API.RuleListItem>;
+  values: Partial<SectApi.RuleListItem>;
 };
 
 const UpdateForm: React.FC<UpdateFormProps> = (props) => {

+ 9 - 9
src/pages/TableList/index.tsx

@@ -21,7 +21,7 @@ import UpdateForm from './components/UpdateForm';
  * @zh-CN 添加节点
  * @param fields
  */
-const handleAdd = async (fields: API.RuleListItem) => {
+const handleAdd = async (fields: SectApi.RuleListItem) => {
   const hide = message.loading('正在添加');
   try {
     await addRule({ ...fields });
@@ -66,7 +66,7 @@ const handleUpdate = async (fields: FormValueType) => {
  *
  * @param selectedRows
  */
-const handleRemove = async (selectedRows: API.RuleListItem[]) => {
+const handleRemove = async (selectedRows: SectApi.RuleListItem[]) => {
   const hide = message.loading('正在删除');
   if (!selectedRows) return true;
   try {
@@ -98,8 +98,8 @@ const TableList: React.FC = () => {
   const [showDetail, setShowDetail] = useState<boolean>(false);
 
   const actionRef = useRef<ActionType>();
-  const [currentRow, setCurrentRow] = useState<API.RuleListItem>();
-  const [selectedRowsState, setSelectedRows] = useState<API.RuleListItem[]>([]);
+  const [currentRow, setCurrentRow] = useState<SectApi.RuleListItem>();
+  const [selectedRowsState, setSelectedRows] = useState<SectApi.RuleListItem[]>([]);
 
   /**
    * @en-US International configuration
@@ -107,7 +107,7 @@ const TableList: React.FC = () => {
    * */
   const intl = useIntl();
 
-  const columns: ProColumns<API.RuleListItem>[] = [
+  const columns: ProColumns<SectApi.RuleListItem>[] = [
     {
       title: (
         <FormattedMessage
@@ -243,7 +243,7 @@ const TableList: React.FC = () => {
 
   return (
     <PageContainer>
-      <ProTable<API.RuleListItem, API.PageParams>
+      <ProTable<SectApi.RuleListItem, SectApi.PageParams>
         headerTitle={intl.formatMessage({
           id: 'pages.searchTable.title',
           defaultMessage: 'Enquiry form',
@@ -320,7 +320,7 @@ const TableList: React.FC = () => {
         open={createModalOpen}
         onOpenChange={handleModalOpen}
         onFinish={async (value) => {
-          const success = await handleAdd(value as API.RuleListItem);
+          const success = await handleAdd(value as SectApi.RuleListItem);
           if (success) {
             handleModalOpen(false);
             if (actionRef.current) {
@@ -377,7 +377,7 @@ const TableList: React.FC = () => {
         closable={false}
       >
         {currentRow?.name && (
-          <ProDescriptions<API.RuleListItem>
+          <ProDescriptions<SectApi.RuleListItem>
             column={2}
             title={currentRow?.name}
             request={async () => ({
@@ -386,7 +386,7 @@ const TableList: React.FC = () => {
             params={{
               id: currentRow?.name,
             }}
-            columns={columns as ProDescriptionsItemProps<API.RuleListItem>[]}
+            columns={columns as ProDescriptionsItemProps<SectApi.RuleListItem>[]}
           />
         )}
       </Drawer>

+ 6 - 6
src/pages/User/Login/index.tsx

@@ -6,7 +6,7 @@ import Settings from '../../../../config/defaultSettings';
 import React, { useState } from 'react';
 import { flushSync } from 'react-dom';
 import { createStyles } from 'antd-style';
-import { LoginParams, Service } from '@/pages/User/Login/service';
+import { postStaffLoginApi } from '@/services/swagger/staffAdmin';
 
 const useStyles = createStyles(({ token }) => {
   return {
@@ -60,7 +60,7 @@ const LoginMessage: React.FC<{
 };
 
 const Login: React.FC = () => {
-  const [userLoginState, setUserLoginState] = useState<API.LoginResult>({});
+  const [userLoginState, setUserLoginState] = useState<{type: string, status: string}>();
   const [type, setType] = useState<string>('account');
   const { initialState, setInitialState } = useModel('@@initialState');
   const { styles } = useStyles();
@@ -78,10 +78,10 @@ const Login: React.FC = () => {
     }
   };
 
-  const handleSubmit = async (values: LoginParams) => {
+  const handleSubmit = async (values: SectApi.StaffLoginQuery) => {
     try {
       // 登录
-      const msg = await Service.login({ ...values });
+      const msg = await postStaffLoginApi({ ...values });
 
       console.log('msg', msg);
 
@@ -109,7 +109,7 @@ const Login: React.FC = () => {
       message.error(defaultLoginFailureMessage);
     }
   };
-  const { status, type: loginType } = userLoginState;
+  const { status, type: loginType } = userLoginState || {};
 
   return (
     <div className={styles.container}>
@@ -141,7 +141,7 @@ const Login: React.FC = () => {
           }}
           actions={[]}
           onFinish={async (values) => {
-            await handleSubmit(values as LoginParams);
+            await handleSubmit(values as SectApi.StaffLoginQuery);
           }}
         >
           <Tabs

+ 0 - 27
src/pages/User/Login/service.ts

@@ -1,27 +0,0 @@
-import { invoke } from '@/core/network';
-
-export interface LoginParams {
-  username: string;
-  password: string;
-}
-
-export interface Me {
-  id: number;
-  name: string;
-  nickname: string;
-}
-
-export class Service {
-  public static async login(params: LoginParams) {
-    return invoke<string>('/apis/admin/staff/login', {
-      method: 'POST',
-      data: params,
-    });
-  }
-
-  public static async me() {
-    return invoke<Me>('/apis/admin/staff/me', {
-      skipErrorHandler: true,
-    });
-  }
-}

+ 0 - 94
src/services/ant-design-pro/api.ts

@@ -1,94 +0,0 @@
-// @ts-ignore
-/* eslint-disable */
-import { request } from '@umijs/max';
-
-/** 获取当前的用户 GET /api/currentUser */
-export async function currentUser(options?: { [key: string]: any }) {
-  return request<{
-    data: API.CurrentUser;
-  }>('/api/currentUser', {
-    method: 'GET',
-    ...(options || {}),
-  });
-}
-
-/** 退出登录接口 POST /api/login/outLogin */
-export async function outLogin(options?: { [key: string]: any }) {
-  return request<Record<string, any>>('/api/login/outLogin', {
-    method: 'POST',
-    ...(options || {}),
-  });
-}
-
-/** 登录接口 POST /api/login/account */
-export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
-  return request<API.LoginResult>('/api/login/account', {
-    method: 'POST',
-    headers: {
-      'Content-Type': 'application/json',
-    },
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** 此处后端没有提供注释 GET /api/notices */
-export async function getNotices(options?: { [key: string]: any }) {
-  return request<API.NoticeIconList>('/api/notices', {
-    method: 'GET',
-    ...(options || {}),
-  });
-}
-
-/** 获取规则列表 GET /api/rule */
-export async function rule(
-  params: {
-    // query
-    /** 当前的页码 */
-    current?: number;
-    /** 页面的容量 */
-    pageSize?: number;
-  },
-  options?: { [key: string]: any },
-) {
-  return request<API.RuleList>('/api/rule', {
-    method: 'GET',
-    params: {
-      ...params,
-    },
-    ...(options || {}),
-  });
-}
-
-/** 更新规则 PUT /api/rule */
-export async function updateRule(options?: { [key: string]: any }) {
-  return request<API.RuleListItem>('/api/rule', {
-    method: 'POST',
-    data:{
-      method: 'update',
-      ...(options || {}),
-    }
-  });
-}
-
-/** 新建规则 POST /api/rule */
-export async function addRule(options?: { [key: string]: any }) {
-  return request<API.RuleListItem>('/api/rule', {
-    method: 'POST',
-    data:{
-      method: 'post',
-      ...(options || {}),
-    }
-  });
-}
-
-/** 删除规则 DELETE /api/rule */
-export async function removeRule(options?: { [key: string]: any }) {
-  return request<Record<string, any>>('/api/rule', {
-    method: 'POST',
-    data:{
-      method: 'delete',
-      ...(options || {}),
-    }
-  });
-}

+ 0 - 10
src/services/ant-design-pro/index.ts

@@ -1,10 +0,0 @@
-// @ts-ignore
-/* eslint-disable */
-// API 更新时间:
-// API 唯一标识:
-import * as api from './api';
-import * as login from './login';
-export default {
-  api,
-  login,
-};

+ 0 - 21
src/services/ant-design-pro/login.ts

@@ -1,21 +0,0 @@
-// @ts-ignore
-/* eslint-disable */
-import { request } from '@umijs/max';
-
-/** 发送验证码 POST /api/login/captcha */
-export async function getFakeCaptcha(
-  params: {
-    // query
-    /** 手机号 */
-    phone?: string;
-  },
-  options?: { [key: string]: any },
-) {
-  return request<API.FakeCaptcha>('/api/login/captcha', {
-    method: 'GET',
-    params: {
-      ...params,
-    },
-    ...(options || {}),
-  });
-}

+ 0 - 101
src/services/ant-design-pro/typings.d.ts

@@ -1,101 +0,0 @@
-// @ts-ignore
-/* eslint-disable */
-
-declare namespace API {
-  type CurrentUser = {
-    name?: string;
-    avatar?: string;
-    userid?: string;
-    email?: string;
-    signature?: string;
-    title?: string;
-    group?: string;
-    tags?: { key?: string; label?: string }[];
-    notifyCount?: number;
-    unreadCount?: number;
-    country?: string;
-    access?: string;
-    geographic?: {
-      province?: { label?: string; key?: string };
-      city?: { label?: string; key?: string };
-    };
-    address?: string;
-    phone?: string;
-  };
-
-  type LoginResult = {
-    status?: string;
-    type?: string;
-    currentAuthority?: string;
-  };
-
-  type PageParams = {
-    current?: number;
-    pageSize?: number;
-  };
-
-  type RuleListItem = {
-    key?: number;
-    disabled?: boolean;
-    href?: string;
-    avatar?: string;
-    name?: string;
-    owner?: string;
-    desc?: string;
-    callNo?: number;
-    status?: number;
-    updatedAt?: string;
-    createdAt?: string;
-    progress?: number;
-  };
-
-  type RuleList = {
-    data?: RuleListItem[];
-    /** 列表的内容总数 */
-    total?: number;
-    success?: boolean;
-  };
-
-  type FakeCaptcha = {
-    code?: number;
-    status?: string;
-  };
-
-  type LoginParams = {
-    username?: string;
-    password?: string;
-    autoLogin?: boolean;
-    type?: string;
-  };
-
-  type ErrorResponse = {
-    /** 业务约定的错误码 */
-    errorCode: string;
-    /** 业务上的错误信息 */
-    errorMessage?: string;
-    /** 业务上的请求是否成功 */
-    success?: boolean;
-  };
-
-  type NoticeIconList = {
-    data?: NoticeIconItem[];
-    /** 列表的内容总数 */
-    total?: number;
-    success?: boolean;
-  };
-
-  type NoticeIconItemType = 'notification' | 'message' | 'event';
-
-  type NoticeIconItem = {
-    id?: string;
-    extra?: string;
-    key?: string;
-    read?: boolean;
-    avatar?: string;
-    title?: string;
-    status?: string;
-    datetime?: string;
-    description?: string;
-    type?: NoticeIconItemType;
-  };
-}

+ 41 - 0
src/services/swagger/clientsAuth.ts

@@ -0,0 +1,41 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 获取 Ticket POST /apis/clients/auth/getTicket */
+export async function postAuthGetTicketApi(
+  body: SectApi.AuthTicketQuery | SectApi.Mobile | SectApi.Qq | SectApi.WeiBo,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.AuthTicketVO>('/apis/clients/auth/getTicket', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 获取 Token POST /apis/clients/auth/getToken */
+export async function postAuthGetTokenApi(
+  body: SectApi.AuthTokenQuery,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.AuthTokenInfoVO>('/apis/clients/auth/getToken', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 登出 GET /apis/clients/auth/logout */
+export async function getAuthLogoutApi(options?: { [key: string]: any }) {
+  return request<boolean>('/apis/clients/auth/logout', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}

+ 16 - 6
src/services/swagger/index.ts

@@ -2,11 +2,21 @@
 /* eslint-disable */
 // API 更新时间:
 // API 唯一标识:
-import * as pet from './pet';
-import * as store from './store';
-import * as user from './user';
+import * as userConfigClients from './userConfigClients';
+import * as clientsAuth from './clientsAuth';
+import * as userAdmin from './userAdmin';
+import * as staffAdmin from './staffAdmin';
+import * as roleAdmin from './roleAdmin';
+import * as menuAdmin from './menuAdmin';
+import * as zidianpeizhiguanlihoutaiApi from './zidianpeizhiguanlihoutaiApi';
+import * as yonghuqiandaokehuduanApi from './yonghuqiandaokehuduanApi';
 export default {
-  pet,
-  store,
-  user,
+  userConfigClients,
+  clientsAuth,
+  userAdmin,
+  staffAdmin,
+  roleAdmin,
+  menuAdmin,
+  zidianpeizhiguanlihoutaiApi,
+  yonghuqiandaokehuduanApi,
 };

+ 63 - 0
src/services/swagger/menuAdmin.ts

@@ -0,0 +1,63 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 菜单详情 GET /apis/admin/menu/details */
+export async function getMenuDetailsApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.getMenuDetailsApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.MenuVO>('/apis/admin/menu/details', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 删除菜单 DELETE /apis/admin/menu/remove */
+export async function deleteMenuRemoveApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.deleteMenuRemoveApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/menu/remove', {
+    method: 'DELETE',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 保存菜单 POST /apis/admin/menu/save */
+export async function postMenuSaveApi(
+  body: SectApi.MenuSaveQuery,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/menu/save', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 查询菜单树 POST /apis/admin/menu/tree/list */
+export async function postMenuTreeListApi(
+  body: SectApi.MenuTreeQuery,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.MenuVO[]>('/apis/admin/menu/tree/list', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}

+ 0 - 153
src/services/swagger/pet.ts

@@ -1,153 +0,0 @@
-// @ts-ignore
-/* eslint-disable */
-import { request } from '@umijs/max';
-
-/** Update an existing pet PUT /pet */
-export async function updatePet(body: API.Pet, options?: { [key: string]: any }) {
-  return request<any>('/pet', {
-    method: 'PUT',
-    headers: {
-      'Content-Type': 'application/json',
-    },
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** Add a new pet to the store POST /pet */
-export async function addPet(body: API.Pet, options?: { [key: string]: any }) {
-  return request<any>('/pet', {
-    method: 'POST',
-    headers: {
-      'Content-Type': 'application/json',
-    },
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** Find pet by ID Returns a single pet GET /pet/${param0} */
-export async function getPetById(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.getPetByIdParams,
-  options?: { [key: string]: any },
-) {
-  const { petId: param0, ...queryParams } = params;
-  return request<API.Pet>(`/pet/${param0}`, {
-    method: 'GET',
-    params: { ...queryParams },
-    ...(options || {}),
-  });
-}
-
-/** Updates a pet in the store with form data POST /pet/${param0} */
-export async function updatePetWithForm(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.updatePetWithFormParams,
-  body: { name?: string; status?: string },
-  options?: { [key: string]: any },
-) {
-  const { petId: param0, ...queryParams } = params;
-  const formData = new FormData();
-
-  Object.keys(body).forEach((ele) => {
-    const item = (body as any)[ele];
-
-    if (item !== undefined && item !== null) {
-      formData.append(
-        ele,
-        typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
-      );
-    }
-  });
-
-  return request<any>(`/pet/${param0}`, {
-    method: 'POST',
-    params: { ...queryParams },
-    data: formData,
-    ...(options || {}),
-  });
-}
-
-/** Deletes a pet DELETE /pet/${param0} */
-export async function deletePet(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.deletePetParams & {
-    // header
-    api_key?: string;
-  },
-  options?: { [key: string]: any },
-) {
-  const { petId: param0, ...queryParams } = params;
-  return request<any>(`/pet/${param0}`, {
-    method: 'DELETE',
-    headers: {},
-    params: { ...queryParams },
-    ...(options || {}),
-  });
-}
-
-/** uploads an image POST /pet/${param0}/uploadImage */
-export async function uploadFile(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.uploadFileParams,
-  body: { additionalMetadata?: string; file?: string },
-  file?: File,
-  options?: { [key: string]: any },
-) {
-  const { petId: param0, ...queryParams } = params;
-  const formData = new FormData();
-
-  if (file) {
-    formData.append('file', file);
-  }
-
-  Object.keys(body).forEach((ele) => {
-    const item = (body as any)[ele];
-
-    if (item !== undefined && item !== null) {
-      formData.append(
-        ele,
-        typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
-      );
-    }
-  });
-
-  return request<API.ApiResponse>(`/pet/${param0}/uploadImage`, {
-    method: 'POST',
-    params: { ...queryParams },
-    data: formData,
-    requestType: 'form',
-    ...(options || {}),
-  });
-}
-
-/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */
-export async function findPetsByStatus(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.findPetsByStatusParams,
-  options?: { [key: string]: any },
-) {
-  return request<API.Pet[]>('/pet/findByStatus', {
-    method: 'GET',
-    params: {
-      ...params,
-    },
-    ...(options || {}),
-  });
-}
-
-/** Finds Pets by tags Muliple tags can be provided with comma separated strings. Use         tag1, tag2, tag3 for testing. GET /pet/findByTags */
-export async function findPetsByTags(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.findPetsByTagsParams,
-  options?: { [key: string]: any },
-) {
-  return request<API.Pet[]>('/pet/findByTags', {
-    method: 'GET',
-    params: {
-      ...params,
-    },
-    ...(options || {}),
-  });
-}

+ 71 - 0
src/services/swagger/roleAdmin.ts

@@ -0,0 +1,71 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 角色详情 GET /apis/admin/role/details */
+export async function getRoleDetailsApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.getRoleDetailsApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.RoleVO>('/apis/admin/role/details', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 此处后端没有提供注释 POST /apis/admin/role/list */
+export async function postRoleListApi(options?: { [key: string]: any }) {
+  return request<SectApi.RoleVO[]>('/apis/admin/role/list', {
+    method: 'POST',
+    ...(options || {}),
+  });
+}
+
+/** 分页查询角色 POST /apis/admin/role/page */
+export async function postRolePageApi(
+  body: SectApi.RolePageQuery,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.IPageRoleVO>('/apis/admin/role/page', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 删除角色 DELETE /apis/admin/role/remove */
+export async function deleteRoleRemoveApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.deleteRoleRemoveApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/role/remove', {
+    method: 'DELETE',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 保存角色 POST /apis/admin/role/save */
+export async function postRoleSaveApi(
+  body: SectApi.RoleSaveQuery,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/role/save', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}

+ 86 - 0
src/services/swagger/staffAdmin.ts

@@ -0,0 +1,86 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 管理员详情 GET /apis/admin/staff/details */
+export async function getStaffDetailsApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.getStaffDetailsApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.StaffVO>('/apis/admin/staff/details', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 登录 POST /apis/admin/staff/login */
+export async function postStaffLoginApi(
+  body: SectApi.StaffLoginQuery,
+  options?: { [key: string]: any },
+) {
+  return request<string>('/apis/admin/staff/login', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 当前登录管理员信息 GET /apis/admin/staff/me */
+export async function getStaffMeApi(options?: { [key: string]: any }) {
+  return request<SectApi.StaffVO>('/apis/admin/staff/me', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+/** 分页查询管理员 POST /apis/admin/staff/page */
+export async function postStaffPageApi(
+  body: SectApi.StaffPageQuery,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.IPageStaffVO>('/apis/admin/staff/page', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 删除管理员 DELETE /apis/admin/staff/remove */
+export async function deleteStaffRemoveApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.deleteStaffRemoveApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/staff/remove', {
+    method: 'DELETE',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 保存管理员 POST /apis/admin/staff/save */
+export async function postStaffSaveApi(
+  body: SectApi.StaffSaveQuery,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/staff/save', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}

+ 0 - 48
src/services/swagger/store.ts

@@ -1,48 +0,0 @@
-// @ts-ignore
-/* eslint-disable */
-import { request } from '@umijs/max';
-
-/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */
-export async function getInventory(options?: { [key: string]: any }) {
-  return request<Record<string, any>>('/store/inventory', {
-    method: 'GET',
-    ...(options || {}),
-  });
-}
-
-/** Place an order for a pet POST /store/order */
-export async function placeOrder(body: API.Order, options?: { [key: string]: any }) {
-  return request<API.Order>('/store/order', {
-    method: 'POST',
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10.         Other values will generated exceptions GET /store/order/${param0} */
-export async function getOrderById(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.getOrderByIdParams,
-  options?: { [key: string]: any },
-) {
-  const { orderId: param0, ...queryParams } = params;
-  return request<API.Order>(`/store/order/${param0}`, {
-    method: 'GET',
-    params: { ...queryParams },
-    ...(options || {}),
-  });
-}
-
-/** Delete purchase order by ID For valid response try integer IDs with positive integer value.         Negative or non-integer values will generate API errors DELETE /store/order/${param0} */
-export async function deleteOrder(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.deleteOrderParams,
-  options?: { [key: string]: any },
-) {
-  const { orderId: param0, ...queryParams } = params;
-  return request<any>(`/store/order/${param0}`, {
-    method: 'DELETE',
-    params: { ...queryParams },
-    ...(options || {}),
-  });
-}

+ 347 - 67
src/services/swagger/typings.d.ts

@@ -1,112 +1,392 @@
-declare namespace API {
-  type ApiResponse = {
-    code?: number;
+declare namespace SectApi {
+  type AuthTicketQuery = {
+    /** 登录类型 */
+    loginType?: 'qq' | 'weiBo' | 'mobile' | 'weChat';
+    /** 客户端类型 */
+    clientType: 'app';
+  };
+
+  type AuthTicketVO = {
+    /** ticket,用于后续 Token 登录 */
+    ticket?: string;
+    /** 社交ID */
+    socialId?: string;
+    /** 社交类型 */
+    socialType?: string;
+    /** 名称 */
+    nickname?: string;
+    /** 头像-缩略图 */
+    avatarThumbnail?: string;
+    /** 头像-原图 */
+    avatarOriginal?: string;
+    /** 是否绑定手机号 */
+    hasBindMobile?: boolean;
+  };
+
+  type AuthTokenInfoVO = {
+    /** token */
+    token?: string;
+    /** 手机号 */
+    mobile?: string;
+    /** 名称 */
+    nickname?: string;
+    /** 头像-缩略图 */
+    avatarThumbnail?: string;
+    /** 头像-原图 */
+    avatarOriginal?: string;
+  };
+
+  type AuthTokenQuery = {
+    /** 登录类型 */
+    loginType: 'qq' | 'weiBo' | 'mobile' | 'weChat';
+    /** 客户端类型 */
+    clientType: 'app';
+    /** 通过 getTicket 获取的 ticket */
+    ticket?: string;
+  };
+
+  type Config = {
+    createTime?: string;
+    updateTime?: string;
+    id?: number;
     type?: string;
-    message?: string;
+    code?: string;
+    remark?: string;
+    content?: string;
+    permission?: number;
+  };
+
+  type ConfigPageQuery = {
+    cursor?: string;
+    direction?: string;
+    current?: number;
+    size?: number;
+    sorted?: string;
+    sortColumn?: string;
+    asc?: boolean;
+    desc?: boolean;
   };
 
-  type Category = {
+  type ConfigVO = {
+    /** 创建时间 */
+    createTime?: string;
+    /** 更新时间 */
+    updateTime?: string;
     id?: number;
-    name?: string;
+    type?: string;
+    code?: string;
+    remark?: string;
+    content?: string;
+    permission?: number;
   };
 
-  type deleteOrderParams = {
-    /** ID of the order that needs to be deleted */
-    orderId: number;
+  type deleteMenuRemoveApiParams = {
+    id: number;
   };
 
-  type deletePetParams = {
-    api_key?: string;
-    /** Pet id to delete */
-    petId: number;
+  type deleteRoleRemoveApiParams = {
+    id: number;
   };
 
-  type deleteUserParams = {
-    /** The name that needs to be deleted */
-    username: string;
+  type deleteStaffRemoveApiParams = {
+    id: number;
   };
 
-  type findPetsByStatusParams = {
-    /** Status values that need to be considered for filter */
-    status: ('available' | 'pending' | 'sold')[];
+  type deleteUserRemoveApiParams = {
+    id: number;
   };
 
-  type findPetsByTagsParams = {
-    /** Tags to filter by */
-    tags: string[];
+  type getConfigGetApiParams = {
+    code: string;
   };
 
-  type getOrderByIdParams = {
-    /** ID of pet that needs to be fetched */
-    orderId: number;
+  type getMenuDetailsApiParams = {
+    id: number;
   };
 
-  type getPetByIdParams = {
-    /** ID of pet to return */
-    petId: number;
+  type getRoleDetailsApiParams = {
+    id: number;
   };
 
-  type getUserByNameParams = {
-    /** The name that needs to be fetched. Use user1 for testing.  */
-    username: string;
+  type getStaffDetailsApiParams = {
+    id: number;
   };
 
-  type loginUserParams = {
-    /** The user name for login */
-    username: string;
-    /** The password for login in clear text */
-    password: string;
+  type getUserDetailsApiParams = {
+    id: number;
+  };
+
+  type IPageConfigVO = {
+    size?: number;
+    records?: ConfigVO[];
+    current?: number;
+    total?: number;
+    pages?: number;
+  };
+
+  type IPageRoleVO = {
+    size?: number;
+    records?: RoleVO[];
+    current?: number;
+    total?: number;
+    pages?: number;
+  };
+
+  type IPageStaffVO = {
+    size?: number;
+    records?: StaffVO[];
+    current?: number;
+    total?: number;
+    pages?: number;
+  };
+
+  type IPageUserVO = {
+    size?: number;
+    records?: UserVO[];
+    current?: number;
+    total?: number;
+    pages?: number;
+  };
+
+  type MenuSaveQuery = {
+    /** 菜单ID */
+    id?: number;
+    /** 1:目录 2:菜单 3:按钮) */
+    type?: 1 | 2 | 3;
+    /** 名称 */
+    name?: string;
+    /** 父菜单ID */
+    parentId?: number;
+    /** 显示顺序 */
+    sortNum?: number;
+    /** 请求地址 */
+    url?: string;
+    /** 1:页签 2:新窗口 */
+    target?: 1 | 2;
+    /** 菜单状态(1正常 2隐藏) */
+    status?: 1 | 2;
+    /** 是否刷新 0:不刷新 1:刷新 */
+    hasRefresh?: 0 | 1;
+    /** 权限标识 */
+    perms?: string;
+    /** 菜单图标 */
+    icon?: string;
+  };
+
+  type MenuTreeQuery = {
+    cursor?: string;
+    direction?: string;
+    current?: number;
+    size?: number;
+    sorted?: string;
+    sortColumn?: string;
+    /** 关键字 */
+    keyword?: string;
+    /** 状态(1正常 2隐藏) */
+    status?: 1 | 2;
+    asc?: boolean;
+    desc?: boolean;
   };
 
-  type Order = {
+  type MenuVO = {
+    /** 创建时间 */
+    createTime?: string;
+    /** 更新时间 */
+    updateTime?: string;
+    /** 菜单ID */
     id?: number;
-    petId?: number;
-    quantity?: number;
-    shipDate?: string;
-    /** Order Status */
-    status?: 'placed' | 'approved' | 'delivered';
-    complete?: boolean;
+    /** 1:目录 2:菜单 3:按钮) */
+    type?: 1 | 2 | 3;
+    /** 名称 */
+    name?: string;
+    /** 父菜单ID */
+    parentId?: number;
+    /** 显示顺序 */
+    sortNum?: number;
+    /** 请求地址 */
+    url?: string;
+    /** 1:页签 2:新窗口 */
+    target?: 1 | 2;
+    /** 菜单状态(1正常 2隐藏) */
+    status?: 1 | 2;
+    /** 是否刷新 0:不刷新 1:刷新 */
+    hasRefresh?: 0 | 1;
+    /** 权限标识 */
+    perms?: string;
+    /** 菜单图标 */
+    icon?: string;
+    /** 子菜单列表 */
+    children?: MenuVO[];
+  };
+
+  type Mobile =
+    // #/components/schemas/AuthTicketQuery
+    AuthTicketQuery & {
+      /** 手机号 */
+      mobile?: string;
+      /** 验证码 */
+      code?: string;
+      /** 社交票据 */
+      socialTicket?: string;
+    };
+
+  type postConfigListPrefixApiParams = {
+    prefix: string;
   };
 
-  type Pet = {
+  type postUserConfigListPrefixApiParams = {
+    prefix: string;
+  };
+
+  type Qq =
+    // #/components/schemas/AuthTicketQuery
+    AuthTicketQuery & {
+      /** accessToken */
+      accessToken?: string;
+    };
+
+  type RolePageQuery = {
+    cursor?: string;
+    direction?: string;
+    current?: number;
+    size?: number;
+    sorted?: string;
+    sortColumn?: string;
+    asc?: boolean;
+    desc?: boolean;
+  };
+
+  type RoleSaveQuery = {
+    /** 角色ID */
     id?: number;
-    category?: Category;
+    /** 角色名称 */
     name: string;
-    photoUrls: string[];
-    tags?: Tag[];
-    /** pet status in the store */
-    status?: 'available' | 'pending' | 'sold';
+    /** 显示顺序 */
+    sortNum?: number;
+    /** 角色状态(1:正常 2:停用) */
+    status?: 1 | 2;
+    /** 菜单ID列表 */
+    menuIds: number[];
   };
 
-  type Tag = {
+  type RoleVO = {
+    /** 创建时间 */
+    createTime?: string;
+    /** 更新时间 */
+    updateTime?: string;
+    /** 角色ID */
     id?: number;
+    /** 角色名称 */
     name?: string;
+    /** 显示顺序 */
+    sortNum?: number;
+    /** 角色状态(1:正常 2:停用) */
+    status?: 1 | 2;
+    /** 具备权限的菜单列表 */
+    menus?: MenuVO[];
+  };
+
+  type StaffLoginQuery = {
+    /** 用户名 */
+    username: string;
+    /** 密码 */
+    password: string;
   };
 
-  type updatePetWithFormParams = {
-    /** ID of pet that needs to be updated */
-    petId: number;
+  type StaffPageQuery = {
+    cursor?: string;
+    direction?: string;
+    current?: number;
+    size?: number;
+    sorted?: string;
+    sortColumn?: string;
+    asc?: boolean;
+    desc?: boolean;
   };
 
-  type updateUserParams = {
-    /** name that need to be updated */
+  type StaffSaveQuery = {
+    /** 管理员ID */
+    id?: number;
+    /** 用户名 */
     username: string;
+    /** 密码 */
+    password: string;
+    /** 昵称 */
+    nickname?: string;
+    /** 头像缩略图 */
+    thumbAvatar?: string;
+    /** 级别 */
+    level: 0 | 1 | 2;
+    /** 角色 */
+    roleIds: number[];
   };
 
-  type uploadFileParams = {
-    /** ID of pet to update */
-    petId: number;
+  type StaffVO = {
+    /** 创建时间 */
+    createTime?: string;
+    /** 更新时间 */
+    updateTime?: string;
+    /** 管理员ID */
+    id?: number;
+    /** 用户名 */
+    username?: string;
+    /** 昵称 */
+    nickname?: string;
+    /** 头像缩略图 */
+    thumbAvatar?: string;
+    /** 级别 */
+    level?: 0 | 1 | 2;
+    /** 角色列表 */
+    roles?: RoleVO[];
+    /** 具备权限的菜单列表 */
+    menus?: MenuVO[];
   };
 
-  type User = {
+  type UserConfig = {
+    createTime?: string;
+    updateTime?: string;
     id?: number;
-    username?: string;
-    firstName?: string;
-    lastName?: string;
-    email?: string;
-    password?: string;
-    phone?: string;
-    /** User Status */
-    userStatus?: number;
+    userId?: number;
+    type?: string;
+    code?: string;
+    remark?: string;
+    content?: string;
+  };
+
+  type UserPageQuery = {
+    cursor?: string;
+    direction?: string;
+    current?: number;
+    size?: number;
+    sorted?: string;
+    sortColumn?: string;
+    asc?: boolean;
+    desc?: boolean;
   };
+
+  type UserVO = {
+    /** 创建时间 */
+    createTime?: string;
+    /** 更新时间 */
+    updateTime?: string;
+    /** 用户ID */
+    id?: number;
+    /** 手机号 */
+    mobile?: string;
+    /** 用户名 */
+    nickname?: string;
+    /** 头像-缩略图 */
+    avatarThumbnail?: string;
+    /** 头像-原图 */
+    avatarOriginal?: string;
+  };
+
+  type WeiBo =
+    // #/components/schemas/AuthTicketQuery
+    AuthTicketQuery & {
+      /** accessToken */
+      accessToken?: string;
+      /** refreshToken */
+      refreshToken?: string;
+    };
 }

+ 0 - 100
src/services/swagger/user.ts

@@ -1,100 +0,0 @@
-// @ts-ignore
-/* eslint-disable */
-import { request } from '@umijs/max';
-
-/** Create user This can only be done by the logged in user. POST /user */
-export async function createUser(body: API.User, options?: { [key: string]: any }) {
-  return request<any>('/user', {
-    method: 'POST',
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** Get user by user name GET /user/${param0} */
-export async function getUserByName(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.getUserByNameParams,
-  options?: { [key: string]: any },
-) {
-  const { username: param0, ...queryParams } = params;
-  return request<API.User>(`/user/${param0}`, {
-    method: 'GET',
-    params: { ...queryParams },
-    ...(options || {}),
-  });
-}
-
-/** Updated user This can only be done by the logged in user. PUT /user/${param0} */
-export async function updateUser(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.updateUserParams,
-  body: API.User,
-  options?: { [key: string]: any },
-) {
-  const { username: param0, ...queryParams } = params;
-  return request<any>(`/user/${param0}`, {
-    method: 'PUT',
-    params: { ...queryParams },
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */
-export async function deleteUser(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.deleteUserParams,
-  options?: { [key: string]: any },
-) {
-  const { username: param0, ...queryParams } = params;
-  return request<any>(`/user/${param0}`, {
-    method: 'DELETE',
-    params: { ...queryParams },
-    ...(options || {}),
-  });
-}
-
-/** Creates list of users with given input array POST /user/createWithArray */
-export async function createUsersWithArrayInput(
-  body: API.User[],
-  options?: { [key: string]: any },
-) {
-  return request<any>('/user/createWithArray', {
-    method: 'POST',
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** Creates list of users with given input array POST /user/createWithList */
-export async function createUsersWithListInput(body: API.User[], options?: { [key: string]: any }) {
-  return request<any>('/user/createWithList', {
-    method: 'POST',
-    data: body,
-    ...(options || {}),
-  });
-}
-
-/** Logs user into the system GET /user/login */
-export async function loginUser(
-  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
-  params: API.loginUserParams,
-  options?: { [key: string]: any },
-) {
-  return request<string>('/user/login', {
-    method: 'GET',
-    params: {
-      ...params,
-    },
-    ...(options || {}),
-  });
-}
-
-/** Logs out current logged in user session GET /user/logout */
-export async function logoutUser(options?: { [key: string]: any }) {
-  return request<any>('/user/logout', {
-    method: 'GET',
-    ...(options || {}),
-  });
-}

+ 48 - 0
src/services/swagger/userAdmin.ts

@@ -0,0 +1,48 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 用户详情 GET /apis/admin/user/details */
+export async function getUserDetailsApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.getUserDetailsApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.UserVO>('/apis/admin/user/details', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 分页查询用户 POST /apis/admin/user/page */
+export async function postUserPageApi(
+  body: SectApi.UserPageQuery,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.IPageUserVO>('/apis/admin/user/page', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 删除用户 DELETE /apis/admin/user/remove */
+export async function deleteUserRemoveApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.deleteUserRemoveApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/user/remove', {
+    method: 'DELETE',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}

+ 45 - 0
src/services/swagger/userConfigClients.ts

@@ -0,0 +1,45 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 根据配置编码查询用户配置 POST /apis/clients/user_config/list */
+export async function postUserConfigListApi(body: string[], options?: { [key: string]: any }) {
+  return request<SectApi.ConfigVO[]>('/apis/clients/user_config/list', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 根据配置编码前缀查询用户配置 POST /apis/clients/user_config/list_prefix */
+export async function postUserConfigListPrefixApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.postUserConfigListPrefixApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.ConfigVO[]>('/apis/clients/user_config/list_prefix', {
+    method: 'POST',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 批量保存用户配置 POST /apis/clients/user_config/save_batch */
+export async function postUserConfigSaveBatchApi(
+  body: SectApi.UserConfig[],
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/clients/user_config/save_batch', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}

+ 27 - 0
src/services/swagger/yonghuqiandaokehuduanApi.ts

@@ -0,0 +1,27 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 获取用户签到次数 GET /apis/clients/user_sign/cnt */
+export async function getUserSignCntApi(options?: { [key: string]: any }) {
+  return request<number>('/apis/clients/user_sign/cnt', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+/** 获取用户签到列表 GET /apis/clients/user_sign/list */
+export async function getUserSignListApi(options?: { [key: string]: any }) {
+  return request<number[]>('/apis/clients/user_sign/list', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+/** 用户签到 GET /apis/clients/user_sign/sign */
+export async function getUserSignSignApi(options?: { [key: string]: any }) {
+  return request<boolean>('/apis/clients/user_sign/sign', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}

+ 87 - 0
src/services/swagger/zidianpeizhiguanlihoutaiApi.ts

@@ -0,0 +1,87 @@
+// @ts-ignore
+/* eslint-disable */
+import { invoke as request } from '@/core/network';
+
+/** 根据ID获取字典配置 GET /apis/admin/config/get */
+export async function getConfigGetApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.getConfigGetApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.ConfigVO>('/apis/admin/config/get', {
+    method: 'GET',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 根据ID获取字典配置 POST /apis/admin/config/list */
+export async function postConfigListApi(body: string[], options?: { [key: string]: any }) {
+  return request<SectApi.ConfigVO[]>('/apis/admin/config/list', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 根据前缀获取字典配置 POST /apis/admin/config/list_prefix */
+export async function postConfigListPrefixApi(
+  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
+  params: SectApi.postConfigListPrefixApiParams,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.ConfigVO[]>('/apis/admin/config/list_prefix', {
+    method: 'POST',
+    params: {
+      ...params,
+    },
+    ...(options || {}),
+  });
+}
+
+/** 分页查询字典配置 POST /apis/admin/config/page */
+export async function postConfigPageApi(
+  body: SectApi.ConfigPageQuery,
+  options?: { [key: string]: any },
+) {
+  return request<SectApi.IPageConfigVO>('/apis/admin/config/page', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 保存字典配置 POST /apis/admin/config/save */
+export async function postConfigSaveApi(body: SectApi.Config, options?: { [key: string]: any }) {
+  return request<boolean>('/apis/admin/config/save', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}
+
+/** 批量保存字典配置 POST /apis/admin/config/save_batch */
+export async function postConfigSaveBatchApi(
+  body: SectApi.Config[],
+  options?: { [key: string]: any },
+) {
+  return request<boolean>('/apis/admin/config/save_batch', {
+    method: 'POST',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    data: body,
+    ...(options || {}),
+  });
+}

+ 85 - 0
src/utils/tree.ts

@@ -0,0 +1,85 @@
+import { isArray, isUndefined } from "lodash"
+
+interface TreeHelperConfig {
+  id: string
+  children: string
+  pid: string
+}
+
+type TreeHelperConfigParams = Partial<TreeHelperConfig>
+
+// 默认配置
+const DEFAULT_CONFIG: TreeHelperConfig = {
+  id: 'id',
+  children: 'children',
+  pid: 'pid',
+}
+
+// 获取配置。  Object.assign 从一个或多个源对象复制到目标对象
+const getConfig = (config: TreeHelperConfigParams) => Object.assign({}, DEFAULT_CONFIG, config)
+
+/**
+ * @description 对称格式化树
+ * @param {T[]} tree
+ * @param {R[]} referTree
+ * @param {(n: T, r?: R) => Undefinable<T>} formatFunc
+ * @param {Partial<DefaultConfig>} config
+ * @return {T[]}
+ */
+export function treeFormatBySymmetry<T = Recordable, R = Recordable>(
+  tree: T[],
+  referTree: R[],
+  formatFunc: (n: T, r?: R) => T | undefined = n => n,
+  config: {
+    treeConfig?: TreeHelperConfigParams
+    referConfig?: TreeHelperConfigParams
+  } = {},
+): T[] {
+  const {
+    treeConfig: customTreeConfig = {},
+    referConfig: customReferConfig = {},
+  } = config
+
+  const treeConfig = getConfig(customTreeConfig)
+  const treeChildren = treeConfig.children
+
+  const referConfig = getConfig(customReferConfig)
+  const referConfigChildren = referConfig.children
+
+  function treeFormat(tree: T[], referTree?: R[]) {
+    const outputTree: T[] = []
+    for (let i = 0; i < tree.length; i++) {
+      const node: T = tree[i]
+      let formatedNode: T | undefined
+      let referNode: R | undefined
+
+      if (isArray(referTree) && referTree.length > 0) {
+        for (let k = 0; k < referTree.length; k++) {
+          const refer = referTree[k]
+          formatedNode = formatFunc(node, refer)
+          referNode = refer
+          if (formatedNode)
+            break
+        }
+      }
+      else {
+        formatedNode = formatFunc(node)
+      }
+
+      if (!isUndefined(formatedNode)) {
+        if (isArray((node as Recordable)?.[treeChildren])) {
+          (formatedNode as Recordable)[treeChildren] = treeFormat(
+            (node as Recordable)[treeChildren],
+            (referNode as Recordable)?.[referConfigChildren],
+          )
+        }
+
+        outputTree.push(formatedNode)
+      }
+    }
+
+    return outputTree
+  }
+
+  return treeFormat(tree, referTree)
+}

+ 5 - 0
src/utils/util.ts

@@ -0,0 +1,5 @@
+export function toHump(name: string) {
+  return name.replace(/_(\w)/g, function(_, letter){
+      return letter.toUpperCase();
+  });
+}

+ 0 - 324
types/cache/mock/login.mock.cache.js

@@ -1,324 +0,0 @@
-module.exports = {
-  'GET /api/currentUser': {
-    data: {
-      name: 'Serati Ma',
-      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
-      userid: '00000001',
-      email: 'antdesign@alipay.com',
-      signature: '海纳百川,有容乃大',
-      title: '交互专家',
-      group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
-      tags: [
-        { key: '0', label: '很有想法的' },
-        { key: '1', label: '专注设计' },
-        { key: '2', label: '辣~' },
-        { key: '3', label: '大长腿' },
-        { key: '4', label: '川妹子' },
-        { key: '5', label: '海纳百川' },
-      ],
-      notifyCount: 12,
-      unreadCount: 11,
-      country: 'China',
-      geographic: {
-        province: { label: '浙江省', key: '330000' },
-        city: { label: '杭州市', key: '330100' },
-      },
-      address: '西湖区工专路 77 号',
-      phone: '0752-268888888',
-    },
-  },
-  'GET /api/rule': {
-    data: [
-      {
-        key: 99,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 99',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 503,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 81,
-      },
-      {
-        key: 98,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 98',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 164,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 12,
-      },
-      {
-        key: 97,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 97',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 174,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 81,
-      },
-      {
-        key: 96,
-        disabled: true,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 96',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 914,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 7,
-      },
-      {
-        key: 95,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 95',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 698,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 82,
-      },
-      {
-        key: 94,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 94',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 488,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 14,
-      },
-      {
-        key: 93,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 93',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 580,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 77,
-      },
-      {
-        key: 92,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 92',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 244,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 58,
-      },
-      {
-        key: 91,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 91',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 959,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 66,
-      },
-      {
-        key: 90,
-        disabled: true,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 90',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 958,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 72,
-      },
-      {
-        key: 89,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 89',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 301,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 2,
-      },
-      {
-        key: 88,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 88',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 277,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 12,
-      },
-      {
-        key: 87,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 87',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 810,
-        status: '1',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 82,
-      },
-      {
-        key: 86,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 86',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 780,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 22,
-      },
-      {
-        key: 85,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 85',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 705,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 12,
-      },
-      {
-        key: 84,
-        disabled: true,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 84',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 203,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 79,
-      },
-      {
-        key: 83,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 83',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 491,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 59,
-      },
-      {
-        key: 82,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 82',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 73,
-        status: '0',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 100,
-      },
-      {
-        key: 81,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
-        name: 'TradeCode 81',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 406,
-        status: '3',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 61,
-      },
-      {
-        key: 80,
-        disabled: false,
-        href: 'https://ant.design',
-        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
-        name: 'TradeCode 80',
-        owner: '曲丽丽',
-        desc: '这是一段描述',
-        callNo: 112,
-        status: '2',
-        updatedAt: '2022-12-06T05:00:57.040Z',
-        createdAt: '2022-12-06T05:00:57.040Z',
-        progress: 20,
-      },
-    ],
-    total: 100,
-    success: true,
-    pageSize: 20,
-    current: 1,
-  },
-  'POST /api/login/outLogin': { data: {}, success: true },
-  'POST /api/login/account': {
-    status: 'ok',
-    type: 'account',
-    currentAuthority: 'admin',
-  },
-};

+ 0 - 0
types/cache/mock/mock.cache.js


+ 6 - 0
types/index.d.ts

@@ -118,3 +118,9 @@ export namespace API {
     currentAuthority: string;
   };
 }
+
+declare global {
+  type Recordable<T = any> = Record<string, T>
+  type ObjectEnum<T = string | number, K = string | number> = Record<K, T>
+  type NonNullableRecord<T> = { [P in keyof T]-?: NonNullableRecord<NonNullable<T[P]>> };
+}