Skip to content

Commit

Permalink
style: 优化网站列表描述信息显示
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu committed Apr 26, 2024
1 parent 6a30ccd commit 7ecdadb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
3 changes: 1 addition & 2 deletions backend/utils/files/file_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ func (f FileOp) DownloadFile(url, dst string) error {
if err != nil {
return err
}
defer resp.Body.Close()

out, err := os.Create(dst)
if err != nil {
Expand All @@ -324,8 +325,6 @@ func (f FileOp) DownloadFile(url, dst string) error {
if _, err = io.Copy(out, resp.Body); err != nil {
return fmt.Errorf("save download file [%s] error, err %s", dst, err.Error())
}
out.Close()
resp.Body.Close()
return nil
}

Expand Down
8 changes: 3 additions & 5 deletions backend/utils/files/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package files
import (
"bufio"
"fmt"
"github.com/spf13/afero"
"io"
"net/http"
"os"
Expand All @@ -12,6 +11,8 @@ import (
"strconv"
"strings"
"sync"

"github.com/spf13/afero"
)

func IsSymlink(mode os.FileMode) bool {
Expand Down Expand Up @@ -144,8 +145,5 @@ func GetParentMode(path string) (os.FileMode, error) {
}

func IsInvalidChar(name string) bool {
if strings.Contains(name, "&") {
return true
}
return false
return strings.Contains(name, "&")
}
1 change: 0 additions & 1 deletion backend/utils/http/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func GetHttpRes(url string) (*http.Response, error) {
return nil, buserr.WithMap("ErrHttpReqFailed", map[string]interface{}{"err": err.Error()}, err)
}
}
defer resp.Body.Close()
if resp.StatusCode == 404 {
return nil, buserr.New("ErrHttpReqNotFound")
}
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/views/website/website/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@
</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('website.remark')" prop="remark" min-width="120px">
<template #default="{ row }">
<MsgInfo :info="row.remark" />
</template>
</el-table-column>
<el-table-column
:label="$t('website.remark')"
prop="remark"
show-overflow-tooltip
min-width="120px"
></el-table-column>
<el-table-column
:label="$t('commons.table.protocol')"
prop="protocol"
Expand Down Expand Up @@ -194,7 +195,6 @@ import { dateFormatSimple } from '@/utils/util';
import { MsgSuccess } from '@/utils/message';
import { useI18n } from 'vue-i18n';
import { VideoPlay, VideoPause } from '@element-plus/icons-vue';
import MsgInfo from '@/components/msg-info/index.vue';
import { GetGroupList } from '@/api/modules/group';
import { Group } from '@/api/interface/group';
import { GlobalStore } from '@/store';
Expand Down

0 comments on commit 7ecdadb

Please sign in to comment.