File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ activate_sign_salt = Gj&NaEqio1Tv2&4&3$
48
48
access_key = xxxxxx
49
49
secret_key = xxxxxxx
50
50
bucket_name = xxxx
51
+ domain = xxx
51
52
52
53
; 抓取程序
53
54
[crawl]
Original file line number Diff line number Diff line change @@ -76,5 +76,5 @@ func (ImageController) Transfer(ctx echo.Context) error {
76
76
return fail (ctx , 2 , "文件上传失败!" )
77
77
}
78
78
79
- return success (ctx , map [string ]interface {}{"uri" : logic .ImageDomain + path })
79
+ return success (ctx , map [string ]interface {}{"uri" : logic .QiniuDomain + path })
80
80
}
Original file line number Diff line number Diff line change @@ -37,9 +37,12 @@ import (
37
37
"github.com/qiniu/api.v6/rs"
38
38
)
39
39
40
+ var (
41
+ // QiniuDomain = "https://dn-studygolang.qbox.me/"
42
+ QiniuDomain = "http://studygolang.qiniudn.com/"
43
+ )
44
+
40
45
const (
41
- // ImageDomain = "http://studygolang.qiniudn.com/"
42
- ImageDomain = "https://dn-studygolang.qbox.me/"
43
46
MaxImageSize = 5 << 20 // 5M
44
47
)
45
48
@@ -58,6 +61,11 @@ func (this *UploaderLogic) InitQiniu() {
58
61
conf .ACCESS_KEY = config .ConfigFile .MustValue ("qiniu" , "access_key" )
59
62
conf .SECRET_KEY = config .ConfigFile .MustValue ("qiniu" , "secret_key" )
60
63
this .bucketName = config .ConfigFile .MustValue ("qiniu" , "bucket_name" )
64
+
65
+ qiniuDomain := config .ConfigFile .MustValue ("qiniu" , "domain" )
66
+ if qiniuDomain != "" {
67
+ QiniuDomain = qiniuDomain
68
+ }
61
69
}
62
70
63
71
// 生成上传凭证
You can’t perform that action at this time.
0 commit comments