@jiangood/open-admin 2.0.0 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/config/config.js +9 -22
  2. package/package.json +5 -1
  3. package/src/.umi-production/appData.json +67 -108
  4. package/src/.umi-production/core/route.tsx +1 -2
  5. package/src/.umi-production/umi.ts +2 -2
  6. package/src/framework/components/Gap/index.tsx +37 -41
  7. package/src/framework/components/Page/index.less +1 -1
  8. package/src/framework/components/Page/index.tsx +19 -22
  9. package/src/framework/components/ViewRange/index.tsx +12 -17
  10. package/src/framework/components/system/ButtonList.tsx +12 -32
  11. package/src/framework/fields/FieldEditor/index.tsx +3 -2
  12. package/src/framework/fields/FieldUploadFile/index.tsx +8 -4
  13. package/src/framework/utils/MessageUtils.tsx +21 -99
  14. package/src/framework/utils/system/HttpUtils.ts +2 -1
  15. package/src/framework/utils/system/SysUtils.ts +8 -0
  16. package/src/layouts/PageRender.d.ts +2 -17
  17. package/src/layouts/PageRender.jsx +14 -76
  18. package/src/layouts/admin/TabPageRender.jsx +138 -158
  19. package/src/layouts/admin/index.jsx +120 -17
  20. package/src/layouts/admin/index.less +123 -5
  21. package/src/layouts/index.jsx +78 -161
  22. package/src/loading.jsx +17 -16
  23. package/src/pages/404.jsx +7 -5
  24. package/src/pages/about.jsx +3 -3
  25. package/src/pages/index.jsx +4 -5
  26. package/src/pages/login.jsx +16 -9
  27. package/src/pages/login.less +0 -1
  28. package/src/pages/system/dict/index.jsx +7 -10
  29. package/src/pages/system/file/index.jsx +5 -5
  30. package/src/pages/system/job/index.jsx +9 -7
  31. package/src/pages/system/log/index.jsx +4 -5
  32. package/src/pages/system/manual/index.jsx +6 -4
  33. package/src/pages/system/org/index.jsx +4 -2
  34. package/src/pages/system/role/index.jsx +9 -7
  35. package/src/pages/system/role/perm.jsx +3 -4
  36. package/src/pages/system/user/index.jsx +8 -6
  37. package/src/pages/userCenter/index.jsx +1 -1
  38. package/src/pages/userCenter/message.jsx +4 -2
  39. package/src/pages/system/api/index.jsx +0 -279
package/config/config.js CHANGED
@@ -19,35 +19,22 @@ function getPluginDir() {
19
19
 
20
20
  const pluginDir = getPluginDir();
21
21
 
22
+ const SERVLET_CONTEXT = process.env.SERVLET_CONTEXT || '/change-this-servlet-context'; // 见 .env
23
+
22
24
  const proxyConfig = {
23
- '/admin': {
24
- target: `http://${host}`,
25
- changeOrigin: true,
26
- },
27
- '/preview': {
28
- target: `http://${host}`,
29
- changeOrigin: true,
30
- },
31
- '/ureport': {
32
- target: `http://${host}`,
33
- changeOrigin: true,
34
- },
35
- '/swagger-ui': {
36
- target: `http://${host}`,
37
- changeOrigin: true,
38
- },
39
- '/v3/api-docs': {
25
+ [SERVLET_CONTEXT]: {
40
26
  target: `http://${host}`,
41
27
  changeOrigin: true,
42
28
  },
43
- '/admin/ws': {
44
- target: `ws://${host}`,
45
- changeOrigin: true,
46
- ws: true,
47
- },
48
29
  };
49
30
 
50
31
  export default defineConfig({
32
+ // 注入全局变量,前端代码可直接使用 SERVLET_CONTEXT
33
+ define: {
34
+ SERVLET_CONTEXT: SERVLET_CONTEXT,
35
+ },
36
+ // 资源使用相对路径,部署到任意 context-path 下都无需重新构建
37
+ publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
51
38
  // 配置是否让生成的文件包含 hash 后缀,通常用于增量发布和避免浏览器加载缓存
52
39
  hash: true,
53
40
  // 使用 hash 模式的路由
package/package.json CHANGED
@@ -22,6 +22,10 @@
22
22
  "umi": "^4.0.0"
23
23
  },
24
24
  "name": "@jiangood/open-admin",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/jiangood/open-admin"
28
+ },
25
29
  "description": "open-admin",
26
30
  "files": [
27
31
  "src/*",
@@ -34,5 +38,5 @@
34
38
  "dev": "umi dev",
35
39
  "build": "umi build"
36
40
  },
37
- "version": "2.0.0"
41
+ "version": "2.2.4"
38
42
  }