You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by li...@apache.org on 2024/11/07 06:10:15 UTC

(shenyu-dashboard) branch master updated: [type:fix] fix can not Modify Selector MetaData Rule (#494)

This is an automated email from the ASF dual-hosted git repository.

liuhongyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ec2ea33 [type:fix] fix can not Modify Selector MetaData Rule (#494)
2ec2ea33 is described below

commit 2ec2ea33de56152e7cb40c5df5689f37ab0a4a64
Author: VampireAchao <ac...@apache.org>
AuthorDate: Thu Nov 7 14:10:09 2024 +0800

    [type:fix] fix can not Modify Selector MetaData Rule (#494)
---
 src/services/api.js    | 6 +++---
 src/utils/AuthRoute.js | 8 +++-----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/services/api.js b/src/services/api.js
index bc01a06d..8a3142c5 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -87,7 +87,7 @@ export async function getAllMetadata(params) {
 }
 
 export async function findMetadata(params) {
-  return request(`${baseUrl}/meta-data/${params.id}/${params.namespaceId}`, {
+  return request(`${baseUrl}/meta-data/${params.id}/`, {
     method: `GET`,
   });
 }
@@ -468,7 +468,7 @@ export async function getAllSelectors(params) {
 
 /* get single selector */
 export async function findSelector(params) {
-  return request(`${baseUrl}/selector/${params.id}/${params.namespaceId}`, {
+  return request(`${baseUrl}/selector/${params.id}`, {
     method: `GET`,
   });
 }
@@ -496,7 +496,7 @@ export async function deleteRule(params) {
 }
 
 export async function findRule(params) {
-  return request(`${baseUrl}/rule/${params.id}/${params.namespaceId}`, {
+  return request(`${baseUrl}/rule/${params.id}`, {
     method: `GET`,
   });
 }
diff --git a/src/utils/AuthRoute.js b/src/utils/AuthRoute.js
index 1e6c37dc..a4a7b1d5 100644
--- a/src/utils/AuthRoute.js
+++ b/src/utils/AuthRoute.js
@@ -273,11 +273,9 @@ const setMenuIconAndSort = (menus, permissions) => {
 }))
 export default class AuthRoute extends Component {
   componentDidMount() {
-    const {
-      global: { permissions },
-      loading,
-      path,
-    } = this.props;
+    const { global, loading, path } = this.props;
+    // Fix hot-reload issue in development after code changes
+    const permissions = global?.permissions;
     if (
       (!permissions || !permissions.menu || permissions.menu.length === 0) &&
       !loading &&