update
continuous-integration/drone/push Build is passing Details

master
kgdxpr 4 years ago
parent 7253a31d92
commit 6f029cd0dc

@ -2,10 +2,8 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="0d4ad043-ffc9-484f-90ab-0d2e603f76d4" name="Default Changelist" comment=""> <list default="true" id="0d4ad043-ffc9-484f-90ab-0d2e603f76d4" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../dsBaseWeb/Config/Config.ini" beforeDir="false" afterPath="$PROJECT_DIR$/../dsBaseWeb/Config/Config.ini" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../dsBaseWeb/Handler/SsoHandler.go" beforeDir="false" afterPath="$PROJECT_DIR$/../dsBaseWeb/Handler/SsoHandler.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Business/FileUpLoad/FileUpLoadController/FileUpLoadController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileUpLoad/FileUpLoadController/FileUpLoadController.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../dsBaseWeb/go.mod" beforeDir="false" afterPath="$PROJECT_DIR$/../dsBaseWeb/go.mod" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../dsBaseWeb/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/../dsBaseWeb/go.sum" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -40,7 +38,7 @@
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="go.import.settings.migrated" value="true" /> <property name="go.import.settings.migrated" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="H:/Go_Test/Test03" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
@ -48,7 +46,7 @@
<recent name="E:\Work\dsMin\dsCommonTools" /> <recent name="E:\Work\dsMin\dsCommonTools" />
</key> </key>
</component> </component>
<component name="RunManager"> <component name="RunManager" selected="Go Build.go build main.go">
<configuration name="go build dsCommonTools" type="GoApplicationRunConfiguration" factoryName="Go Application" temporary="true" nameIsGenerated="true"> <configuration name="go build dsCommonTools" type="GoApplicationRunConfiguration" factoryName="Go Application" temporary="true" nameIsGenerated="true">
<module name="dsCommonTools" /> <module name="dsCommonTools" />
<working_directory value="$PROJECT_DIR$" /> <working_directory value="$PROJECT_DIR$" />
@ -58,8 +56,18 @@
<directory value="$PROJECT_DIR$" /> <directory value="$PROJECT_DIR$" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="go build main.go" type="GoApplicationRunConfiguration" factoryName="Go Application" temporary="true" nameIsGenerated="true">
<module name="dsCommonTools" />
<working_directory value="$PROJECT_DIR$" />
<kind value="FILE" />
<filePath value="$PROJECT_DIR$/main.go" />
<package value="dsCommonTools" />
<directory value="$PROJECT_DIR$" />
<method v="2" />
</configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Go Build.go build main.go" />
<item itemvalue="Go Build.go build dsCommonTools" /> <item itemvalue="Go Build.go build dsCommonTools" />
</list> </list>
</recent_temporary> </recent_temporary>

@ -7,6 +7,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/minio/minio-go/v6" "github.com/minio/minio-go/v6"
"net/http" "net/http"
"path"
"strings" "strings"
"time" "time"
) )
@ -28,7 +29,7 @@ func getPostPolicyInfo(c *gin.Context) {
return return
} }
extension := strings.Split(filename, ".")[1] extension := path.Ext(filename)
minioClient, err := minio.New(ConfigUtil.EndPoint, ConfigUtil.AccessKeyId, ConfigUtil.SecretAccessKey, false) minioClient, err := minio.New(ConfigUtil.EndPoint, ConfigUtil.AccessKeyId, ConfigUtil.SecretAccessKey, false)
if err != nil { if err != nil {
@ -39,7 +40,7 @@ func getPostPolicyInfo(c *gin.Context) {
policy := minio.NewPostPolicy() policy := minio.NewPostPolicy()
//Bucket名称 //Bucket名称
policy.SetBucket(ConfigUtil.Bucket) policy.SetBucket(ConfigUtil.Bucket)
policy.SetKey(CommonUtil.GetUUID() + "." + extension) policy.SetKey(CommonUtil.GetUUID() + extension)
//1天有效期 //1天有效期
policy.SetExpires(time.Now().UTC().AddDate(0, 0, 1)) policy.SetExpires(time.Now().UTC().AddDate(0, 0, 1))
url, formData, err := minioClient.PresignedPostPolicy(policy) url, formData, err := minioClient.PresignedPostPolicy(policy)
@ -49,7 +50,7 @@ func getPostPolicyInfo(c *gin.Context) {
} }
policyMap := make(map[string]interface{}) policyMap := make(map[string]interface{})
for k, v := range formData { for k, v := range formData {
policyMap[k] = v policyMap[strings.Replace(k, "-", "_", -1)] = v
} }
policyMap["url"] = fmt.Sprintf("%s", url) policyMap["url"] = fmt.Sprintf("%s", url)
policyMap["success"] = true policyMap["success"] = true

Loading…
Cancel
Save