Skip to content

Commit

Permalink
🎉 add description for uploaded files
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Jan 28, 2023
1 parent 356c1b9 commit 088aa5f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions admin/src/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import 'ace-builds/src-noconflict/mode-csharp';
import 'ace-builds/src-noconflict/snippets/csharp';

import axios from 'axios';
import { getDate } from '../utils';

const modes = [
'markdown',
Expand Down Expand Up @@ -252,6 +253,7 @@ class Editor extends Component {
isImage = true;
}
formData.append("file", files[0]);
formData.append("description", `编辑文章《${this.state.page.title}》时上传,时间为 ${getDate()}`)
let res = await axios.post('/api/file', formData, {
headers: { "Content-Type": "multipart/form-data" },
});
Expand Down

0 comments on commit 088aa5f

Please sign in to comment.