MCPcopy
hub / github.com/yinxin630/fiora / getOSSFileUrl

Function getOSSFileUrl

packages/web/src/utils/uploadFile.ts:38–53  ·  view source on GitHub ↗
(url = '', process = '')

Source from the content-addressed store, hash-verified

36}
37
38export function getOSSFileUrl(url = '', process = '') {
39 const [rawUrl = '', extraPrams = ''] = url.split('?');
40 if (ossClient && rawUrl.startsWith('oss:')) {
41 const filename = rawUrl.slice(4);
42 // expire 5min
43 return `${ossClient.signatureUrl(filename, { expires: 300, process })}${
44 extraPrams ? `&${extraPrams}` : ''
45 }`;
46 }
47 if (/\/\/cdn\.suisuijiang\.com/.test(rawUrl)) {
48 return `${rawUrl}?x-oss-process=${process}${
49 extraPrams ? `&${extraPrams}` : ''
50 }`;
51 }
52 return `${url}`;
53}
54
55/**
56 * 上传文件

Callers 9

AppFunction · 0.90
GroupInfoFunction · 0.90
UserInfoFunction · 0.90
SettingFunction · 0.90
SelfInfoFunction · 0.90
GroupManagePanelFunction · 0.90
ImageMessageFunction · 0.90
FileMessageFunction · 0.90
AvatarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected