diff --git a/dsSzxy/.idea/workspace.xml b/dsSzxy/.idea/workspace.xml
index 84e8a704..71d8a724 100644
--- a/dsSzxy/.idea/workspace.xml
+++ b/dsSzxy/.idea/workspace.xml
@@ -4,8 +4,7 @@
-
-
+
@@ -43,7 +42,7 @@
-
+
@@ -112,15 +111,4 @@
-
-
-
-
- file://$PROJECT_DIR$/Business/ImRelate/ImRelateDao/ImRelateDao.go
- 430
-
-
-
-
-
\ No newline at end of file
diff --git a/dsSzxy/Business/ImRelate/ImRelateDao/ImRelateDao.go b/dsSzxy/Business/ImRelate/ImRelateDao/ImRelateDao.go
index fa80c0b4..c73d28fd 100644
--- a/dsSzxy/Business/ImRelate/ImRelateDao/ImRelateDao.go
+++ b/dsSzxy/Business/ImRelate/ImRelateDao/ImRelateDao.go
@@ -13,7 +13,6 @@ import (
"github.com/astaxie/beego/httplib"
"github.com/rongcloud/server-sdk-go/v3/sdk"
"github.com/xormplus/xorm"
- "net/http"
"strconv"
"strings"
)
@@ -403,30 +402,7 @@ func SaveGroup(groupName string, personIdCookie string, identityIdCookie string,
req.Param("plat_type", "1")
req.Param("plat_id", "0")
- req.SetCookie(&http.Cookie{
- Name: "person_id",
- Value: personIdCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
- req.SetCookie(&http.Cookie{
- Name: "identity_id",
- Value: identityIdCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
- req.SetCookie(&http.Cookie{
- Name: "token",
- Value: tokenCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
- req.SetCookie(&http.Cookie{
- Name: "q_access_token",
- Value: qAccessTokenCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
+ CommonUtil.AddCookie(req, personIdCookie, identityIdCookie, tokenCookie, qAccessTokenCookie)
resStr, err := req.String()
if err != nil {
@@ -455,30 +431,7 @@ func AddGroupMember(groupId string, personList string, personIdCookie string, id
req.Param("pids", personList)
req.Param("random_num", CommonUtil.GetSixRandom())
- req.SetCookie(&http.Cookie{
- Name: "person_id",
- Value: personIdCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
- req.SetCookie(&http.Cookie{
- Name: "identity_id",
- Value: identityIdCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
- req.SetCookie(&http.Cookie{
- Name: "token",
- Value: tokenCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
- req.SetCookie(&http.Cookie{
- Name: "q_access_token",
- Value: qAccessTokenCookie,
- Path: "/",
- Domain: ConfigUtil.DsidealYyDomain,
- })
+ CommonUtil.AddCookie(req, personIdCookie, identityIdCookie, tokenCookie, qAccessTokenCookie)
resStr, err := req.String()
if err != nil {
diff --git a/dsSzxy/Utils/CommonUtil/CommonUtil.go b/dsSzxy/Utils/CommonUtil/CommonUtil.go
index efa391f8..3ad912c3 100644
--- a/dsSzxy/Utils/CommonUtil/CommonUtil.go
+++ b/dsSzxy/Utils/CommonUtil/CommonUtil.go
@@ -10,7 +10,9 @@ import (
"encoding/json"
"errors"
"fmt"
+ "github.com/astaxie/beego/httplib"
uuid "github.com/satori/go.uuid"
+ "net/http"
"log"
@@ -245,3 +247,35 @@ func ConvertInterfaceToString(inter interface{}) string {
str := fmt.Sprintf("%v", inter)
return str
}
+
+/**
+功能:请求云平台接口时增加Cookie
+作者:吴缤
+日期:2021-09-13
+*/
+func AddCookie(req *httplib.BeegoHTTPRequest, personIdCookie string, identityIdCookie string, tokenCookie string, qAccessTokenCookie string) {
+ req.SetCookie(&http.Cookie{
+ Name: "person_id",
+ Value: personIdCookie,
+ Path: "/",
+ Domain: ConfigUtil.DsidealYyDomain,
+ })
+ req.SetCookie(&http.Cookie{
+ Name: "identity_id",
+ Value: identityIdCookie,
+ Path: "/",
+ Domain: ConfigUtil.DsidealYyDomain,
+ })
+ req.SetCookie(&http.Cookie{
+ Name: "token",
+ Value: tokenCookie,
+ Path: "/",
+ Domain: ConfigUtil.DsidealYyDomain,
+ })
+ req.SetCookie(&http.Cookie{
+ Name: "q_access_token",
+ Value: qAccessTokenCookie,
+ Path: "/",
+ Domain: ConfigUtil.DsidealYyDomain,
+ })
+}