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">
<component name="ChangeListManager">
<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$/../dsBaseWeb/Handler/SsoHandler.go" beforeDir="false" afterPath="$PROJECT_DIR$/../dsBaseWeb/Handler/SsoHandler.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" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/FileUpLoad/FileUpLoadController/FileUpLoadController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileUpLoad/FileUpLoadController/FileUpLoadController.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -40,7 +38,7 @@
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<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 name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
@ -48,7 +46,7 @@
<recent name="E:\Work\dsMin\dsCommonTools" />
</key>
</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">
<module name="dsCommonTools" />
<working_directory value="$PROJECT_DIR$" />
@ -58,8 +56,18 @@
<directory value="$PROJECT_DIR$" />
<method v="2" />
</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>
<list>
<item itemvalue="Go Build.go build main.go" />
<item itemvalue="Go Build.go build dsCommonTools" />
</list>
</recent_temporary>

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

Loading…
Cancel
Save