Skip to content

Commit 9a02598

Browse files
JavaLionLigitee-org
authored andcommitted
!151 发布 vue 版本 5.2.3 与 cloud 版本 2.2.2
Merge pull request !151 from 疯狂的狮子Li/dev
2 parents 1606dbd + 28a81f2 commit 9a02598

15 files changed

Lines changed: 55 additions & 20 deletions

File tree

.env.development

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
3030

3131
# websocket 开关 默认使用sse推送
3232
VITE_APP_WEBSOCKET = false
33+
34+
# sse 开关
35+
VITE_APP_SSE = true

.env.production

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
3333

3434
# websocket 开关 默认使用sse推送
3535
VITE_APP_WEBSOCKET = false
36+
37+
# sse 开关
38+
VITE_APP_SSE = true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ruoyi-vue-plus",
3-
"version": "5.2.2",
3+
"version": "5.2.3",
44
"description": "RuoYi-Vue-Plus多租户管理系统",
55
"author": "LionLi",
66
"license": "MIT",

src/api/system/tenant/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,11 @@ export function syncTenantPackage(tenantId: string | number, packageId: string |
9191
params: data
9292
});
9393
}
94+
95+
// 同步租户字典
96+
export function syncTenantDict() {
97+
return request({
98+
url: '/system/tenant/syncTenantDict',
99+
method: 'get',
100+
});
101+
}

src/layout/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ onMounted(() => {
7373
});
7474
7575
onMounted(() => {
76-
initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse')
76+
initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse');
7777
});
7878
7979
const handleClickOutside = () => {

src/types/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ interface ImportMetaEnv {
1919
VITE_APP_RSA_PRIVATE_KEY: string;
2020
VITE_APP_CLIENT_ID: string;
2121
VITE_APP_WEBSOCKET: string;
22+
VITE_APP_SSE: string;
2223
}
2324
interface ImportMeta {
2425
readonly env: ImportMetaEnv;

src/utils/request.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import FileSaver from 'file-saver';
1010
import { getLanguage } from '@/lang';
1111
import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
1212
import { encrypt, decrypt } from '@/utils/jsencrypt';
13+
import router from "@/router";
1314

1415
const encryptHeader = 'encrypt-key';
1516
let downloadLoadingInstance: LoadingInstance;
@@ -134,8 +135,13 @@ service.interceptors.response.use(
134135
}).then(() => {
135136
isRelogin.show = false;
136137
useUserStore().logout().then(() => {
137-
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
138-
});
138+
router.replace({
139+
path: '/login',
140+
query: {
141+
redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
142+
}
143+
})
144+
});
139145
}).catch(() => {
140146
isRelogin.show = false;
141147
});

src/utils/sse.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { getToken } from '@/utils/auth';
22
import { ElNotification } from 'element-plus';
33
import useNoticeStore from '@/store/modules/notice';
44

5-
let message = '';
6-
75
// 初始化
86
export const initSSE = (url: any) => {
7+
if (import.meta.env.VITE_APP_SSE === 'false') {
8+
return;
9+
}
10+
911
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID
1012
const {
1113
data,
@@ -15,13 +17,13 @@ export const initSSE = (url: any) => {
1517
retries: 10,
1618
delay: 3000,
1719
onFailed() {
18-
console.log('Failed to connect after 10 retries')
19-
},
20+
console.log('Failed to connect after 10 retries');
21+
}
2022
}
2123
});
2224

2325
watch(error, () => {
24-
console.log('SSE connection error:', error.value)
26+
console.log('SSE connection error:', error.value);
2527
error.value = null;
2628
});
2729

@@ -41,5 +43,3 @@ export const initSSE = (url: any) => {
4143
data.value = null;
4244
});
4345
};
44-
45-

src/views/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* 部署方式 Docker 容器编排 一键部署业务集群<br />
3434
* 国际化 SpringMessage Spring标准国际化方案<br />
3535
</p>
36-
<p><b>当前版本:</b> <span>v5.2.2</span></p>
36+
<p><b>当前版本:</b> <span>v5.2.3</span></p>
3737
<p>
3838
<el-tag type="danger">&yen;免费开源</el-tag>
3939
</p>
@@ -77,7 +77,7 @@
7777
* 分布式监控 Prometheus、Grafana 全方位性能监控<br />
7878
* 其余与 Vue 版本一致<br />
7979
</p>
80-
<p><b>当前版本:</b> <span>v2.2.1</span></p>
80+
<p><b>当前版本:</b> <span>v2.2.2</span></p>
8181
<p>
8282
<el-tag type="danger">&yen;免费开源</el-tag>
8383
</p>

src/views/login.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ const tenantEnabled = ref(true);
9797
9898
// 注册开关
9999
const register = ref(false);
100-
const redirect = ref(undefined);
100+
const redirect = ref('/');
101101
const loginRef = ref<ElFormInstance>();
102102
// 租户列表
103103
const tenantList = ref<TenantVO[]>([]);
104104
105105
watch(
106106
() => router.currentRoute.value,
107107
(newRoute: any) => {
108-
redirect.value = newRoute.query && newRoute.query.redirect;
108+
redirect.value = newRoute.query && decodeURIComponent(newRoute.query.redirect);
109109
},
110110
{ immediate: true }
111111
);

0 commit comments

Comments
 (0)