Przeglądaj źródła

Merge pull request #631 from jetlinks/next-wzy

fix: task#1412
hear 3 lat temu
rodzic
commit
ef2a52e2c2

+ 1 - 1
src/app.tsx

@@ -347,7 +347,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
 };
 
 export function patchRoutes(routes: any) {
-  console.log(routes);
+  // console.log(routes);
   if (extraRoutes && extraRoutes.length) {
     const basePath = routes.routes.find((_route: any) => _route.path === '/')!;
 

+ 1 - 1
src/components/ProTableCard/CardItems/product.tsx

@@ -137,7 +137,7 @@ export default (props: ProductCardProps) => {
             </div>
             <div>
               <label>接入方式</label>
-              <Ellipsis title={props.protocolName || '未接入'} />
+              <Ellipsis title={props.accessName || '未接入'} />
             </div>
           </div>
         </div>

+ 1 - 1
src/pages/device/Product/Detail/BaseInfo/index.tsx

@@ -227,7 +227,7 @@ const BaseInfo = (props: BaseInfoProps) => {
                   }
                 }}
               >
-                {productModel.current?.transportProtocol}
+                {productModel.current?.accessName}
               </Button>
             ) : (
               <Button

+ 5 - 5
src/pages/device/Product/index.tsx

@@ -275,18 +275,18 @@ const Product = observer(() => {
     },
     {
       title: '接入方式',
-      dataIndex: 'accessId',
+      dataIndex: 'accessName',
       width: 150,
       ellipsis: true,
       valueType: 'select',
-      render: (_, row) => {
-        return row.protocolName;
-      },
+      // render: (_, row) => {
+      //   return row.protocolName;
+      // },
       request: () =>
         service.queryGatewayList().then((resp: any) =>
           resp.result.map((item: any) => ({
             label: item.name,
-            value: item.id,
+            value: item.name,
           })),
         ),
     },

+ 3 - 2
src/pages/init-home/components/menu.tsx

@@ -40,10 +40,11 @@ const Menu = forwardRef((props: { onChange?: (menu: any) => void }, ref) => {
    * 获取当前系统所有权限
    */
   const getSystemPermissions = async () => {
-    const resp = await service.getPermissionAll();
+    const resp = await service.getSystemPermission();
     if (resp.status === 200) {
+      // console.log(resp.result.map((item: any) => JSON.parse(item).id))
       const newTree = filterMenu(
-        resp.result.map((item: any) => item.id),
+        resp.result.map((item: any) => JSON.parse(item).id),
         BaseMenu,
       );
       const _count = menuCount(newTree);

+ 5 - 0
src/pages/init-home/service.ts

@@ -83,6 +83,11 @@ class Service extends BaseService<any> {
     request(`/${SystemConst.API_BASE}/device-product/${id}/deploy`, {
       method: 'POST',
     });
+  //获取当前系统权限信息
+  getSystemPermission = () =>
+    request(`${SystemConst.API_BASE}/system/resources/permission`, {
+      method: 'GET',
+    });
 }
 
 export default Service;

+ 15 - 15
src/pages/system/Apply/Save/index.tsx

@@ -1024,21 +1024,21 @@ const Save = () => {
                   placeholder: '请输入secureKey',
                 },
               },
-              'apiServer.redirectUri': {
-                type: 'string',
-                title: '回调地址',
-                'x-decorator': 'FormItem',
-                'x-decorator-props': {
-                  gridSpan: 2,
-                  layout: 'vertical',
-                  labelAlign: 'left',
-                },
-                required: true,
-                'x-component': 'Input',
-                'x-component-props': {
-                  placeholder: '请输入回调地址',
-                },
-              },
+              // 'apiServer.redirectUri': {
+              //   type: 'string',
+              //   title: '回调地址',
+              //   'x-decorator': 'FormItem',
+              //   'x-decorator-props': {
+              //     gridSpan: 2,
+              //     layout: 'vertical',
+              //     labelAlign: 'left',
+              //   },
+              //   required: true,
+              //   'x-component': 'Input',
+              //   'x-component-props': {
+              //     placeholder: '请输入回调地址',
+              //   },
+              // },
               'apiServer.roleIdList': {
                 title: '角色',
                 'x-decorator': 'FormItem',