refactor: buffer form attachment file name (#2429)

This commit is contained in:
katherinehhh 2023-08-12 23:59:31 +08:00 committed by GitHub
parent 15504c2813
commit e573d085d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ function getFileData(ctx: Context) {
const urlPath = storage.path ? storage.path.replace(/^([^/])/, '/$1') : ''; const urlPath = storage.path ? storage.path.replace(/^([^/])/, '/$1') : '';
return { return {
title: file.originalname.replace(extname, ''), title: Buffer.from(file.originalname, 'latin1').toString('utf8').replace(extname, ''),
filename, filename,
extname, extname,
// TODO(feature): 暂时两者相同,后面 storage.path 模版化以后,这里只是 file 实际的 path // TODO(feature): 暂时两者相同,后面 storage.path 模版化以后,这里只是 file 实际的 path