Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
ff5d486c
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
8 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ff5d486c
编写于
12月 17, 2021
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove upload file
上级
3577b5c4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
54 deletion
+9
-54
Makefile
Makefile
+1
-1
conf/ztf.conf
conf/ztf.conf
+1
-1
src/utils/file/file.go
src/utils/file/file.go
+2
-2
src/utils/file/upload.go
src/utils/file/upload.go
+0
-45
src/utils/log/log.go
src/utils/log/log.go
+2
-2
src/utils/log/print.go
src/utils/log/print.go
+3
-3
未找到文件。
Makefile
浏览文件 @
ff5d486c
VERSION
=
2.
4
VERSION
=
2.
5
PROJECT
=
ztf
QINIU_DIR
=
/Users/aaron/work/zentao/qiniu/
QINIU_DIST_DIR
=
${QINIU_DIR}${PROJECT}
/
${VERSION}
/
...
...
conf/ztf.conf
浏览文件 @
ff5d486c
Version
=
2
.
4
Version
=
2
.
5
Language
=
zh
Url
=
http
://
localhost
:
20080
/
Account
=
admin
...
...
src/utils/file/file.go
浏览文件 @
ff5d486c
...
...
@@ -3,8 +3,8 @@ package fileUtils
import
(
"fmt"
"github.com/easysoft/zentaoatf/res"
commonUtils
"github.com/easysoft/zentaoatf/src/utils/common"
constant
"github.com/easysoft/zentaoatf/src/utils/const"
"github.com/easysoft/zentaoatf/src/utils/common"
"github.com/easysoft/zentaoatf/src/utils/const"
"github.com/easysoft/zentaoatf/src/utils/vari"
"github.com/mholt/archiver/v3"
"io"
...
...
src/utils/file/upload.go
已删除
100644 → 0
浏览文件 @
3577b5c4
package
fileUtils
import
(
"bytes"
i118Utils
"github.com/easysoft/zentaoatf/src/utils/i118"
logUtils
"github.com/easysoft/zentaoatf/src/utils/log"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"os"
)
func
Upload
(
url
string
,
files
[]
string
,
extraParams
map
[
string
]
string
)
{
bodyBuffer
:=
&
bytes
.
Buffer
{}
bodyWriter
:=
multipart
.
NewWriter
(
bodyBuffer
)
for
_
,
file
:=
range
files
{
fw
,
_
:=
bodyWriter
.
CreateFormFile
(
"file"
,
file
)
f
,
_
:=
os
.
Open
(
file
)
defer
f
.
Close
()
io
.
Copy
(
fw
,
f
)
}
for
key
,
value
:=
range
extraParams
{
_
=
bodyWriter
.
WriteField
(
key
,
value
)
}
contentType
:=
bodyWriter
.
FormDataContentType
()
bodyWriter
.
Close
()
resp
,
err
:=
http
.
Post
(
url
,
contentType
,
bodyBuffer
)
defer
resp
.
Body
.
Close
()
if
err
!=
nil
{
logUtils
.
Error
(
i118Utils
.
Sprintf
(
"fail_to_upload_file"
,
err
.
Error
()))
}
respBody
,
err
:=
ioutil
.
ReadAll
(
resp
.
Body
)
if
err
!=
nil
{
logUtils
.
Error
(
i118Utils
.
Sprintf
(
"fail_to_parse_upload_file_response"
,
err
.
Error
()))
}
logUtils
.
Log
(
i118Utils
.
Sprintf
(
"upload_file_result"
,
resp
.
Status
,
string
(
respBody
)))
}
src/utils/log/log.go
浏览文件 @
ff5d486c
...
...
@@ -2,8 +2,8 @@ package logUtils
import
(
"fmt"
constant
"github.com/easysoft/zentaoatf/src/utils/const"
fileUtils
"github.com/easysoft/zentaoatf/src/utils/file"
"github.com/easysoft/zentaoatf/src/utils/const"
"github.com/easysoft/zentaoatf/src/utils/file"
"github.com/easysoft/zentaoatf/src/utils/i118"
"github.com/easysoft/zentaoatf/src/utils/vari"
"github.com/fatih/color"
...
...
src/utils/log/print.go
浏览文件 @
ff5d486c
...
...
@@ -3,9 +3,9 @@ package logUtils
import
(
"encoding/json"
"fmt"
commonUtils
"github.com/easysoft/zentaoatf/src/utils/common"
constant
"github.com/easysoft/zentaoatf/src/utils/const"
fileUtils
"github.com/easysoft/zentaoatf/src/utils/file"
"github.com/easysoft/zentaoatf/src/utils/common"
"github.com/easysoft/zentaoatf/src/utils/const"
"github.com/easysoft/zentaoatf/src/utils/file"
"github.com/fatih/color"
"os"
"regexp"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录