mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
fix: update date path
This commit is contained in:
parent
ec2ae4aa51
commit
624a0d3307
@ -16,12 +16,12 @@ const fileUploadConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function fileUpload(content, fileName) {
|
function fileUpload(content, filename) {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const dir = date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate();
|
const dir = date.getFullYear() + '/' + (date.getMonth() + 1).toString().padStart(2, '0') + '/' + date.getDate().toString().padStart(2, '0');
|
||||||
const uuid = uuidv4();
|
const uuid = uuidv4();
|
||||||
const token = fileUploadConfig.accessToken[Math.floor(Math.random() * fileUploadConfig.accessToken.length)].replace('doocsmd', '');
|
const token = fileUploadConfig.accessToken[Math.floor(Math.random() * fileUploadConfig.accessToken.length)].replace('doocsmd', '');
|
||||||
const dateFilename = new Date().getTime() + '-' + uuid + '.' + fileName.split('.')[1];
|
const dateFilename = new Date().getTime() + '-' + uuid + '.' + filename.split('.')[1];
|
||||||
const url = `https://api.github.com/repos/${fileUploadConfig.username}/${fileUploadConfig.repo}/contents/${dir}/${dateFilename}`;
|
const url = `https://api.github.com/repos/${fileUploadConfig.username}/${fileUploadConfig.repo}/contents/${dir}/${dateFilename}`;
|
||||||
|
|
||||||
return fetch({
|
return fetch({
|
||||||
|
@ -21,7 +21,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
btnType() {
|
btnType() {
|
||||||
return !this.nightMode ? 'success' : 'default';
|
return this.nightMode ? 'default' : 'success';
|
||||||
},
|
},
|
||||||
...mapState({
|
...mapState({
|
||||||
nightMode: state => state.nightMode
|
nightMode: state => state.nightMode
|
||||||
|
Loading…
Reference in New Issue
Block a user