# wujies-gallery-plugin
**Repository Path**: wujies/wujies-gallery-plugin
## Basic Information
- **Project Name**: wujies-gallery-plugin
- **Description**: 多租户图床与相册:图片、分类、标签、相册、访问日志与存储配置。
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2026-10-23
- **Last Updated**: 2026-10-28
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 图床管理 插件(`wujies-gallery-plugin`)
> 多租户图床与相册:图片、分类、标签、相册、访问日志与存储配置。
应用编码 `gallery` | 应用版本 `1.0.5` | 后端构件 `wujies-gallery-plugin`
一个插件一个仓库:后端 Maven 模块在**仓库根**,前端远程应用在 `frontend/`。
## 界面截图
**图床管理主界面**

## 仓库布局
| 位置 | 内容 |
|---|---|
| `pom.xml` | Maven 模块(父 pom = `cn.wujies.plugins:wujies-plugins-parent`,`` 已置空) |
| `app.json` | 应用清单,打包器读的**唯一事实来源**(`code` / `version` / `menus` / `assets`) |
| `src/`、`migrations/` | Java 源码与建表/种子脚本(本仓库后端 60 个文件) |
| `frontend/` | 远程应用源码(30 个文件),入口 `frontend/src/index.ts` |
## 拆分状态(读之前先看这条)
本仓库是从 `wujies-plugins` 单体仓库**搬出来的第一版**,两件事还没跟上:
- **后端**:本机 `mvn -B -o package -DskipTests` 实测**通过**(前提:`wujies-plugins-parent` 与 `wujies-common-*` 已在 `~/.m2`)。陌生人 clone 后会卡在找不到父 pom —— 要等后端 BOM / 构件发布那一阶段。
- **前端**:已迁到已发布的 `@wujies/*` SDK(`ui-shared` / `components` / `api-client` / `ui-plugin-bundler-kit`)。frontend/vite.config.ts 只声明 `defineRemoteApp({ appCode, root })`,共享依赖一律 external、运行期由宿主 import map 兜到同一份实例;宿主独有工具与业务模块(`@/utils/wujies`、`@/api/system/*`、`UserSelect`/`MemberSelect` 等)按原样复制进了 `frontend/src/`,`proxy?.$modal` / `useDict` / `download` 与 `ImageUpload`/`UserDetail`/`Module*Settings` 由宿主运行时提供。本仓库前端可独立构建:`cd frontend && npm install && npm run build`(产物 `dist/index.js` + `assets/gallery-app.css`);要直接落位到宿主,构建前设 `WUJIES_FRONTEND_DIST=/app-market-dist/remote-apps`。
- **打包**:本仓库自带**完整**的 `package.ps1`(母本在 `wujies-plugins` 仓库根,各仓用 `node scripts/sync-package-script.mjs` 同步过来),clone 下来就能在本仓库根直接体检、构建、签名、出包、生成密钥,不需要回到单体仓库,也不需要手工传产物路径:
```powershell
# 都在本仓库根执行
powershell -NoProfile -ExecutionPolicy Bypass -File package.ps1 -CheckOnly # ① 打包前检查:清单/产物/迁移/菜单/密钥,几秒返回
powershell -NoProfile -ExecutionPolicy Bypass -File package.ps1 -Dev # ② 开发包:不签名,落 ..\.plugin-dist\gallery\dev
powershell -NoProfile -ExecutionPolicy Bypass -File package.ps1 # ③ 正式包:构建 + 用 keys\private.pem 签名
```
判据是「脚本所在仓库根有没有 `app.json`」,所以在本仓库里**不要传 `-Plugin`**(它按子目录找清单,会报「找不到插件目录」);`-FrontendProject` / `-FrontendDist` 也不用传 —— 独立布局的前端工程固定就是本仓库 `frontend/`、产物 `frontend/dist`,脚本自己跑 `npm run build`(首次先 `cd frontend && npm install`,缺依赖时脚本会把这条命令直接报给你)。只想复用现成产物就加 `-SkipBuild`。
`-SkipFrontend` 只用于**没有前端**的纯后端应用:带前端时它会连「复制前端产物」一起跳过,出的包只有 `app.json`,装上去没有界面。
`-CheckOnly` 打出的 `CHECK|级别|项|说明` 行就是管理端「应用上架 → 插件开发 → 打包」抽屉里那份体检清单,两边跑的是同一套检查;有 ERROR 时正式打包会被直接拦下。签名密钥在本仓库 `keys/`(`private.pem` + `public.pem`,已在 `.gitignore` 里),生成或更换用 `-Keygen`(覆盖已有密钥要显式加 `-KeygenForce`,旧钥先整份备份进 `keys\backup\<时间戳>\`)。参数全表与产物结构见文档站 docs.wujies.cn 的「打包应用」与「密钥与签名」两页。
包内产物路径由 `app.json` 的 `assets` 决定:`frontend` → `frontend/index.js` | `backend` → `backend/wujies-gallery-plugin-1.0.5.jar`
参考:`wujies-hello-plugin` 仓库(已按新布局跑通前端独立构建的样板)、`wujies-ui` 仓库(npm 上 `@wujies/*` 四件套的源码仓)、文档站 docs.wujies.cn 的「插件开发」章节。
## 许可
MIT。