瀏覽代碼

更新

master
huangjiajun 1 年之前
父節點
當前提交
3481cffc49
共有 1 個文件被更改,包括 34 次插入0 次删除
  1. +34
    -0
      zero_buy/api.go

+ 34
- 0
zero_buy/api.go 查看文件

@@ -0,0 +1,34 @@
package zero_buy

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/comm"
"github.com/syyongx/php2go"
"strings"
)

func ZeroBuyUrl(appSecret string, param map[string]string) string {
url := "http://114.132.183.119:8085/#/"
for k, v := range param {
if strings.Contains(url, "?") == false {
url += "?" + k + "=" + v
} else {
url += "&" + k + "=" + v
}
}
sign := GetSign(appSecret, param)
url += "&sign=" + sign
return url
}
func GetSign(appSecret string, param map[string]string) string {
keys := comm.KsortToStr(param)
str := ""
for _, k := range keys {
if str == "" {
str += k + "=" + param[k]
} else {
str += "|" + k + "=" + param[k]
}
}
str += "|" + appSecret
return php2go.Md5(str)
}

Loading…
取消
儲存