Skip to content

Commit

Permalink
fix: 补充修改管理系统获取集群数据时token验证失败的返回
Browse files Browse the repository at this point in the history
  • Loading branch information
piccaSun committed Jun 13, 2024
1 parent cef8849 commit 4640f9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .changeset/cyan-nails-brake.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
"@scow/portal-web": patch
"@scow/mis-web": patch
---

修复门户系统桌面功能页面 token 过期不能跳转登录页面的问题
修复门户系统桌面功能页面 token 过期不能跳转登录页面的问题, 修改获取集群数据token验证失败时的返回
3 changes: 1 addition & 2 deletions apps/mis-web/src/pages/api/admin/getClustersRuntimeInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const GetClustersRuntimeInfoSchema = typeboxRouteSchema({
200: Type.Object({
results: Type.Array(ClusterRuntimeInfoSchema),
}),

},
});

Expand All @@ -48,7 +47,7 @@ export default route(GetClustersRuntimeInfoSchema,
// when firstly used in getInitialProps, check the token
// when logged in, use auth()
const info = token ? await validateToken(token) : await auth(req, res);
if (!info) { return { 403: null }; }
if (!info) { return; }

const client = getClient(ConfigServiceClient);
const result = await asyncClientCall(client, "getClustersRuntimeInfo", {});
Expand Down
4 changes: 1 addition & 3 deletions apps/mis-web/src/pages/api/clusterConfigsInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export const getClusterConfigFilesSchema = typeboxRouteSchema({

200: Type.Object({
clusterConfigs: Type.Record(Type.String(), ClusterConfigSchema) }),

403: Type.Null(),
},
});

Expand All @@ -58,7 +56,7 @@ export default route(getClusterConfigFilesSchema,
// when firstly used in getInitialProps, check the token
// when logged in, use auth()
const info = token ? await validateToken(token) : await auth(req, res);
if (!info) { return { 403: null }; }
if (!info) { return; }

const modifiedClusters: Record<string, ClusterConfigSchema> = await getClusterConfigFiles();

Expand Down

0 comments on commit 4640f9b

Please sign in to comment.