mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +08:00
修复脚本管理上传文件文件名乱码
This commit is contained in:
parent
6657ff0560
commit
f723631647
|
@ -136,7 +136,7 @@ export default (app: Router) => {
|
|||
}
|
||||
|
||||
if (req.file) {
|
||||
await fs.rename(req.file.path, join(path, req.file.filename));
|
||||
await fs.rename(req.file.path, join(path, filename));
|
||||
return res.send({ code: 200 });
|
||||
}
|
||||
|
||||
|
|
|
@ -173,8 +173,9 @@ const CronDetailModal = ({
|
|||
<>
|
||||
{intl.get('确认保存文件')}
|
||||
<Text style={{ wordBreak: 'break-all' }} type="warning">
|
||||
{' '}
|
||||
{scriptInfo.filename}
|
||||
</Text>{' '}
|
||||
</Text>
|
||||
{intl.get(',保存后不可恢复')}
|
||||
</>
|
||||
),
|
||||
|
|
|
@ -39,8 +39,8 @@ const EditScriptNameModal = ({
|
|||
setLoading(true);
|
||||
const { path = '', filename: inputFilename, directory = '' } = values;
|
||||
const formData = new FormData();
|
||||
formData.append('file', file as any);
|
||||
formData.append('filename', inputFilename);
|
||||
formData.append('file', file || '');
|
||||
formData.append('filename', file?.name || inputFilename);
|
||||
formData.append('path', path);
|
||||
formData.append('content', '');
|
||||
formData.append('directory', directory);
|
||||
|
|
|
@ -218,8 +218,9 @@ const Script = () => {
|
|||
<>
|
||||
{intl.get('确认保存文件')}
|
||||
<Text style={{ wordBreak: 'break-all' }} type="warning">
|
||||
{' '}
|
||||
{currentNode.title}
|
||||
</Text>{' '}
|
||||
</Text>
|
||||
{intl.get(',保存后不可恢复')}
|
||||
</>
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue
Block a user