@yeeyoon/library 1.8.10 → 1.8.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { Menu, Image, Modal } from 'antd';
3
3
  import { AppstoreOutlined } from '@ant-design/icons';
4
4
  import PropTypes from 'prop-types';
@@ -15,31 +15,13 @@ const ProductListMenu = (props) => {
15
15
  const [openKeys] = useState(['sub1', 'sub2']);
16
16
  const [platModal, setPlatModal] = useState(false);
17
17
  const [platforms, setPlatforms] = useState([]);
18
- const [newProductList, setNewProductList] = useState([]);
19
- useEffect(() => {
20
- setNewProductList([
21
- {
22
- code: 200000729,
23
- description: '团队协作,任务分配一站式敏捷开发',
24
- domainName: null,
25
- icon: 'https://demo-yeeyoon-fm.oss-cn-zhangjiakou.aliyuncs.com/userCenter/productLogo/yiyunxietong.png',
26
- id: '9f4f6e1a063711ecb0c00c42a1ff8370',
27
- isClose: 0,
28
- level: 1,
29
- name: '宜云协同',
30
- parentId: null,
31
- tenants: null,
32
- },
33
- ...productList,
34
- ]);
35
- }, [productList]);
36
18
  const enterDetail = (item) => {
37
19
  if (item.code == 200000729) {
38
20
  window.open(`${getCollabRedirectUrl()}?token=${ls.get('X-Auth-Token')}`);
39
- } else if (item.platforms.length > 1) {
21
+ } else if (item.platforms?.length > 1) {
40
22
  setPlatModal(true);
41
23
  setPlatforms(item.platforms);
42
- } else if (item.platforms.length == 1) {
24
+ } else if (item.platforms?.length == 1) {
43
25
  getSystemToken(item.platforms[0]);
44
26
  }
45
27
  };
@@ -55,8 +37,8 @@ const ProductListMenu = (props) => {
55
37
  <div className={styles['product-menu']}>
56
38
  <Menu mode="inline" openKeys={openKeys} style={{ width: 256 }}>
57
39
  <SubMenu key="sub1" icon={<AppstoreOutlined />} title="我的产品">
58
- {newProductList.length ? (
59
- newProductList.map((item) => {
40
+ {productList.length ? (
41
+ productList.map((item) => {
60
42
  return (
61
43
  <Menu.Item key={item.code} onClick={() => enterDetail(item)}>
62
44
  <div style={{ display: 'flex', alignItems: 'center' }}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeeyoon/library",
3
- "version": "1.8.10",
3
+ "version": "1.8.11",
4
4
  "description": "宜云前端组件库和通用服务",
5
5
  "main": "index.js",
6
6
  "repository": {