ydb-components-material 0.1.145 → 0.1.146

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.
@@ -224,8 +224,8 @@ var FileItem = function FileItem(_ref) {
224
224
  break;
225
225
  }
226
226
  clearInterval(timerRef.current);
227
- sessionStorage.removeItem(tokenTY);
228
- localStorage.removeItem(tokenTY);
227
+ timerRef.current = null;
228
+ localStorage.removeItem(fileId);
229
229
  closeLoading();
230
230
  getRes(_extends({}, file, {
231
231
  fileId: newFile.fileId,
@@ -903,7 +903,7 @@ var FileItem = function FileItem(_ref) {
903
903
  }, [fileId]);
904
904
  useEffect(function () {
905
905
  try {
906
- var stored = sessionStorage.getItem(tokenTY);
906
+ var stored = localStorage.getItem(fileId);
907
907
  if (stored) {
908
908
  console.log('stored---', stored);
909
909
  var _JSON$parse = JSON.parse(stored),
@@ -913,8 +913,7 @@ var FileItem = function FileItem(_ref) {
913
913
  storedFileId = _JSON$parse.fileId,
914
914
  originalUrl = _JSON$parse.fileUrl;
915
915
  console.log('docId', docId, contrId, nameVal);
916
- if (storedFileId !== fileId) return;
917
- sessionStorage.removeItem(tokenTY);
916
+ localStorage.removeItem(storedFileId);
918
917
  originalUrlRef.current = originalUrl || '';
919
918
  if (docId && contrId && nameVal) {
920
919
  openLoading();
@@ -927,6 +926,7 @@ var FileItem = function FileItem(_ref) {
927
926
  return function () {
928
927
  if (timerRef.current) {
929
928
  clearInterval(timerRef.current);
929
+ timerRef.current = null;
930
930
  }
931
931
  };
932
932
  }, []);
@@ -213,8 +213,8 @@ function getContractSignUrl(contractIdVal, userInfo, config) {
213
213
  }
214
214
 
215
215
  // 保存签批信息
216
- function setSignInfo(fileName, tokenTY, fileId, fileUrl) {
217
- sessionStorage.setItem(tokenTY, JSON.stringify({
216
+ function setSignInfo(fileName, fileId, fileUrl) {
217
+ localStorage.setItem(fileId, JSON.stringify({
218
218
  contractId: contractId,
219
219
  documentId: documentId,
220
220
  fileName: fileName,
@@ -257,7 +257,7 @@ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
257
257
  console.log(res, '页面结果');
258
258
  if (res.data.code == 0) {
259
259
  if (config.fileList) {
260
- setSignInfo(fileName, config.tokenTY, fileId, fileUrl);
260
+ setSignInfo(fileName, fileId, fileUrl);
261
261
  localStorage.setItem(config.tokenTY, JSON.stringify(config.fileList));
262
262
  }
263
263
  resolve(res.data.signUrl);
@@ -230,8 +230,8 @@ var FileItem = function FileItem(_ref) {
230
230
  break;
231
231
  }
232
232
  clearInterval(timerRef.current);
233
- sessionStorage.removeItem(tokenTY);
234
- localStorage.removeItem(tokenTY);
233
+ timerRef.current = null;
234
+ localStorage.removeItem(fileId);
235
235
  closeLoading();
236
236
  getRes((0, _extends3["default"])({}, file, {
237
237
  fileId: newFile.fileId,
@@ -909,7 +909,7 @@ var FileItem = function FileItem(_ref) {
909
909
  }, [fileId]);
910
910
  (0, _react.useEffect)(function () {
911
911
  try {
912
- var stored = sessionStorage.getItem(tokenTY);
912
+ var stored = localStorage.getItem(fileId);
913
913
  if (stored) {
914
914
  console.log('stored---', stored);
915
915
  var _JSON$parse = JSON.parse(stored),
@@ -919,8 +919,7 @@ var FileItem = function FileItem(_ref) {
919
919
  storedFileId = _JSON$parse.fileId,
920
920
  originalUrl = _JSON$parse.fileUrl;
921
921
  console.log('docId', docId, contrId, nameVal);
922
- if (storedFileId !== fileId) return;
923
- sessionStorage.removeItem(tokenTY);
922
+ localStorage.removeItem(storedFileId);
924
923
  originalUrlRef.current = originalUrl || '';
925
924
  if (docId && contrId && nameVal) {
926
925
  openLoading();
@@ -933,6 +932,7 @@ var FileItem = function FileItem(_ref) {
933
932
  return function () {
934
933
  if (timerRef.current) {
935
934
  clearInterval(timerRef.current);
935
+ timerRef.current = null;
936
936
  }
937
937
  };
938
938
  }, []);
@@ -217,8 +217,8 @@ function getContractSignUrl(contractIdVal, userInfo, config) {
217
217
  }
218
218
 
219
219
  // 保存签批信息
220
- function setSignInfo(fileName, tokenTY, fileId, fileUrl) {
221
- sessionStorage.setItem(tokenTY, JSON.stringify({
220
+ function setSignInfo(fileName, fileId, fileUrl) {
221
+ localStorage.setItem(fileId, JSON.stringify({
222
222
  contractId: contractId,
223
223
  documentId: documentId,
224
224
  fileName: fileName,
@@ -261,7 +261,7 @@ function getSignUrl(userInfo, config, fileName, fileId, fileUrl) {
261
261
  console.log(res, '页面结果');
262
262
  if (res.data.code == 0) {
263
263
  if (config.fileList) {
264
- setSignInfo(fileName, config.tokenTY, fileId, fileUrl);
264
+ setSignInfo(fileName, fileId, fileUrl);
265
265
  localStorage.setItem(config.tokenTY, JSON.stringify(config.fileList));
266
266
  }
267
267
  resolve(res.data.signUrl);
@@ -98,7 +98,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
98
98
  packageName = 'ydb-components-material';
99
99
  }
100
100
  if (version === void 0) {
101
- version = '0.1.145';
101
+ version = '0.1.146';
102
102
  }
103
103
  if (basicLibraryVersion === void 0) {
104
104
  basicLibraryVersion = {
@@ -103,7 +103,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
103
103
  packageName = 'ydb-components-material';
104
104
  }
105
105
  if (version === void 0) {
106
- version = '0.1.145';
106
+ version = '0.1.146';
107
107
  }
108
108
  if (basicLibraryVersion === void 0) {
109
109
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.145",
3
+ "version": "0.1.146",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -102,10 +102,10 @@
102
102
  },
103
103
  "componentConfig": {
104
104
  "isComponentLibrary": true,
105
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.145/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.146/build/lowcode/assets-prod.json"
106
106
  },
107
107
  "lcMeta": {
108
108
  "type": "component"
109
109
  },
110
- "homepage": "https://unpkg.com/ydb-components-material@0.1.145/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.146/build/index.html"
111
111
  }