zmdms-utils 0.0.68 → 0.0.69

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.
@@ -4,7 +4,7 @@ function getBaseUrl(processObj, options) {
4
4
  var ENV = processObj[envKey]; // 获取当前环境变量
5
5
  // api各个环境地址
6
6
  var apiBaseUrlObj = {
7
- dev: processObj["".concat(apiKey, "_DEV")] || "http://192.168.0.134:8000",
7
+ dev: processObj["".concat(apiKey, "_DEV")] || window.location.origin,
8
8
  test: processObj["".concat(apiKey, "_TEST")] || window.location.origin,
9
9
  stage: processObj["".concat(apiKey, "_STAGE")] || window.location.origin,
10
10
  prod: processObj["".concat(apiKey, "_PROD")] || window.location.origin,
@@ -18,7 +18,7 @@ function getBaseUrl(processObj, options) {
18
18
  };
19
19
  // file 服务器
20
20
  var fileBaseUrlObj = {
21
- dev: processObj["".concat(fileKey, "_DEV")] || "http://192.168.0.134:8000",
21
+ dev: processObj["".concat(fileKey, "_DEV")] || window.location.origin,
22
22
  test: processObj["".concat(fileKey, "_TEST")] || window.location.origin,
23
23
  stage: processObj["".concat(fileKey, "_STAGE")] || window.location.origin,
24
24
  prod: processObj["".concat(fileKey, "_PROD")] || window.location.origin,
package/dist/es/file.js CHANGED
@@ -137,7 +137,7 @@ function previewFile(fileId, fileName, options) {
137
137
  previewFileName = "".concat(filePreName, "-").concat(fileId, ".").concat(fileExtension);
138
138
  if (!isZmdmsFileService) {
139
139
  // 2023-12-30 修改成数字中心预览
140
- window.open("".concat(apiBaseURL, "/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=").concat(fileId, "&").concat(TOKEN_KEY, "=").concat(token));
140
+ window.open("".concat(apiBaseURL, "/api/cicoms-resource/attach/filePreview?attachId=").concat(fileId, "&").concat(TOKEN_KEY, "=").concat(token));
141
141
  return;
142
142
  }
143
143
  // 如果是图片 走批量预览接口
@@ -290,7 +290,7 @@ function createOriginalLink(fileId, fileName, options) {
290
290
  previewFileName = "".concat(filePreName, "-").concat(fileId, ".").concat(fileExtension);
291
291
  // 2023-12-30 替换成数字中心的 预览接口
292
292
  if (!isZmdmsFileService) {
293
- return "".concat(apiBaseURL, "/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=").concat(fileId, "&").concat(TOKEN_KEY, "=").concat(token);
293
+ return "".concat(apiBaseURL, "/api/cicoms-resource/attach/filePreview?attachId=").concat(fileId, "&").concat(TOKEN_KEY, "=").concat(token);
294
294
  }
295
295
  if (isZmdmsFileService) {
296
296
  fileId = encodeFileId(fileId, 2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-utils",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/src/baseUrl.ts CHANGED
@@ -28,7 +28,7 @@ export function getBaseUrl(processObj: any, options?: IOptions) {
28
28
 
29
29
  // api各个环境地址
30
30
  const apiBaseUrlObj: any = {
31
- dev: processObj[`${apiKey}_DEV`] || "http://192.168.0.134:8000",
31
+ dev: processObj[`${apiKey}_DEV`] || window.location.origin,
32
32
  test: processObj[`${apiKey}_TEST`] || window.location.origin,
33
33
  stage: processObj[`${apiKey}_STAGE`] || window.location.origin,
34
34
  prod: processObj[`${apiKey}_PROD`] || window.location.origin,
@@ -44,7 +44,7 @@ export function getBaseUrl(processObj: any, options?: IOptions) {
44
44
 
45
45
  // file 服务器
46
46
  const fileBaseUrlObj: any = {
47
- dev: processObj[`${fileKey}_DEV`] || "http://192.168.0.134:8000",
47
+ dev: processObj[`${fileKey}_DEV`] || window.location.origin,
48
48
  test: processObj[`${fileKey}_TEST`] || window.location.origin,
49
49
  stage: processObj[`${fileKey}_STAGE`] || window.location.origin,
50
50
  prod: processObj[`${fileKey}_PROD`] || window.location.origin,
package/src/file.ts CHANGED
@@ -190,7 +190,7 @@ export function previewFile(
190
190
  if (!isZmdmsFileService) {
191
191
  // 2023-12-30 修改成数字中心预览
192
192
  window.open(
193
- `${apiBaseURL}/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=${fileId}&${TOKEN_KEY}=${token}`
193
+ `${apiBaseURL}/api/cicoms-resource/attach/filePreview?attachId=${fileId}&${TOKEN_KEY}=${token}`
194
194
  );
195
195
  return;
196
196
  }
@@ -357,7 +357,7 @@ export function createOriginalLink(
357
357
  previewFileName = `${filePreName}-${fileId}.${fileExtension}`;
358
358
  // 2023-12-30 替换成数字中心的 预览接口
359
359
  if (!isZmdmsFileService) {
360
- return `${apiBaseURL}/api/cicoms-cicohr-org/cicomscicohr/v1/common/filePreview?attachId=${fileId}&${TOKEN_KEY}=${token}`;
360
+ return `${apiBaseURL}/api/cicoms-resource/attach/filePreview?attachId=${fileId}&${TOKEN_KEY}=${token}`;
361
361
  }
362
362
  if (isZmdmsFileService) {
363
363
  fileId = encodeFileId(fileId, 2);