@dcrays/dcgchat 0.3.20 → 0.3.21
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/package.json +1 -1
- package/src/request/api.ts +1 -1
- package/src/request/oss.ts +3 -1
package/package.json
CHANGED
package/src/request/api.ts
CHANGED
|
@@ -7,7 +7,7 @@ export const getStsToken = async (name: string, botToken: string, isPrivate: 1 |
|
|
|
7
7
|
// 确保 userToken 已缓存(如果未缓存会自动获取并缓存)
|
|
8
8
|
await getUserToken(botToken)
|
|
9
9
|
|
|
10
|
-
const response = await post<IStsTokenReq, IStsToken>('/user/
|
|
10
|
+
const response = await post<IStsTokenReq, IStsToken>('/user/getStsTokenByAsync', { sourceFileName: name, isPrivate }, { botToken })
|
|
11
11
|
|
|
12
12
|
if (!response || !response.data || !response.data.bucket) {
|
|
13
13
|
throw new Error('获取 OSS 临时凭证失败')
|
package/src/request/oss.ts
CHANGED
|
@@ -38,7 +38,9 @@ export const ossUpload = async (file: File | string | Buffer, botToken: string,
|
|
|
38
38
|
bucket: data.bucket,
|
|
39
39
|
endpoint: data.endPoint,
|
|
40
40
|
region: data.region,
|
|
41
|
-
secure: true
|
|
41
|
+
secure: true,
|
|
42
|
+
cname: true,
|
|
43
|
+
authorizationV4: true
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
const client = new OSS(options)
|