소스 검색

fix: dueros文档,清空登录页缓存

wzyyy 3 년 전
부모
커밋
ee0f4750f9

BIN
public/images/cloud/dueros-doc1.png


BIN
public/images/cloud/dueros-doc2.png


BIN
public/images/cloud/dueros-doc3.png


+ 35 - 1
src/pages/Northbound/DuerOS/Detail/Doc.tsx

@@ -1,6 +1,10 @@
-import { Image } from 'antd';
+import { InfoCircleFilled } from '@ant-design/icons';
+import { Alert, Image } from 'antd';
 
 const image = require('/public/images/cloud/dueros-doc.jpg');
+const image1 = require('/public/images/cloud/dueros-doc1.png');
+const image2 = require('/public/images/cloud/dueros-doc2.png');
+const image3 = require('/public/images/cloud/dueros-doc3.png');
 
 const Doc = () => {
   return (
@@ -25,6 +29,36 @@ const Doc = () => {
         <div className={'image'}>
           <Image width="100%" src={image} />
         </div>
+        <h1>授权地址</h1>
+        <div>物联网平台的登录地址。注意需要为https。</div>
+        <div>请复制并填写: https://pro.baidu.cn/#/user/login</div>
+        <div className={'image'}>
+          <Image width="100%" src={image1} />
+        </div>
+        <h1>Client_Id</h1>
+        <div>请填写物联网平台-第三方平台的clientId。</div>
+        <div className={'image'}>
+          <Image width="100%" src={image2} />
+        </div>
+        <h1>Token地址</h1>
+        <div>请复制DuerOS平台中的值,填写到第三方平台-redirectUrl中</div>
+        <div>
+          <Alert
+            icon={<InfoCircleFilled style={{ fontSize: 16, marginTop: 5 }} />}
+            description="注:需要将OAth2设置为开启状态。"
+            showIcon
+          />
+        </div>
+        <div className={'image'}>
+          <Image width="100%" src={image3} />
+        </div>
+        <h1>Token地址</h1>
+        <div>请复制并填写:HTTPS://【IP:端口】/api/v1/token</div>
+        <h2>ClientSecret</h2>
+        <div>请复制物联网平台-第三方平台中的secureKey,填写到DuerOS平台。</div>
+        <div></div>
+        <h1>WebService</h1>
+        <div>请复制并填写:/dueros/product/_query</div>
         <h2>2、登录物联网平台,进行平台内产品与dueros产品的数据映射。</h2>
         <h2>
           3、智能家居用户通过物联网平台中的用户,登录小度APP,获取平台内当前用户的所属设备。获取后即可进行语音控制。

+ 13 - 0
src/pages/device/Product/Detail/PropertyImport/index.tsx

@@ -128,6 +128,11 @@ const PropertyImport = (props: Props) => {
           };
         });
       });
+      onFieldValueChange('fileType', (field) => {
+        if (field.value === 'csv') {
+          field.title = '文件格式:  仅支持UTF-8格式编码格式';
+        } else field.title = '文件格式';
+      });
     },
   });
 
@@ -153,6 +158,14 @@ const PropertyImport = (props: Props) => {
               buttonStyle: 'solid',
               optionType: 'button',
             },
+            // 'x-reactions':{
+            //   dependencies:['properties'],
+            //   fulfill:{
+            //     state:{
+            //       title:'{{$deps[0]===csv?"文件格式: 仅支持UTF-8格式编码格式":"文件格式"}}'
+            //     }
+            //   }
+            // },
             enum: [
               {
                 label: 'xlsx',

+ 2 - 0
src/pages/device/components/Metadata/Base/index.tsx

@@ -19,6 +19,7 @@ import { asyncUpdateMedata, removeMetadata } from '../metadata';
 import type { permissionType } from '@/hooks/permission';
 import { PermissionButton } from '@/components';
 import { onlyMessage } from '@/utils/util';
+import { message } from 'antd';
 
 interface Props {
   type: MetadataType;
@@ -87,6 +88,7 @@ const BaseMetadata = observer((props: Props) => {
             MetadataModel.item = record;
             MetadataModel.type = type;
             MetadataModel.action = 'edit';
+            message.warning('修改物模型后会脱离产品物模型');
           }}
           tooltip={{
             title: operateLimits('add', type) ? '暂不支持' : '编辑',

+ 13 - 11
src/pages/device/components/Metadata/Cat/index.tsx

@@ -91,17 +91,19 @@ const Cat = observer((props: Props) => {
       <Tabs onChange={convertMetadata}>
         {codecs?.map((item) => (
           <Tabs.TabPane tab={item.name} tabKey={item.id} key={item.id}>
-            <MonacoEditor
-              height={350}
-              theme="vs"
-              language="json"
-              value={value}
-              editorDidMount={(editor) => {
-                editor.onDidScrollChange?.(() => {
-                  editor.getAction('editor.action.formatDocument').run();
-                });
-              }}
-            />
+            <div style={{ border: '1px solid #eee' }}>
+              <MonacoEditor
+                height={350}
+                theme="vs"
+                language="json"
+                value={value}
+                editorDidMount={(editor) => {
+                  editor.onDidScrollChange?.(() => {
+                    editor.getAction('editor.action.formatDocument').run();
+                  });
+                }}
+              />
+            </div>
           </Tabs.TabPane>
         ))}
       </Tabs>

+ 2 - 1
src/pages/device/components/Metadata/index.less

@@ -3,6 +3,7 @@
 .tips {
   position: absolute;
   top: 12px;
-  margin-left: 340px;
+  z-index: 1;
+  margin-left: 330px;
   font-weight: 100;
 }

+ 15 - 5
src/pages/device/components/Metadata/index.tsx

@@ -1,5 +1,5 @@
 import { observer } from '@formily/react';
-import { Space, Tabs } from 'antd';
+import { Space, Tabs, Tooltip } from 'antd';
 import BaseMetadata from './Base';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import Import from './Import';
@@ -50,10 +50,20 @@ const Metadata = observer((props: Props) => {
   return (
     <div className={'device-detail-metadata'} style={{ position: 'relative', minHeight }}>
       <div className={styles.tips}>
-        <InfoCircleOutlined style={{ marginRight: '3px' }} />
-        {InstanceModel.detail?.independentMetadata
-          ? '该设备已脱离产品物模型,修改产品物模型对该设备无影响'
-          : '设备会默认继承产品的物模型,修改设备物模型后将脱离产品物模型'}
+        <Tooltip
+          title={
+            InstanceModel.detail?.independentMetadata
+              ? '该设备已脱离产品物模型,修改产品物模型对该设备无影响'
+              : '设备会默认继承产品的物模型,修改设备物模型后将脱离产品物模型'
+          }
+        >
+          <span>
+            <InfoCircleOutlined style={{ marginRight: '3px' }} />
+            {InstanceModel.detail?.independentMetadata
+              ? '该设备已脱离产品物模型,修改产品物模型对该设备无影响'
+              : '设备会默认继承产品的物模型,修改设备物模型后将脱离产品物模型'}
+          </span>
+        </Tooltip>
       </div>
       <Tabs
         className={styles.metadataNav}

+ 1 - 0
src/pages/user/Login/index.tsx

@@ -67,6 +67,7 @@ const Login: React.FC = () => {
 
   useEffect(getCode, []);
   useEffect(() => {
+    localStorage.clear();
     Service.bindInfo().then((res) => {
       if (res.status === 200) {
         setBindings(res.result);