@yeeyoon/library 2.9.5 → 2.9.6

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.
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import { Menu, Image, Modal } from 'antd';
3
3
  import PropTypes from 'prop-types';
4
4
  import PlatformModal from '../PlatformModal';
5
- import { getCollabRedirectUrl } from '../../env';
5
+ import { getCollabRedirectUrl, getBpmRedirectUrl } from '../../env';
6
6
  import ls from 'local-storage';
7
7
  import styles from './index.less';
8
8
  import { fetchSystemToken } from '../../service';
@@ -15,6 +15,9 @@ 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 [visibleApplet, setVisibleApplet] = useState(false);
19
+ const [appletSrc, setAppletSrc] = useState('');
20
+
18
21
  const enterDetail = (item) => {
19
22
  let _link = document.createElement('a');
20
23
  let link = document.body.appendChild(_link);
@@ -27,13 +30,35 @@ const ProductListMenu = (props) => {
27
30
  )}&tenantId=${tenantId}`
28
31
  );
29
32
  link.click();
30
- } else if (item.platforms?.length > 1) {
33
+ return;
34
+ } else if (item.platforms.length > 1) {
31
35
  setPlatModal(true);
32
36
  setPlatforms(item.platforms);
33
- } else if (item.platforms?.length == 1) {
34
- getSystemToken(item.platforms[0]);
37
+ } else if (item.platforms.length == 1) {
38
+ if (item.code == 200000730 || item.code == 200000731) {
39
+ openModal(item.platforms[0].forwardDomainName);
40
+ } else {
41
+ if (item.code == 200000729 || item.code == 200000728) {
42
+ let url = '';
43
+ if (item.code == 200000729) url = getCollabRedirectUrl();
44
+ if (item.code == 200000728) url = getBpmRedirectUrl();
45
+ link.setAttribute(
46
+ 'href',
47
+ `${url}?token=${ls.get('X-Auth-Token')}&tenantId=${tenantId}`
48
+ );
49
+ link.click();
50
+ } else {
51
+ getSystemToken(item.platforms[0]);
52
+ }
53
+ }
35
54
  }
36
55
  };
56
+ const openModal = (src) => {
57
+ setAppletSrc(src);
58
+ setTimeout(() => {
59
+ setVisibleApplet(true);
60
+ }, 300);
61
+ };
37
62
  const getSystemToken = async (item) => {
38
63
  const resp = await fetchSystemToken({ platformId: item.id });
39
64
  const { success, data } = resp;
@@ -122,6 +147,17 @@ const ProductListMenu = (props) => {
122
147
  >
123
148
  <PlatformModal platforms={platforms} tenantId={tenantId} />
124
149
  </Modal>
150
+ {/* 点击小程序弹框 */}
151
+ <Modal
152
+ visible={visibleApplet}
153
+ onCancel={() => setVisibleApplet(false)}
154
+ centered
155
+ footer={null}
156
+ maskClosable={false}
157
+ width="auto"
158
+ >
159
+ <Image preview={false} src={appletSrc} />
160
+ </Modal>
125
161
  </div>
126
162
  );
127
163
  };
@@ -112,3 +112,17 @@ export function getCollabRedirectUrl() {
112
112
  return 'https://collab.yeeyoon.com';
113
113
  }
114
114
  }
115
+
116
+ export function getBpmRedirectUrl() {
117
+ switch (host) {
118
+ case 'localhost:8003':
119
+ case 'localhost:8000':
120
+ case 'testing-profile.yeeyoon.com':
121
+ return 'https://testing-bpm.yeeyoon.com';
122
+ case 'staging-profile.yeeyoon.com':
123
+ return 'https://staging-bpm.yeeyoon.com';
124
+ case 'profile.yeeyoon.com':
125
+ default:
126
+ return 'https://bpm.yeeyoon.com';
127
+ }
128
+ }
package/lib/config/env.js CHANGED
@@ -1,4 +1,4 @@
1
- // const REACT_APP_ENV = REACT_APP_ENV || 'testing';
1
+ // const REACT_APP_ENV = REACT_APP_ENV || 'prod';
2
2
 
3
3
  const envApi = {
4
4
  // IAM
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeeyoon/library",
3
- "version": "2.9.5",
3
+ "version": "2.9.6",
4
4
  "description": "宜云前端组件库和通用服务",
5
5
  "main": "index.js",
6
6
  "repository": {