yuang-framework-ui-common 1.0.48 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/config/httpConfig.ts
CHANGED
@@ -66,8 +66,17 @@ http.interceptors.response.use(async (res: any) => {
|
|
66
66
|
return Promise.reject(new Error(res?.data?.message));
|
67
67
|
} else if (res?.data?.statusCode === 500822001) {
|
68
68
|
clearGatewayConfig();
|
69
|
-
|
70
|
-
|
69
|
+
await initGatewayConfig();
|
70
|
+
// 重发请求
|
71
|
+
let gatewayAccessToken = getLocalStorageItem("gatewayAccessToken") ?? '';
|
72
|
+
let gatewayPublicKey = getLocalStorageItem("gatewayPublicKey") ?? '';
|
73
|
+
if (gatewayAccessToken) {
|
74
|
+
res.config["Gateway-Access-Token"] = gatewayAccessToken;
|
75
|
+
}
|
76
|
+
if (gatewayPublicKey) {
|
77
|
+
res.config["Gateway-Public-Key"] = gatewayPublicKey;
|
78
|
+
}
|
79
|
+
return axios.request(res.config);
|
71
80
|
} else if (res?.data?.statusCode === 500815001) {
|
72
81
|
showErrorMessage(res?.data?.message || messageMap.requestError);
|
73
82
|
clearSsoAccessToken();
|
package/package.json
CHANGED
package/src/router/index.ts
CHANGED
@@ -26,10 +26,9 @@ const router = createRouter({
|
|
26
26
|
path: '/config/gateway-config',
|
27
27
|
component: () => import('@/views/config/gateway-config.vue')
|
28
28
|
},
|
29
|
-
|
30
29
|
{
|
31
30
|
path: '/utils/aes-utils',
|
32
|
-
component: () => import('@/views/utils/aes-utils.vue')
|
31
|
+
component: () => import('@/views/utils/aes-utils.vue'),
|
33
32
|
},
|
34
33
|
{
|
35
34
|
path: '/utils/rsa-utils',
|
@@ -43,8 +42,13 @@ const router = createRouter({
|
|
43
42
|
path: '/utils/message-utils',
|
44
43
|
component: () => import('@/views/utils/message-utils.vue')
|
45
44
|
},
|
46
|
-
|
47
|
-
|
45
|
+
{
|
46
|
+
path: '/utils/gateway-utils',
|
47
|
+
component: () => import('@/views/utils/gateway-utils.vue'),
|
48
|
+
meta: {
|
49
|
+
isSsoExcluded: true
|
50
|
+
}
|
51
|
+
},
|
48
52
|
|
49
53
|
{
|
50
54
|
path: '/example/table/index',
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<el-button @click="sendRequest">发送请求</el-button>
|
4
|
+
</div>
|
5
|
+
</template>
|
6
|
+
|
7
|
+
<script setup lang="ts">
|
8
|
+
import { http } from "../../../lib/config/httpConfig";
|
9
|
+
import { ElMessage } from 'element-plus/es';
|
10
|
+
|
11
|
+
const sendRequest = () => {
|
12
|
+
// 测试
|
13
|
+
http.get("/sso-api/standard/framework-captcha/getSliderCaptcha", { params: {} }).then((res) => {
|
14
|
+
ElMessage.success('发送成功');
|
15
|
+
});
|
16
|
+
}
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<style scoped>
|
20
|
+
|
21
|
+
</style>
|