mirror of https://github.com/halo-dev/halo
Refactor codes.
parent
105b2ad61d
commit
82cbb0d589
|
@ -77,7 +77,7 @@
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
@click="handleShowUploadModal"
|
@click="()=>this.uploadVisible = true"
|
||||||
>上传</a-button>
|
>上传</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
v-if="selectAttachment"
|
v-if="selectAttachment"
|
||||||
:attachment="selectAttachment"
|
:attachment="selectAttachment"
|
||||||
:addToPhoto="true"
|
:addToPhoto="true"
|
||||||
@delete="handleDelete"
|
@delete="()=>this.loadAttachments()"
|
||||||
/>
|
/>
|
||||||
</page-view>
|
</page-view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -223,9 +223,6 @@ export default {
|
||||||
this.selectAttachment = attachment
|
this.selectAttachment = attachment
|
||||||
this.drawerVisiable = true
|
this.drawerVisiable = true
|
||||||
},
|
},
|
||||||
handleShowUploadModal() {
|
|
||||||
this.uploadVisible = true
|
|
||||||
},
|
|
||||||
handleUploadSuccess() {
|
handleUploadSuccess() {
|
||||||
this.loadAttachments()
|
this.loadAttachments()
|
||||||
this.loadMediaTypes()
|
this.loadMediaTypes()
|
||||||
|
@ -245,9 +242,6 @@ export default {
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParam.page = 0
|
this.queryParam.page = 0
|
||||||
this.loadAttachments()
|
this.loadAttachments()
|
||||||
},
|
|
||||||
handleDelete(attachment) {
|
|
||||||
this.loadAttachments()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@
|
||||||
closable
|
closable
|
||||||
:visible="logDrawerVisiable"
|
:visible="logDrawerVisiable"
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
@close="onLogDrawerClose"
|
@close="()=>this.logDrawerVisiable = false"
|
||||||
>
|
>
|
||||||
<a-row
|
<a-row
|
||||||
type="flex"
|
type="flex"
|
||||||
|
@ -472,9 +472,6 @@ export default {
|
||||||
this.listLatestComments()
|
this.listLatestComments()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onLogDrawerClose() {
|
|
||||||
this.logDrawerVisiable = false
|
|
||||||
},
|
|
||||||
onPaginationChange(page, pageSize) {
|
onPaginationChange(page, pageSize) {
|
||||||
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
|
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
|
||||||
this.logPagination.page = page
|
this.logPagination.page = page
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
slot="addonAfter"
|
slot="addonAfter"
|
||||||
@click="handleShowLogoAttachDrawer"
|
@click="()=>this.logoDrawerVisible = true"
|
||||||
>
|
>
|
||||||
<a-icon type="picture" />
|
<a-icon type="picture" />
|
||||||
</a>
|
</a>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
slot="addonAfter"
|
slot="addonAfter"
|
||||||
@click="handleShowFaviconAttachDrawer"
|
@click="()=>this.faviconDrawerVisible = true"
|
||||||
>
|
>
|
||||||
<a-icon type="picture" />
|
<a-icon type="picture" />
|
||||||
</a>
|
</a>
|
||||||
|
@ -638,16 +638,10 @@ export default {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleShowLogoAttachDrawer() {
|
|
||||||
this.logoDrawerVisible = true
|
|
||||||
},
|
|
||||||
handleSelectLogo(data) {
|
handleSelectLogo(data) {
|
||||||
this.options.blog_logo = data.path
|
this.options.blog_logo = data.path
|
||||||
this.logoDrawerVisible = false
|
this.logoDrawerVisible = false
|
||||||
},
|
},
|
||||||
handleShowFaviconAttachDrawer() {
|
|
||||||
this.faviconDrawerVisible = true
|
|
||||||
},
|
|
||||||
handleTestMailClick() {
|
handleTestMailClick() {
|
||||||
mailApi.testMail(this.mailParam).then(response => {
|
mailApi.testMail(this.mailParam).then(response => {
|
||||||
this.$message.info(response.data.message)
|
this.$message.info(response.data.message)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="avatar">
|
<div class="avatar">
|
||||||
<img
|
<img
|
||||||
:src="user.avatar || 'https://gravatar.loli.net/avatar/?s=256&d=mm'"
|
:src="user.avatar || 'https://gravatar.loli.net/avatar/?s=256&d=mm'"
|
||||||
@click="handleShowAttachDrawer"
|
@click="()=>this.attachmentDrawerVisible = true"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
@ -182,9 +182,6 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations({ setUser: 'SET_USER' }),
|
...mapMutations({ setUser: 'SET_USER' }),
|
||||||
handleShowAttachDrawer() {
|
|
||||||
this.attachmentDrawerVisible = true
|
|
||||||
},
|
|
||||||
loadUser() {
|
loadUser() {
|
||||||
userApi.getProfile().then(response => {
|
userApi.getProfile().then(response => {
|
||||||
this.user = response.data.data
|
this.user = response.data.data
|
||||||
|
|
Loading…
Reference in New Issue