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