|
@@ -40,8 +40,8 @@ func init() {
|
|
|
}
|
|
|
|
|
|
const (
|
|
|
- LIMIT_TIME = 3000000 //签名超时时间
|
|
|
- LIMIT_COUNT = 3000 //每天接口限制
|
|
|
+ LIMIT_TIME = 300 //签名超时时间
|
|
|
+ LIMIT_COUNT = 3000 //每天接口限制
|
|
|
REDISDB = "jyOpenAPI"
|
|
|
CODE_E1 = 40000
|
|
|
MSG_E1 = "签名错误"
|
|
@@ -112,6 +112,7 @@ func OpenAction(w http.ResponseWriter, r *http.Request) {
|
|
|
}
|
|
|
if len(*res) > 0 && (*res)["status"] == 1 { //查看用户是否存在
|
|
|
userip := GetAPIIP(r)
|
|
|
+ log.Println(userip, "-ip--", (*res)["userip"])
|
|
|
if (*res)["userip"] == userip { //验证用户ip
|
|
|
APPID = appid
|
|
|
SECRET = util.ObjToString((*res)["secret"])
|
|
@@ -121,6 +122,7 @@ func OpenAction(w http.ResponseWriter, r *http.Request) {
|
|
|
[]string{"timestamp", strconv.Itoa(timestamp)},
|
|
|
//[]string{"pagenum", strconv.Itoa(pagenum)},
|
|
|
})
|
|
|
+ log.Println(action, "--", keyword, "---", appid, "--", timestamp, "--", pagenum)
|
|
|
log.Println(signature, "签名串:", sign)
|
|
|
ordernum := (*res)["ordernum"].(int)
|
|
|
if sign == signature { //签名串验证
|