mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-11 00:22:49 +00:00
修复本地文件downAndUpload方法
This commit is contained in:
parent
6fc0b66c23
commit
a83d590d16
@ -53,6 +53,10 @@ export class PluginUpload extends BasePluginHook implements BaseUpload {
|
||||
if (!fs.existsSync(dirPath)) {
|
||||
fs.mkdirSync(dirPath, { recursive: true });
|
||||
}
|
||||
const uuidStr = uuid();
|
||||
const name = `uploads/${moment().format('YYYYMMDD')}/${
|
||||
fileName ? fileName : uuidStr + extend
|
||||
}`;
|
||||
fs.writeFileSync(
|
||||
`${dirPath}/${fileName ? fileName : uuid() + extend}`,
|
||||
data
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user