adtec-core-package 3.1.5 → 3.1.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.
package/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <!-- gitnexus:start -->
2
2
  # GitNexus — Code Intelligence
3
3
 
4
- This project is indexed by GitNexus as **adtec-front-end-core-package** (6187 symbols, 9025 relationships, 155 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
4
+ This project is indexed by GitNexus as **adtec-front-end-core-package** (6236 symbols, 9088 relationships, 154 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
5
5
 
6
6
  > If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
7
7
 
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <!-- gitnexus:start -->
2
2
  # GitNexus — Code Intelligence
3
3
 
4
- This project is indexed by GitNexus as **adtec-front-end-core-package** (6187 symbols, 9025 relationships, 155 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
4
+ This project is indexed by GitNexus as **adtec-front-end-core-package** (6236 symbols, 9088 relationships, 154 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
5
5
 
6
6
  > If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -64,6 +64,7 @@ import { useVModel } from '@vueuse/core'
64
64
  import { CircleClose, Download } from '@element-plus/icons-vue'
65
65
  import framework from '../../api/framework'
66
66
  import frameworkUtils from '../../utils/FrameworkUtils'
67
+ import { toSameOriginFileUrl } from '../../utils/toSameOriginFileUrl'
67
68
  import { ElIcon } from 'element-plus'
68
69
  const userinfo = userInfoStore()
69
70
  const model = defineModel()
@@ -146,7 +147,7 @@ const download= async ()=>{
146
147
  loading.value=true
147
148
  const data=await framework.getFileAccessAddress(fileId.value)
148
149
  const res=await request<any>({
149
- url: data.url,
150
+ url: toSameOriginFileUrl(data.url),
150
151
  method: 'get',
151
152
  responseType: 'blob',
152
153
  })
@@ -19,6 +19,7 @@ import { showImages } from 'vue-img-viewr'
19
19
  import documentApi from '../../api/DocumentApi.ts'
20
20
  import frameworkUtils from '../../utils/FrameworkUtils.ts'
21
21
  import framework from '../../api/framework.ts'
22
+ import { toSameOriginFileUrl } from '../../utils/toSameOriginFileUrl.ts'
22
23
  import FileView from './FileView.vue'
23
24
  import request from '../../utils/AxiosConfig.ts'
24
25
  import { getFileSuffix, isPreviewableSuffix } from '../../utils/uploadAccept.ts'
@@ -33,7 +34,7 @@ const IMAGE_SUFFIXES = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
33
34
 
34
35
  const downloadFile = async (data: ISysUploadFiles, url: string) => {
35
36
  const res = await request<any>({
36
- url,
37
+ url: toSameOriginFileUrl(url),
37
38
  method: 'get',
38
39
  responseType: 'blob',
39
40
  })
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 浏览器侧下载/拉取文件:将 fileurl 内网绝对地址转为当前页同源相对路径。
3
+ * OnlyOffice 预览仍须使用原始内网 URL(Document Server 服务端拉取)。
4
+ */
5
+ export function toSameOriginFileUrl(url?: string | null): string {
6
+ if (!url) return ''
7
+ if (url.startsWith('/')) return url
8
+ try {
9
+ const parsed = new URL(url)
10
+ return parsed.pathname + parsed.search + parsed.hash
11
+ } catch {
12
+ return url
13
+ }
14
+ }