Commit Graph

24 Commits

Author SHA1 Message Date
lzh
680c965a27 新增: 多项目切换 + 业务平台 SSO 单点跳转
核心功能:
1. 多项目切换:header 新增 ProjectDropdown,切项目时自动刷新权限菜单
2. 业务平台 SSO:header 新增「业务平台」按钮,OAuth2 授权码流程无感跳转
3. SSO 回调:/sso-callback 页面接收业务平台跳回的 code,换 IoT token 登录

共享包改动:
- packages/stores:access store 新增 projectId 字段并加入持久化
- packages/effects/layouts:新增 ProjectDropdown 共享组件

apps/web-antd 改动:
- api/request.ts:
  · project-id 请求头仅在非 null 时设置(避免 axios 把 null 序列化为字符串 "null")
  · X-Client-Id 改读 VITE_APP_CLIENT_ID,允许多个壳应用各自声明
- api/core/sso.ts:ssoCallback 参数走 body,避免 code 出现在浏览器历史/nginx 日志
- api/system/project:新增项目 simple-list API
- constants/sso.ts:集中 IOT_CLIENT_ID/BIZ_CLIENT_ID 等常量;
  generateOauthState 用 crypto.randomUUID 生成 state,替代不安全的 Math.random
- store/auth.ts:抽 completeLogin 公共收尾逻辑,新增 ssoLogin 复用
- views/_core/authentication/sso-callback.vue:SSO 回调页;
  dev 模式保留时延日志,失败时通过 query 透给登录页
- router/routes/core.ts:/sso-callback 路由 + beforeEnter 守卫
  (缺 code 直接拦回登录页,避免死循环)
- layouts/basic.vue:
  · 以 ProjectDropdown 替换 TenantDropdown(列表拉取失败兜底隐藏)
  · 切项目时调用 fetchUserInfo,避免菜单/权限陈旧
  · 新增「业务平台」跳转按钮;state 写 sessionStorage,
    生产缺 VITE_BIZ_BASE_URL 时显式报错而非静默回 localhost
  · setInterval 在 onUnmounted 中清理

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:40:03 +08:00
lzh
c7b2ad1e79 恢复:框架层对接芋道后端
- vite.config.mts: 移除 /admin-api/system/* 5 条转发至 8000 的规则,
  system/infra 等基础接口回归兜底 /admin-api → 48080;
  保留 AIoT 业务必需的代理(/admin-api/aiot/*、/uploads、/captures)
- store/auth.ts: 移除 hideMenuItems/renameMenuItems 菜单后处理,
  恢复 accessStore.setAccessMenus 直接写入后端原始菜单
- .env: VITE_APP_TITLE / VITE_APP_TENANT_ENABLE / VITE_APP_API_ENCRYPT_ENABLE
  三项恢复 upstream 默认值(芋道管理系统 / true / true)

保留项(AIoT 业务):/work-order 公开路由、AIoT API & 视图、
WVP 代理规则、packages/@core/preferences 默认主题

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:40:01 +08:00
852be25413 功能:侧边栏菜单「告警汇总」重命名为「告警看板」
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 17:20:59 +08:00
8d5f2f138d 功能:隐藏 ROI 菜单项,ROI 配置已整合到摄像头管理中
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:32:33 +08:00
4b54a50d8c fix(aiot): 删除实时视频模块
删除 views/aiot/video 和 api/aiot/video 目录,
撤回 auth.ts 中的菜单过滤逻辑。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:40:56 +08:00
649d9e2a76 fix(aiot): 前端过滤 visible=false 的菜单项
在 fetchUserInfo 中对后端返回的菜单做递归过滤,
移除 visible=false 的菜单项,确保隐藏菜单不会显示。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 11:29:01 +08:00
dhb52
e9abbdcc68 refactor: 重构authLogin代码逻辑 2025-07-15 23:24:36 +08:00
xingyu4j
81a54dfbd0 Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin into dev 2025-05-06 10:02:03 +08:00
aonoa
41152d1722 refactor: modify the default homepage path loaded from the preference… (#6099)
* refactor: modify the default homepage path loaded from the preferences.ts

Signed-off-by: aonoa <1991849113@qq.com>

* refactor: modify the default homepage path loaded from the preferences.ts

Signed-off-by: aonoa <1991849113@qq.com>

---------

Signed-off-by: aonoa <1991849113@qq.com>
2025-05-03 16:03:08 +08:00
YunaiV
c0a92a5694 refactor:基于 lint 处理排版(框架层面) 2025-04-22 22:17:41 +08:00
YunaiV
54f9d0c10f feat: 增加 sso 单点登录 2025-04-16 18:35:03 +08:00
YunaiV
9fc51f085d feat:增加 social-login.vue 社交登录 2025-04-10 22:23:41 +08:00
YunaiV
446cb6cbbf feat:增加 register 账号注册功能 2025-04-08 13:10:36 +08:00
YunaiV
fa8e7bdc12 feat:增加 code-login 手机验证码的接入 2025-04-08 09:38:02 +08:00
YunaiV
d0cb103014 refactor: 【web-ant】重构认证模块并移除未使用的组件和功能【0fed9472】(剩余 request、present) 2025-03-29 20:05:19 +08:00
YunaiV
265a7941e2 refactor: 移除 userInfo 里面,多余的 realName、roles 树形 2025-03-28 19:59:06 +08:00
YunaiV
b79a239b4c feat:刷新令牌的完整实现 2025-03-27 11:36:30 +08:00
YunaiV
c881a47ffd refactor: 【web-ant】重构认证模块并移除未使用的组件和功能【0fed9472】(剩余 request、present) 2025-03-26 07:36:12 +08:00
YunaiV
3c3886e345 feat: request && login && router【e6939e22】(不包括 login.vue 和 request.ts) 2025-03-20 12:34:02 +08:00
Vben
860fc15ce6 perf: adjustment of form spelling errors, type adjustment, closer to actual development (#4694) 2024-10-20 21:44:25 +08:00
Vben
df48409814 fix: when the api returns 401, the page is refreshed not as expected (#4440) 2024-09-19 23:03:20 +08:00
Li Kui
01d60336a6 feat: refactor and improve the request client and support refreshToken (#4157)
* feat: refreshToken

* chore: store refreshToken

* chore: generate token using jsonwebtoken

* chore: set refreshToken in httpOnly cookie

* perf: authHeader verify

* chore: add add response interceptor

* chore: test refresh

* chore: handle logout

* chore: type

* chore: update pnpm-lock.yaml

* chore: remove test code

* chore: add todo comment

* chore: update pnpm-lock.yaml

* chore: remove default interceptors

* chore: copy codes

* chore: handle refreshToken invalid

* chore: add refreshToken preference

* chore: typo

* chore: refresh token逻辑调整

* refactor: interceptor presets

* chore: copy codes

* fix: ci errors

* chore: add missing await

* feat: 完善refresh-token逻辑及文档

* fix: ci error

* chore: filename

---------

Co-authored-by: vince <vince292007@gmail.com>
2024-08-19 22:59:42 +08:00
sea
08391ad53e feat: api suffix (#4065) 2024-08-07 13:42:33 +08:00
vben
89dcf522f5 refactor: Separate store 2024-07-30 21:10:28 +08:00