|
@@ -3,6 +3,7 @@ package tencent
|
|
|
import (
|
|
import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"io"
|
|
"io"
|
|
|
|
|
+ SysConfig "mtp2_if/config"
|
|
|
"mtp2_if/global/app"
|
|
"mtp2_if/global/app"
|
|
|
"mtp2_if/global/e"
|
|
"mtp2_if/global/e"
|
|
|
"mtp2_if/logger"
|
|
"mtp2_if/logger"
|
|
@@ -76,6 +77,7 @@ func QianNotice(c *gin.Context) {
|
|
|
|
|
|
|
|
// 验签
|
|
// 验签
|
|
|
if payload != "" {
|
|
if payload != "" {
|
|
|
|
|
+ logger.GetLogger().Infof("QianNotice payload:%s", payload)
|
|
|
signFromHeader := appG.C.Request.Header.Get("Content-Signature")
|
|
signFromHeader := appG.C.Request.Header.Get("Content-Signature")
|
|
|
if signFromHeader != "" {
|
|
if signFromHeader != "" {
|
|
|
if tencent.VerifySign(payload, signFromHeader) {
|
|
if tencent.VerifySign(payload, signFromHeader) {
|
|
@@ -85,12 +87,23 @@ func QianNotice(c *gin.Context) {
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
// 解密成功
|
|
// 解密成功
|
|
|
tencent.ProcessNotice(content)
|
|
tencent.ProcessNotice(content)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ logger.GetLogger().Errorf("QianNotice failed: 解密失败 %v", err)
|
|
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR, "fail")
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ logger.GetLogger().Errorf("QianNotice failed: 验签失败")
|
|
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR, "fail")
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, "ok")
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ logger.GetLogger().Errorf("QianNotice failed: 获取推送内容为空")
|
|
|
|
|
+ appG.Response(http.StatusBadRequest, e.ERROR, "fail")
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- appG.Response(http.StatusOK, e.SUCCESS, "ok")
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// CreateConsoleLoginUrl 创建电子签控制台登录链接
|
|
// CreateConsoleLoginUrl 创建电子签控制台登录链接
|
|
@@ -106,7 +119,7 @@ func CreateConsoleLoginUrl(c *gin.Context) {
|
|
|
appG := app.Gin{C: c}
|
|
appG := app.Gin{C: c}
|
|
|
|
|
|
|
|
agent := utils.SetAgent()
|
|
agent := utils.SetAgent()
|
|
|
- proxyOrganizationName := "天津麦顿"
|
|
|
|
|
|
|
+ proxyOrganizationName := SysConfig.SerCfg.TencentCfg.ProxyOrganizationName
|
|
|
response, _ := tencent.CreateConsoleLoginUrl(agent, proxyOrganizationName)
|
|
response, _ := tencent.CreateConsoleLoginUrl(agent, proxyOrganizationName)
|
|
|
|
|
|
|
|
appG.Response(http.StatusOK, e.SUCCESS, response.ToJsonString())
|
|
appG.Response(http.StatusOK, e.SUCCESS, response.ToJsonString())
|