@oj-module/cli 0.2.50 → 0.2.54
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.
- package/devkit/SKILL.md +2 -2
- package/devkit/manual.md +32 -25
- package/devkit/wecom-internal-app.md +111 -4
- package/package.json +2 -2
- package/shell-dist/assets/{index-FYt9CjFd.js → index-e_Mp2mb5.js} +5 -1
- package/shell-dist/assets/runtime.js +29 -5
- package/shell-dist/index.html +9 -12
- package/shell-dist/versions.json +3 -3
- package/src/__tests__/templates-tenant-scope.test.ts +3 -2
- package/src/build.ts +19 -2
- package/src/config.ts +9 -0
- package/src/contract/__tests__/client-path.test.ts +30 -0
- package/src/contract/__tests__/emit-client.test.ts +18 -0
- package/src/contract/__tests__/handler-scan.test.ts +23 -0
- package/src/contract/check.ts +5 -5
- package/src/contract/client-path.ts +30 -0
- package/src/contract/emit-client.ts +18 -4
- package/src/contract/handler-scan.ts +40 -3
- package/src/contract/run.ts +5 -3
- package/src/init.ts +19 -1
- package/src/shared-deps.ts +27 -9
- package/src/site-base.ts +1 -1
- package/templates/README.md +40 -44
- package/templates/init.include.yaml +15 -14
- package/templates/openapi.json +3422 -1955
- package/templates/src/_platform/api/_shared/service/domain/users.ts +40 -4
- package/templates/src/_platform/api/contacts/api.ts +29 -1
- package/templates/src/_platform/api/contacts/detail/api.ts +25 -1
- package/templates/src/_platform/api/solutions/api.ts +60 -1
- package/templates/src/_platform/web/__client/api.schemas.ts +99 -35
- package/templates/src/_platform/web/__client/api.ts +103 -59
- package/templates/src/app/web/entry.ts +77 -0
- package/templates/src/{home/web → app/web/home}/__client/api.ts +5 -2
- package/templates/src/app/web/home/routes.ts +41 -0
- package/templates/src/{login/web → app/web/login}/pages/login.tsx +54 -24
- package/templates/src/app/web/login/routes.ts +71 -0
- package/templates/src/{notification/web → app/web/notification}/__client/api.schemas.ts +14 -0
- package/templates/src/{notification/web → app/web/notification}/__client/api.ts +67 -20
- package/templates/src/app/web/notification/routes.ts +70 -0
- package/templates/src/{personal-center/web → app/web/personal-center}/__client/api.ts +5 -2
- package/templates/src/app/web/personal-center/routes.ts +49 -0
- package/templates/src/{system/web → app/web/system}/__client/api.schemas.ts +28 -22
- package/templates/src/{system/web → app/web/system}/__client/api.ts +103 -58
- package/templates/src/{system/web → app/web/system}/locales/en-US.json +14 -0
- package/templates/src/{system/web → app/web/system}/locales/zh-CN.json +14 -0
- package/templates/src/{system/web → app/web/system}/pages/users/index.tsx +5 -2
- package/templates/src/{system/web → app/web/system}/pages/users/roles.tsx +14 -3
- package/templates/src/{system/web → app/web/system}/pages/wecom/index.tsx +139 -1
- package/templates/src/app/web/system/routes.ts +97 -0
- package/templates/src/auth/api/_shared/wecom/admin.ts +4 -0
- package/templates/src/auth/api/_shared/wecom/client.ts +9 -2
- package/templates/src/auth/api/_shared/wecom/events.ts +3 -0
- package/templates/src/auth/api/_shared/wecom/tenant-admin.ts +194 -0
- package/templates/src/auth/api/api.ts +59 -0
- package/templates/src/auth/api/ldap-login/api.ts +37 -1
- package/templates/src/auth/api/wecom/admin/tenant-admin/api.ts +41 -0
- package/templates/src/auth/api/wecom/admin/tenant-admin/password/api.ts +66 -0
- package/templates/src/auth/api/wecom/api.ts +23 -0
- package/templates/src/auth/web/__client/api.schemas.ts +133 -13
- package/templates/src/auth/web/__client/api.ts +129 -31
- package/templates/src/notification/api/api.ts +17 -0
- package/templates/src/notification/api/del/api.ts +2 -0
- package/templates/src/system/api/roles/api.ts +3 -0
- package/templates/src/system/api/roles/bindings/api.ts +3 -0
- package/templates/src/system/api/settings/api.ts +6 -3
- package/templates/src/system/api/users/forbidden/api.ts +3 -0
- package/templates/src/system/api/users/password/api.ts +3 -0
- package/templates/src/system/api/users/roles/api.ts +3 -0
- package/templates/src/web/api/get-async-routes/api.ts +16 -1
- package/templates/src/web/api/hello/api.ts +13 -1
- package/templates/src/web/api/user-info/api.ts +21 -1
- package/templates/src/web/web/__client/api.schemas.ts +28 -0
- package/templates/src/web/web/__client/api.ts +33 -9
- package/templates/tsconfig.paths.json +0 -1
- package/templates/web.config.ts +22 -17
- package/vendor/host-versions.json +3 -3
- package/shell-dist/assets/echarts-charts.js +0 -58571
- package/shell-dist/assets/echarts-features.js +0 -24057
- package/shell-dist/assets/echarts-for-react.js +0 -704
- package/shell-dist/assets/echarts.js +0 -82916
- package/shell-dist/assets/editor.js +0 -161457
- package/shell-dist/assets/vditor-index-css.js +0 -7
- package/shell-dist/assets/vditor.js +0 -15223
- package/templates/src/demo/api/manifest.yaml +0 -5
- package/templates/src/demo/api/migrations/0001__create_todos.sql +0 -9
- package/templates/src/demo/api/migrations/0002__tenant.mysql.sql +0 -2
- package/templates/src/demo/api/migrations/0002__tenant.sql +0 -2
- package/templates/src/demo/api/schema.yaml +0 -12
- package/templates/src/demo/api/seed.sql +0 -5
- package/templates/src/demo/api/todos/api.ts +0 -59
- package/templates/src/demo/web/__client/api.schemas.ts +0 -20
- package/templates/src/demo/web/__client/api.ts +0 -89
- package/templates/src/demo/web/entry.ts +0 -42
- package/templates/src/demo/web/locales/en-US.json +0 -10
- package/templates/src/demo/web/locales/zh-CN.json +0 -10
- package/templates/src/demo/web/pages/index.tsx +0 -45
- package/templates/src/home/web/entry.ts +0 -49
- package/templates/src/login/web/entry.ts +0 -79
- package/templates/src/notification/web/entry.ts +0 -84
- package/templates/src/personal-center/web/entry.ts +0 -60
- package/templates/src/system/web/entry.ts +0 -108
- /package/templates/src/{home/web → app/web/home}/__client/api.schemas.ts +0 -0
- /package/templates/src/{home/web → app/web/home}/locales/en-US.json +0 -0
- /package/templates/src/{home/web → app/web/home}/locales/zh-CN.json +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/bar-chart.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/card-list.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/line-chart.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/pie-chart.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/index.tsx +0 -0
- /package/templates/src/{login/web → app/web/login}/auth-provider.ts +0 -0
- /package/templates/src/{login/web → app/web/login}/locales/en-US.json +0 -0
- /package/templates/src/{login/web → app/web/login}/locales/zh-CN.json +0 -0
- /package/templates/src/{login/web → app/web/login}/pages/change-password.tsx +0 -0
- /package/templates/src/{login/web → app/web/login}/wecom.ts +0 -0
- /package/templates/src/{notification/web → app/web/notification}/locales/en-US.json +0 -0
- /package/templates/src/{notification/web → app/web/notification}/locales/zh-CN.json +0 -0
- /package/templates/src/{notification/web → app/web/notification}/pages/center/index.tsx +0 -0
- /package/templates/src/{personal-center/web → app/web/personal-center}/__client/api.schemas.ts +0 -0
- /package/templates/src/{personal-center/web → app/web/personal-center}/locales/en-US.json +0 -0
- /package/templates/src/{personal-center/web → app/web/personal-center}/locales/zh-CN.json +0 -0
- /package/templates/src/{personal-center/web → app/web/personal-center}/pages/my-profile/index.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/departments/index.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/departments/sync-bar.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/departments/tree.ts +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/errors.ts +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/forbidden.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/login-methods/index.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/oplog/index.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/roles/index.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/settings/index.tsx +0 -0
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type { AppRouteRecordRaw } from "@oj-module/runtime";
|
|
2
|
-
|
|
3
|
-
import { SettingOutlined } from "@ant-design/icons";
|
|
4
|
-
import { defineModule } from "@oj-module/runtime";
|
|
5
|
-
|
|
6
|
-
import { createElement, lazy } from "react";
|
|
7
|
-
|
|
8
|
-
import { createSystemClient } from "./__client/api";
|
|
9
|
-
|
|
10
|
-
const Users = lazy(() => import("./pages/users"));
|
|
11
|
-
const UserRoles = lazy(() => import("./pages/users/roles"));
|
|
12
|
-
const Departments = lazy(() => import("./pages/departments"));
|
|
13
|
-
const Roles = lazy(() => import("./pages/roles"));
|
|
14
|
-
const Oplog = lazy(() => import("./pages/oplog"));
|
|
15
|
-
const Settings = lazy(() => import("./pages/settings"));
|
|
16
|
-
const LoginMethods = lazy(() => import("./pages/login-methods"));
|
|
17
|
-
const WecomAdmin = lazy(() => import("./pages/wecom"));
|
|
18
|
-
|
|
19
|
-
const routes: AppRouteRecordRaw[] = [
|
|
20
|
-
{
|
|
21
|
-
path: "/system",
|
|
22
|
-
handle: {
|
|
23
|
-
icon: createElement(SettingOutlined),
|
|
24
|
-
title: "system:menu.system",
|
|
25
|
-
// 负 order = 底部固定区:系统管理 pin 在侧边栏底部(2026-10-20 序轴约定)
|
|
26
|
-
order: -100,
|
|
27
|
-
layout: "container",
|
|
28
|
-
},
|
|
29
|
-
children: [
|
|
30
|
-
{
|
|
31
|
-
path: "/system/users",
|
|
32
|
-
Component: Users,
|
|
33
|
-
handle: { title: "system:menu.users" },
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
// 成员资格(superadmin 入口从用户管理页进入,菜单不出现)
|
|
37
|
-
path: "/system/users/:uid/roles",
|
|
38
|
-
Component: UserRoles,
|
|
39
|
-
handle: { title: "system:menu.userRoles", hideInMenu: true },
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
path: "/system/departments",
|
|
43
|
-
Component: Departments,
|
|
44
|
-
handle: { title: "system:menu.departments" },
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
path: "/system/roles",
|
|
48
|
-
Component: Roles,
|
|
49
|
-
handle: { title: "system:menu.roles" },
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
path: "/system/oplog",
|
|
53
|
-
Component: Oplog,
|
|
54
|
-
handle: { title: "system:menu.oplog" },
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
path: "/system/settings",
|
|
58
|
-
Component: Settings,
|
|
59
|
-
handle: { title: "system:menu.settings" },
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
path: "/system/login-methods",
|
|
63
|
-
Component: LoginMethods,
|
|
64
|
-
handle: { title: "system:menu.loginMethods" },
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
// 企微代开发后台(服务商运营面):页面内再判一次 superadmin(路由级不做角色门禁,
|
|
68
|
-
// 与 users/roles 页同策略——403 面板比路由消失更容易解释)
|
|
69
|
-
path: "/system/wecom",
|
|
70
|
-
Component: WecomAdmin,
|
|
71
|
-
handle: { title: "system:menu.wecom" },
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
];
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* system 模块:框架管理面(用户/成员资格/角色权限/操作日志/站点设置/登录方式),
|
|
79
|
-
* 数据源为 oj 后端 /api/system/*(模板 api 模块)。__client 不随模板分发——
|
|
80
|
-
* init 后 `oj openapi -o openapi.json` + `ojm api` 生成(生成前本文件 ts 报红属预期,
|
|
81
|
-
* devkit manual §2.2)。
|
|
82
|
-
*/
|
|
83
|
-
export default defineModule({
|
|
84
|
-
name: "system",
|
|
85
|
-
description: "系统管理模块(框架管理面)",
|
|
86
|
-
version: "0.1.0",
|
|
87
|
-
peerRuntime: ">=0.0.0",
|
|
88
|
-
// 路由级门禁(B16):非系统管理员不注入 /system 路由、菜单不可见;
|
|
89
|
-
// API 级 403 由 assertSystemAdmin + service 层硬 enforcement 兜底。
|
|
90
|
-
// 角色口径对齐后端 assertSystemAdmin(access.ts:87)——superadmin **或**
|
|
91
|
-
// admin 均可,两者必须同时保留:D12(2026-10-22)起账号名=角色名,admin 与
|
|
92
|
-
// superadmin 是两个独立账号(seed.sql),只留 ["admin"] 会把 superadmin 挡在
|
|
93
|
-
// 门外(注册期过滤 → 路由消失 → 登录后 404 兜底)。改这两个值前先跑
|
|
94
|
-
// tests/system-guard.regression.spec.ts(只留 ["admin"] 会立刻变红)。
|
|
95
|
-
config: { requiredRoles: ["admin", "superadmin"] },
|
|
96
|
-
routes,
|
|
97
|
-
i18n: {
|
|
98
|
-
"zh-CN": () => import("./locales/zh-CN.json"),
|
|
99
|
-
"en-US": () => import("./locales/en-US.json"),
|
|
100
|
-
},
|
|
101
|
-
lifecycle: {
|
|
102
|
-
async onInit(ctx) {
|
|
103
|
-
// 构造即接线:登记 /system 前缀 + 绑定 scoped request(D11 前缀收敛),
|
|
104
|
-
// 页面直接 import 生成的端点函数(模块级单槽 req 已由本调用绑定)。
|
|
105
|
-
createSystemClient(ctx);
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/src/{personal-center/web → app/web/personal-center}/__client/api.schemas.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/src/{personal-center/web → app/web/personal-center}/pages/my-profile/index.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|