Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/hdl/hdl_demo.go
master
huangjiajun 2 days ago
parent
commit
542c53a207
2 changed files with 9 additions and 0 deletions
  1. +6
    -0
      app/hdl/comm/hdl_comm.go
  2. +3
    -0
      app/hdl/hdl_demo.go

+ 6
- 0
app/hdl/comm/hdl_comm.go View File

@@ -1,6 +1,7 @@
package comm

import (
"applet/app/cfg"
"applet/app/db"
"applet/app/e"
"applet/app/md"
@@ -14,6 +15,7 @@ import (
"fmt"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/gin-gonic/gin"
"os"
"time"
)

@@ -57,6 +59,10 @@ func GetOssUrl(c *gin.Context) {
ossBucketScheme := cfgMap[enum2.AliyunOssBucketScheme]
accessKeyID := cfgMap[enum2.AliyunOssAccessKeyID]
accessKeySecret := cfgMap[enum2.AliyunOssAccessKeySecret]
if cfg.Prd {
accessKeyID = os.Getenv(enum2.AliyunOssAccessKeyID)
accessKeySecret = os.Getenv(enum2.AliyunOssAccessKeySecret)
}

// 创建OSSClient实例。
client, err := oss.New(ossBucketScheme+"://"+endpoint, accessKeyID, accessKeySecret)


+ 3
- 0
app/hdl/hdl_demo.go View File

@@ -7,6 +7,7 @@ import (
"applet/app/lib/aes/md"
"applet/app/svc"
"applet/app/utils"
"code.fnuoos.com/EggPlanet/egg_system_rules.git/enum"
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
@@ -53,6 +54,8 @@ func Demo1(c *gin.Context) {
//es.CreateIndexIfNotExists(md2.EggUserShortLink, md2.EggUserShortLinkMap)
data := make(map[string]string)
if cfg.Prd {
data["access_key_id"] = os.Getenv(enum.AliyunOssAccessKeyID)
data["access_key_secret"] = os.Getenv(enum.AliyunOssAccessKeySecret)
data["aliyun_sms_id"] = os.Getenv("aliyun_sms_id")
data["aliyun_sms_secret"] = os.Getenv("aliyun_sms_secret")
data["oss_access_key_id"] = os.Getenv("oss_access_key_id")


Loading…
Cancel
Save