wzyyy 3 лет назад
Родитель
Сommit
ff2a67eaad

+ 9 - 0
src/pages/home/index.tsx

@@ -86,6 +86,15 @@ const Home = () => {
             });
         }
       });
+    } else {
+      service.queryViews().then((resp) => {
+        setLoading(false);
+        if (resp.status === 200) {
+          if (resp.result) {
+            setCurrent(resp.result?.content);
+          }
+        }
+      });
     }
   }, []);
 

+ 30 - 26
src/pages/system/Menu/Detail/edit.tsx

@@ -11,7 +11,7 @@ import Icons from '../components/Icons';
 import { QuestionCircleFilled } from '@ant-design/icons';
 import { getMenuPathByParams, MENUS_CODE } from '@/utils/menu';
 import { PermissionButton } from '@/components';
-import { onlyMessage } from '@/utils/util';
+import { isNoCommunity, onlyMessage } from '@/utils/util';
 
 type EditProps = {
   data: MenuItem;
@@ -85,7 +85,9 @@ export default (props: EditProps) => {
     }
     queryPermissions({ paging: false });
     queryMenuThree({ paging: false });
-    queryAssetsType();
+    if (isNoCommunity) {
+      queryAssetsType();
+    }
     /* eslint-disable */
   }, []);
 
@@ -239,31 +241,33 @@ export default (props: EditProps) => {
             {show && (
               <Row gutter={[0, 10]}>
                 <Col span={24}>
-                  <Form.Item
-                    label={'数据权限控制'}
-                    tooltip={'此菜单页面数据所对应的资产类型'}
-                    name={'accessSupport'}
-                    required
-                  >
-                    <Radio.Group
-                      onChange={(e) => {
-                        setAccessSupport(e.target.value);
-                      }}
-                      // disabled={disabled}
+                  {isNoCommunity && (
+                    <Form.Item
+                      label={'数据权限控制'}
+                      tooltip={'此菜单页面数据所对应的资产类型'}
+                      name={'accessSupport'}
+                      required
                     >
-                      <Radio value={'unsupported'}>不支持</Radio>
-                      <Radio value={'support'}>支持</Radio>
-                      <Radio value={'indirect'}>
-                        间接控制
-                        <Tooltip
-                          placement="topLeft"
-                          title={'此菜单内的数据基于其他菜单的数据权限控制'}
-                        >
-                          <QuestionCircleFilled style={{ marginLeft: 8 }} />
-                        </Tooltip>
-                      </Radio>
-                    </Radio.Group>
-                  </Form.Item>
+                      <Radio.Group
+                        onChange={(e) => {
+                          setAccessSupport(e.target.value);
+                        }}
+                        // disabled={disabled}
+                      >
+                        <Radio value={'unsupported'}>不支持</Radio>
+                        <Radio value={'support'}>支持</Radio>
+                        <Radio value={'indirect'}>
+                          间接控制
+                          <Tooltip
+                            placement="topLeft"
+                            title={'此菜单内的数据基于其他菜单的数据权限控制'}
+                          >
+                            <QuestionCircleFilled style={{ marginLeft: 8 }} />
+                          </Tooltip>
+                        </Radio>
+                      </Radio.Group>
+                    </Form.Item>
+                  )}
                   {accessSupport === 'support' && (
                     <Form.Item
                       name={'assetType'}

+ 4 - 3
src/pages/system/Menu/Setting/baseMenu.ts

@@ -172,9 +172,10 @@ export default [
             accessSupport: 'support',
             assetType: 'device',
             permissions: [
-              { permission: 'transparent-codec', actions: ['query'] },
-              { permission: 'device-api', actions: ['query-device-events'] },
-              { permission: 'things-collector', actions: ['save', 'delete'] },
+              { permission: 'device-instance', actions: ['query', 'save', 'delete'] },
+              // { permission: 'transparent-codec', actions: ['query'] },
+              // { permission: 'device-api', actions: ['query-device-events'] },
+              // { permission: 'things-collector', actions: ['save', 'delete'] },
             ],
             buttons: [
               {

+ 32 - 29
src/pages/user/Login/index.tsx

@@ -14,6 +14,7 @@ import SystemConst from '@/utils/const';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import { SelectLang } from '@@/plugin-locale/SelectLang';
 import Footer from '@/components/Footer';
+import { isNoCommunity } from '@/utils/util';
 
 const Login: React.FC = () => {
   const [captcha, setCaptcha] = useState<{ key?: string; base64?: string }>({});
@@ -264,36 +265,38 @@ const Login: React.FC = () => {
                       defaultMessage: '登录',
                     })}
                   </Submit>
-                  <div style={{ marginTop: 20 }}>
-                    <Divider plain style={{ height: 12 }}>
-                      <div style={{ color: '#807676d9', fontSize: 12 }}>其他方式登录</div>
-                    </Divider>
-                    <div style={{ position: 'relative', bottom: '10px' }}>
-                      {bindings.map((item: any) => (
-                        <Button
-                          type="link"
-                          onClick={() => {
-                            localStorage.setItem('onLogin', 'no');
-                            //  window.open(`/#/account/center/bind`);
-                            window.open(
-                              `/${SystemConst.API_BASE}/application/sso/${item.id}/login`,
-                            );
-                            window.onstorage = (e) => {
-                              if (e.newValue) {
-                                window.location.href = '/';
-                              }
-                            };
-                          }}
-                        >
-                          <img
-                            style={{ width: 32, height: 33 }}
-                            alt={item.name}
-                            src={iconMap.get(item.provider) || defaultImg}
-                          />
-                        </Button>
-                      ))}
+                  {isNoCommunity && (
+                    <div style={{ marginTop: 20 }}>
+                      <Divider plain style={{ height: 12 }}>
+                        <div style={{ color: '#807676d9', fontSize: 12 }}>其他方式登录</div>
+                      </Divider>
+                      <div style={{ position: 'relative', bottom: '10px' }}>
+                        {bindings.map((item: any) => (
+                          <Button
+                            type="link"
+                            onClick={() => {
+                              localStorage.setItem('onLogin', 'no');
+                              //  window.open(`/#/account/center/bind`);
+                              window.open(
+                                `/${SystemConst.API_BASE}/application/sso/${item.id}/login`,
+                              );
+                              window.onstorage = (e) => {
+                                if (e.newValue) {
+                                  window.location.href = '/';
+                                }
+                              };
+                            }}
+                          >
+                            <img
+                              style={{ width: 32, height: 33 }}
+                              alt={item.name}
+                              src={iconMap.get(item.provider) || defaultImg}
+                            />
+                          </Button>
+                        ))}
+                      </div>
                     </div>
-                  </div>
+                  )}
                 </Form>
               </div>
             </div>