From 9a02598c00c0af120b38cfd09229abe17b10c4b7 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 25 十月 2024 11:13:13 +0800 Subject: [PATCH] !151 发布 vue 版本 5.2.3 与 cloud 版本 2.2.2 Merge pull request !151 from 疯狂的狮子Li/dev --- src/views/index.vue | 4 +- src/utils/request.ts | 10 ++++- src/layout/index.vue | 2 src/types/env.d.ts | 1 src/views/monitor/logininfor/index.vue | 2 .env.development | 3 + src/views/login.vue | 4 +- src/views/tool/gen/genInfoForm.vue | 1 src/views/workflow/leave/leaveEdit.vue | 6 ++- package.json | 2 .env.production | 3 + src/utils/sse.ts | 14 +++--- src/views/system/tenantPackage/index.vue | 2 src/views/system/dict/index.vue | 13 ++++++ src/api/system/tenant/index.ts | 8 ++++ 15 files changed, 55 insertions(+), 20 deletions(-) diff --git a/.env.development b/.env.development index 05d6778..14e1335 100644 --- a/.env.development +++ b/.env.development @@ -30,3 +30,6 @@ # websocket 寮�鍏� 榛樿浣跨敤sse鎺ㄩ�� VITE_APP_WEBSOCKET = false + +# sse 寮�鍏� +VITE_APP_SSE = true diff --git a/.env.production b/.env.production index c6b1f85..1109bc6 100644 --- a/.env.production +++ b/.env.production @@ -33,3 +33,6 @@ # websocket 寮�鍏� 榛樿浣跨敤sse鎺ㄩ�� VITE_APP_WEBSOCKET = false + +# sse 寮�鍏� +VITE_APP_SSE = true diff --git a/package.json b/package.json index 48b1571..e67d60f 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 4380dbe..7b7b93f 100644 --- a/src/api/system/tenant/index.ts +++ b/src/api/system/tenant/index.ts @@ -91,3 +91,11 @@ 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 0919aad..ce47a30 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -73,7 +73,7 @@ }); 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 777c858..1fb9f62 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -19,6 +19,7 @@ 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 f2a69f0..f8f1f53 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -10,6 +10,7 @@ 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 @@ }).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 a08f282..9174f0d 100644 --- a/src/utils/sse.ts +++ b/src/utils/sse.ts @@ -2,10 +2,12 @@ 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 @@ 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 @@ data.value = null; }); }; - - diff --git a/src/views/index.vue b/src/views/index.vue index 7bd19e4..b67eb07 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -33,7 +33,7 @@ * 閮ㄧ讲鏂瑰紡 Docker 瀹瑰櫒缂栨帓 涓�閿儴缃蹭笟鍔¢泦缇�<br /> * 鍥介檯鍖� SpringMessage Spring鏍囧噯鍥介檯鍖栨柟妗�<br /> </p> - <p><b>褰撳墠鐗堟湰:</b> <span>v5.2.2</span></p> + <p><b>褰撳墠鐗堟湰:</b> <span>v5.2.3</span></p> <p> <el-tag type="danger">¥鍏嶈垂寮�婧�</el-tag> </p> @@ -77,7 +77,7 @@ * 鍒嗗竷寮忕洃鎺� Prometheus銆丟rafana 鍏ㄦ柟浣嶆�ц兘鐩戞帶<br /> * 鍏朵綑涓� Vue 鐗堟湰涓�鑷�<br /> </p> - <p><b>褰撳墠鐗堟湰:</b> <span>v2.2.1</span></p> + <p><b>褰撳墠鐗堟湰:</b> <span>v2.2.2</span></p> <p> <el-tag type="danger">¥鍏嶈垂寮�婧�</el-tag> </p> diff --git a/src/views/login.vue b/src/views/login.vue index ca2903f..db1fca6 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -97,7 +97,7 @@ // 娉ㄥ唽寮�鍏� const register = ref(false); -const redirect = ref(undefined); +const redirect = ref('/'); const loginRef = ref<ElFormInstance>(); // 绉熸埛鍒楄〃 const tenantList = ref<TenantVO[]>([]); @@ -105,7 +105,7 @@ 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 03d0d8f..4cc890d 100644 --- a/src/views/monitor/logininfor/index.vue +++ b/src/views/monitor/logininfor/index.vue @@ -198,7 +198,7 @@ { ...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 d44a04a..4ad70d0 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -49,6 +49,9 @@ <el-col :span="1.5"> <el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">鍒锋柊缂撳瓨</el-button> </el-col> + <el-col :span="1.5"> + <el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">鍚屾绉熸埛瀛楀吀</el-button> + </el-col> <right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar> </el-row> </template> @@ -109,11 +112,15 @@ <script 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<DictTypeVO[]>([]); const loading = ref(true); const showSearch = ref(true); @@ -239,6 +246,12 @@ 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 30c9455..05a0b41 100644 --- a/src/views/system/tenantPackage/index.vue +++ b/src/views/system/tenantPackage/index.vue @@ -321,7 +321,7 @@ /** 瀵煎嚭鎸夐挳鎿嶄綔 */ 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 0ee9f1d..05b728b 100644 --- a/src/views/tool/gen/genInfoForm.vue +++ b/src/views/tool/gen/genInfoForm.vue @@ -274,7 +274,6 @@ /** 鏌ヨ鑿滃崟涓嬫媺鏍戠粨鏋� */ const getMenuTreeselect = async () => { const res = await listMenu(); - res.data.forEach((m) => (m.menuId = m.menuId.toString())); const data = proxy?.handleTree<MenuOptionsType>(res.data, 'menuId'); if (data) { diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index a4ed946..55556fd 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -23,10 +23,12 @@ <el-form-item label="璇峰亣鏃堕棿"> <el-date-picker v-model="leaveTime" + value-format="YYYY-MM-DD HH:mm:ss" type="daterange" range-separator="To" start-placeholder="寮�濮嬫椂闂�" end-placeholder="缁撴潫鏃堕棿" + :default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]" @change="changeLeaveTime()" /> </el-form-item> @@ -190,8 +192,8 @@ 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); -- Gitblit v1.9.3