mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-13 02:02:48 +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)) {
|
if (!fs.existsSync(dirPath)) {
|
||||||
fs.mkdirSync(dirPath, { recursive: true });
|
fs.mkdirSync(dirPath, { recursive: true });
|
||||||
}
|
}
|
||||||
|
const uuidStr = uuid();
|
||||||
|
const name = `uploads/${moment().format('YYYYMMDD')}/${
|
||||||
|
fileName ? fileName : uuidStr + extend
|
||||||
|
}`;
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
`${dirPath}/${fileName ? fileName : uuid() + extend}`,
|
`${dirPath}/${fileName ? fileName : uuid() + extend}`,
|
||||||
data
|
data
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user