@cloudbase/weda-ui 3.4.6 → 3.4.8

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,18 +1,13 @@
1
1
  import useSWR from 'swr';
2
2
  import { getTempFileURL } from '../tcb';
3
- import { isCloudFileID, transFileCloudidToName } from '../platform';
4
- export function useTempUrl(cloudId) {
5
- const isCloudId = isCloudFileID(cloudId);
3
+ export function useTempUrl(fileId) {
6
4
  const prefix = 'tcb:cloud-id:temp-url';
7
- // https格式不走cloudId处理逻辑
8
- const key = isCloudId
9
- ? `${prefix}:${transFileCloudidToName(cloudId)}`
10
- : cloudId;
5
+ const key = `${prefix}:${fileId}`;
11
6
  return useSWR(key, async () => {
12
- if (!isCloudId) {
13
- return cloudId;
7
+ if (!(fileId === null || fileId === void 0 ? void 0 : fileId.startsWith('cloud://'))) {
8
+ return fileId;
14
9
  }
15
- const tempUrl = await getTempFileURL(cloudId);
10
+ const tempUrl = await getTempFileURL(fileId);
16
11
  return tempUrl;
17
12
  },
18
13
  // 8秒dedupe
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.4.6",
3
+ "version": "3.4.8",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",