diff --git a/.env.development b/.env.development index 05d67782d62fb6104cbf15025f633a036a5de8be..14e13358631fd33bcd06157e05d685dfb50d4f11 100644 --- a/.env.development +++ b/.env.development @@ -30,3 +30,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' # websocket 开关 默认使用sse推送 VITE_APP_WEBSOCKET = false + +# sse 开关 +VITE_APP_SSE = true diff --git a/.env.production b/.env.production index c6b1f8539f2ba232ace93657d1be69d6df674871..1109bc61160a8a9e7a6dbeb283f81fe1ccfa34e9 100644 --- a/.env.production +++ b/.env.production @@ -33,3 +33,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' # websocket 开关 默认使用sse推送 VITE_APP_WEBSOCKET = false + +# sse 开关 +VITE_APP_SSE = true diff --git a/package.json b/package.json index 48b15717141e2dae432e886c492fc0f29f1e9053..e67d60f26cc6cf159ae2ef79d53b0c32f1707b19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi-vue-plus", - "version": "5.2.2", + "version": "5.2.3", "description": "RuoYi-Vue-Plus多租户管理系统", "author": "LionLi", "license": "MIT", diff --git a/src/api/system/tenant/index.ts b/src/api/system/tenant/index.ts index 4380dbe14fb7cda82525da4c428b05f618e5891c..7b7b93f0b7461f9f7149092573542c3122aeceb0 100644 --- a/src/api/system/tenant/index.ts +++ b/src/api/system/tenant/index.ts @@ -91,3 +91,11 @@ export function syncTenantPackage(tenantId: string | number, packageId: string | params: data }); } + +// 同步租户字典 +export function syncTenantDict() { + return request({ + url: '/system/tenant/syncTenantDict', + method: 'get', + }); +} diff --git a/src/layout/index.vue b/src/layout/index.vue index 0919aad7e69227384401e615adc33d2d466a926d..ce47a30276c7f6fe6673ac064834186da6a3c6b4 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -73,7 +73,7 @@ onMounted(() => { }); onMounted(() => { - initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse') + initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse'); }); const handleClickOutside = () => { diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 777c85849156247e6025f39e9e8698024f6d470d..1fb9f62e3e876e56b686dc80231b086d2c2bc6c5 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -19,6 +19,7 @@ interface ImportMetaEnv { VITE_APP_RSA_PRIVATE_KEY: string; VITE_APP_CLIENT_ID: string; VITE_APP_WEBSOCKET: string; + VITE_APP_SSE: string; } interface ImportMeta { readonly env: ImportMetaEnv; diff --git a/src/utils/request.ts b/src/utils/request.ts index f2a69f0fe9de18cbbce90d8309e54f89d104547c..f8f1f53dcdebdeede7e724dac7e9344a37f04aba 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -10,6 +10,7 @@ import FileSaver from 'file-saver'; import { getLanguage } from '@/lang'; import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto'; import { encrypt, decrypt } from '@/utils/jsencrypt'; +import router from "@/router"; const encryptHeader = 'encrypt-key'; let downloadLoadingInstance: LoadingInstance; @@ -134,8 +135,13 @@ service.interceptors.response.use( }).then(() => { isRelogin.show = false; useUserStore().logout().then(() => { - location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index'; - }); + router.replace({ + path: '/login', + query: { + redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/') + } + }) + }); }).catch(() => { isRelogin.show = false; }); diff --git a/src/utils/sse.ts b/src/utils/sse.ts index a08f282a68e775aed7c084f20be50cb1c3199845..9174f0d5d74ac2f2be368e0663db44e5fbb8f6a3 100644 --- a/src/utils/sse.ts +++ b/src/utils/sse.ts @@ -2,10 +2,12 @@ import { getToken } from '@/utils/auth'; import { ElNotification } from 'element-plus'; import useNoticeStore from '@/store/modules/notice'; -let message = ''; - // 初始化 export const initSSE = (url: any) => { + if (import.meta.env.VITE_APP_SSE === 'false') { + return; + } + url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID const { data, @@ -15,13 +17,13 @@ export const initSSE = (url: any) => { retries: 10, delay: 3000, onFailed() { - console.log('Failed to connect after 10 retries') - }, + console.log('Failed to connect after 10 retries'); + } } }); watch(error, () => { - console.log('SSE connection error:', error.value) + console.log('SSE connection error:', error.value); error.value = null; }); @@ -41,5 +43,3 @@ export const initSSE = (url: any) => { data.value = null; }); }; - - diff --git a/src/views/index.vue b/src/views/index.vue index 7bd19e429ff472c7b79bc8d415dd75f7609f289b..b67eb076aa64a13cd5cb394af88024caad20ecc0 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -33,7 +33,7 @@ * 部署方式 Docker 容器编排 一键部署业务集群
* 国际化 SpringMessage Spring标准国际化方案

-

当前版本: v5.2.2

+

当前版本: v5.2.3

¥免费开源

@@ -77,7 +77,7 @@ * 分布式监控 Prometheus、Grafana 全方位性能监控
* 其余与 Vue 版本一致

-

当前版本: v2.2.1

+

当前版本: v2.2.2

¥免费开源

diff --git a/src/views/login.vue b/src/views/login.vue index ca2903f0742683abcec39c035ff21d7cbb8930f4..db1fca6190d1a72a3398803b59e8c16c2d283432 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -97,7 +97,7 @@ const tenantEnabled = ref(true); // 注册开关 const register = ref(false); -const redirect = ref(undefined); +const redirect = ref('/'); const loginRef = ref(); // 租户列表 const tenantList = ref([]); @@ -105,7 +105,7 @@ const tenantList = ref([]); watch( () => router.currentRoute.value, (newRoute: any) => { - redirect.value = newRoute.query && newRoute.query.redirect; + redirect.value = newRoute.query && decodeURIComponent(newRoute.query.redirect); }, { immediate: true } ); diff --git a/src/views/monitor/logininfor/index.vue b/src/views/monitor/logininfor/index.vue index 03d0d8f543633fce4771af215484355299f8ef2d..4cc890df568338b5d378727c0dac716804a901fe 100644 --- a/src/views/monitor/logininfor/index.vue +++ b/src/views/monitor/logininfor/index.vue @@ -198,7 +198,7 @@ const handleExport = () => { { ...queryParams.value }, - `config_${new Date().getTime()}.xlsx` + `logininfor_${new Date().getTime()}.xlsx` ); }; diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index d44a04af37902204750eebab9da8e42c61148244..4ad70d098374494fbe45639b95d0ab0751dab4e1 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -49,6 +49,9 @@ 刷新缓存 + + 同步租户字典 + @@ -109,11 +112,15 @@ setup name="Dict" lang="ts"> import useDictStore from '@/store/modules/dict'; +import useUserStore from "@/store/modules/user"; import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type'; import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types'; +import { syncTenantDict } from "@/api/system/tenant"; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const userStore = useUserStore(); +const userId = ref(userStore.userId); const typeList = ref([]); const loading = ref(true); const showSearch = ref(true); @@ -239,6 +246,12 @@ const handleRefreshCache = async () => { proxy?.$modal.msgSuccess('刷新成功'); useDictStore().cleanDict(); }; +/**同步租户字典*/ +const handleSyncTenantDict = async () => { + await proxy?.$modal.confirm('确认要同步所有租户字典吗?'); + let res = await syncTenantDict(); + proxy?.$modal.msgSuccess(res.msg); +}; onMounted(() => { getList(); diff --git a/src/views/system/tenantPackage/index.vue b/src/views/system/tenantPackage/index.vue index 30c94557af4cb0bcf8bb8e9a506d35dee2ca919b..05a0b414bfdd666532b9a997ec37ce04256edd51 100644 --- a/src/views/system/tenantPackage/index.vue +++ b/src/views/system/tenantPackage/index.vue @@ -321,7 +321,7 @@ const handleDelete = async (row?: TenantPkgVO) => { /** 导出按钮操作 */ const handleExport = () => { proxy?.download( - 'system/package/export', + 'system/tenant/package/export', { ...queryParams.value }, diff --git a/src/views/tool/gen/genInfoForm.vue b/src/views/tool/gen/genInfoForm.vue index 0ee9f1df054af32e23c03a3612c0b8d1ab9e05dd..05b728b833c34d8036b908735018a87eb967d2bf 100644 --- a/src/views/tool/gen/genInfoForm.vue +++ b/src/views/tool/gen/genInfoForm.vue @@ -274,7 +274,6 @@ const setSubTableColumns = (value: string) => { /** 查询菜单下拉树结构 */ const getMenuTreeselect = async () => { const res = await listMenu(); - res.data.forEach((m) => (m.menuId = m.menuId.toString())); const data = proxy?.handleTree(res.data, 'menuId'); if (data) { diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index a4ed9469507396dc414e4f02c20ac22446714b20..55556fdef45e87205321c5e30b3d962610de1f40 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -23,10 +23,12 @@ @@ -190,8 +192,8 @@ const handleStartWorkFlow = async (data: LeaveVO) => { taskVariables.value = { entity: data, leaveDays: data.leaveDays, - userList: [1, 3], - userList2: [1, 3] + userList: ["1", "3"], + userList2: ["1", "3"] }; submitFormData.value.variables = taskVariables.value; const resp = await startWorkFlow(submitFormData.value);

AltStyle によって変換されたページ (->オリジナル) /