Pārlūkot izejas kodu

新增备份小程序

317699326@qq.com 1 nedēļu atpakaļ
vecāks
revīzija
225dad4af6

+ 3 - 1
controller/bullet_chat/bullet_chat.go

@@ -22,6 +22,8 @@ func Add(c *gin.Context) {
 		response.Fail("请登录后操作", c)
 		return
 	}
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
 
 	var req request.BulletChatAddReq
 	if c.ShouldBind(&req) != nil {
@@ -43,7 +45,7 @@ func Add(c *gin.Context) {
 	// 敏感词校验
 	// TODO:如果备用小程序提上master的话,此处要有调整(2022/11/08)
 	if userInfo.RecordInfo.OpenID != "" && userInfo.RecordInfo.CreatePlatform == 6 {
-		checkResult, e := wx_app.MsgSecCheck(userInfo.RecordInfo.OpenID, req.Content)
+		checkResult, e := wx_app.MsgSecCheck(userInfo.RecordInfo.OpenID, req.Content, copyYb)
 		if e == nil {
 			if checkResult.Result != nil && checkResult.Result.Suggest != "pass" {
 				errMsg := "含有违禁词, 不允许发布: " + checkResult.Result.Suggest + ", 命中标签: " + strconv.Itoa(checkResult.Result.Label)

+ 3 - 1
controller/comment/comment.go

@@ -12,13 +12,15 @@ import (
 
 // Comment 发布留言
 func Comment(c *gin.Context)  {
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
 	var req reqComment.ReqComment
 	if c.ShouldBind(&req) !=nil {
 		response.Fail("入参错误", c)
 		return
 	}
 	userInfo := userService.GetInfoByClaims(c)
-	data, err := commentService.Comment(userInfo, req)
+	data, err := commentService.Comment(userInfo, req, copyYb)
 	if err != nil {
 		response.Fail(err.Error(),c)
 		return

+ 3 - 1
controller/community/comment.go

@@ -14,6 +14,8 @@ import (
 
 // Comment 发布留言
 func Comment(c *gin.Context) {
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
 	var req request.ReqComment
 	if c.ShouldBind(&req) != nil {
 		response.Fail("入参错误", c)
@@ -39,7 +41,7 @@ func Comment(c *gin.Context) {
 		req.Source = 1
 	}
 
-	ybCommunityQuestionComment, err, errMsg := yb_community_question.Comment(userInfo, req.CommunityQuestionID, req.Content, req.SourceAgent, req.IsShowName, req.Source, qaAvatarUrl)
+	ybCommunityQuestionComment, err, errMsg := yb_community_question.Comment(userInfo, req.CommunityQuestionID, req.Content, req.SourceAgent, req.IsShowName, req.Source, qaAvatarUrl, copyYb)
 	if err != nil {
 		response.FailMsg(errMsg, err.Error(), c)
 		return

+ 4 - 2
controller/community/question.go

@@ -108,6 +108,8 @@ func QuestionDetail(c *gin.Context) {
 // @failure 400 {string} string "操作失败"
 // @Router /question/ask [post]
 func QuestionAsk(c *gin.Context) {
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
 	var req request.QuestionAskReq
 	if err := c.ShouldBind(&req); err != nil {
 		response.Fail("参数有误", c)
@@ -132,8 +134,8 @@ func QuestionAsk(c *gin.Context) {
 	}
 	// 敏感词校验, 只有小程序的用户才能走敏感词过滤接口
 	userinfo := user.GetInfoByClaims(c)
-	if userinfo.RecordInfo.OpenID != "" && userinfo.RecordInfo.CreatePlatform == 6 {
-		checkResult, e := wx_app.MsgSecCheck(userinfo.RecordInfo.OpenID, req.QuestionContent)
+	if userinfo.RecordInfo.OpenID != "" && (userinfo.RecordInfo.CreatePlatform == utils.USER_RECORD_PLATFORM_YB || userinfo.RecordInfo.CreatePlatform == utils.USER_RECORD_PLATFORM_COPY_YB) {
+		checkResult, e := wx_app.MsgSecCheck(userinfo.RecordInfo.OpenID, req.QuestionContent, copyYb)
 		if e == nil {
 			if checkResult.Result != nil && checkResult.Result.Suggest != "pass" {
 				errMsg := "含有违禁词, 不允许发布: " + checkResult.Result.Suggest + ", 命中标签: " + strconv.Itoa(checkResult.Result.Label)

+ 3 - 1
controller/public.go

@@ -119,6 +119,8 @@ func Upload(c *gin.Context) {
 // @failure 400 {string} string "获取失败"
 // @Router /public/get_share_poster [post]
 func GetSharePoster(c *gin.Context) {
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
 	var req services.SharePosterReq
 	if c.ShouldBind(&req) != nil {
 		response.Fail("参数异常", c)
@@ -128,7 +130,7 @@ func GetSharePoster(c *gin.Context) {
 		response.Fail("来源有误", c)
 		return
 	}
-	imgUrl, err := services.CreatePosterFromSourceV2(req.CodePage, req.CodeScene, req.Source, req.Version, req.Pars)
+	imgUrl, err := services.CreatePosterFromSourceV2(req.CodePage, req.CodeScene, req.Source, req.Version, req.Pars, copyYb)
 	if err != nil {
 		response.FailData("获取分享海报失败", "获取分享海报失败, Err: "+err.Error(), c)
 		return

+ 21 - 7
controller/wechat/wechat.go

@@ -9,6 +9,7 @@ import (
 	userService "hongze/hongze_yb/services/user"
 	"hongze/hongze_yb/services/wechat"
 	"hongze/hongze_yb/services/wx_app"
+	"hongze/hongze_yb/utils"
 	"strconv"
 )
 
@@ -29,9 +30,11 @@ func GetUserInfo(c *gin.Context) {
 
 func GetUserSession(c *gin.Context) {
 	code, _ := c.GetQuery("code")
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
 	//c.Sho
 	//fmt.Println(c.Request.)
-	userInfo, err := wx_app.GetSession(code)
+	userInfo, err := wx_app.GetSession(code, copyYb)
 	if err != nil {
 		response.Fail("获取失败,Err:"+err.Error(), c)
 		return
@@ -51,12 +54,20 @@ func GetUserSession(c *gin.Context) {
 func Login(c *gin.Context) {
 	//code, _ := c.GetQuery("code")
 	code := c.DefaultQuery("code", "")
-	wxUserInfo, err := wx_app.GetSession(code)
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
+
+	wxUserInfo, err := wx_app.GetSession(code, copyYb)
 	if err != nil {
 		response.Fail("获取失败,Err:"+err.Error(), c)
 		return
 	}
-	token, userId, isBind, err := user.WxLogin(wx_app.WxPlatform, wxUserInfo)
+	wxPlatform := utils.USER_RECORD_PLATFORM_YB
+	if copyYb == "true" {
+		wxPlatform = utils.USER_RECORD_PLATFORM_COPY_YB
+	}
+
+	token, userId, isBind, err := user.WxLogin(wxPlatform, wxUserInfo)
 	if err != nil {
 		response.Fail("登录失败,Err:"+err.Error(), c)
 		return
@@ -71,9 +82,10 @@ func Login(c *gin.Context) {
 
 // 消息解密请求参数
 type EncryptReq struct {
-	EncryptedData string
-	Iv            string
-	IsBind        bool `json:"isBind" description:"是否需要去授权绑定"`
+	Code			string	`description:"手机号获取凭证"`
+	EncryptedData 	string
+	Iv            	string
+	IsBind        	bool `json:"isBind" description:"是否需要去授权绑定"`
 }
 
 // GetEncryptInfo 消息解密
@@ -87,6 +99,8 @@ type EncryptReq struct {
 // @Success 200 {string} string "获取成功"
 // @Router /wechat/getEncryptInfo [post]
 func GetEncryptInfo(c *gin.Context) {
+	// 是否为备用小程序
+	copyYb := c.Request.Header.Get("CopyYb")
 	var req EncryptReq
 	err := c.ShouldBind(&req)
 	if err != nil {
@@ -107,7 +121,7 @@ func GetEncryptInfo(c *gin.Context) {
 		response.Fail("请重新登录", c)
 		return
 	}
-	decryptData, err := wx_app.GetDecryptInfo(userInfo.RecordInfo.SessionKey, req.EncryptedData, req.Iv)
+	decryptData, err := wx_app.GetDecryptInfo(userInfo.RecordInfo.SessionKey, req.EncryptedData, req.Iv, copyYb)
 	if err != nil {
 		response.Fail("获取失败,Err:"+err.Error(), c)
 		return

+ 3 - 3
logic/yb_community_question/yb_community_question_comment.go

@@ -27,7 +27,7 @@ import (
 )
 
 // Comment 发布留言
-func Comment(user user.UserInfo, communityQuestionID uint32, content string, sourceAgent, isShowName, source int8, qaAvatarUrl string) (ybCommunityQuestionComment *yb_community_question_comment.YbCommunityQuestionComment, err error, errMsg string) {
+func Comment(user user.UserInfo, communityQuestionID uint32, content string, sourceAgent, isShowName, source int8, qaAvatarUrl, copyYb string) (ybCommunityQuestionComment *yb_community_question_comment.YbCommunityQuestionComment, err error, errMsg string) {
 	errMsg = "发布留言失败"
 	defer func() {
 		if err != nil {
@@ -62,8 +62,8 @@ func Comment(user user.UserInfo, communityQuestionID uint32, content string, sou
 	}
 
 	// 敏感词过滤
-	if user.RecordInfo.OpenID != "" && user.RecordInfo.CreatePlatform == 6 { //只有小程序的用户才能走敏感词过滤接口
-		checkResult, tErr := wx_app.MsgSecCheck(user.RecordInfo.OpenID, content)
+	if user.RecordInfo.OpenID != "" && (user.RecordInfo.CreatePlatform == utils.USER_RECORD_PLATFORM_YB || user.RecordInfo.CreatePlatform == utils.USER_RECORD_PLATFORM_COPY_YB) { //只有小程序的用户才能走敏感词过滤接口
+		checkResult, tErr := wx_app.MsgSecCheck(user.RecordInfo.OpenID, content, copyYb)
 		/*if tErr != nil {
 			errMsg = "敏感词过滤失败" + tErr.Error()
 			err = errors.New("敏感词过滤失败")

+ 18 - 2
models/tables/yb_config/entity.go

@@ -16,8 +16,24 @@ func (m *YbConfig) TableName() string {
 	return "yb_config"
 }
 
+// YbConfigColumns get sql column name.获取数据库列名
+var YbConfigColumns = struct {
+	ConfigID    string
+	ConfigCode  string
+	ConfigValue string
+	Remark      string
+	CreateTime  string
+}{
+	ConfigID:    "config_id",
+	ConfigCode:  "config_code",
+	ConfigValue: "config_value",
+	Remark:      "remark",
+	CreateTime:  "create_time",
+}
+
 const (
-	UserChartCollectMax   = "user_chart_collect_max"   // 用户图表收藏上限
-	TelAreaList           = "tel_area_list"            // 手机号区号配置
+	KeyUseCopyYb        = "use_copy_yb"
+	UserChartCollectMax = "user_chart_collect_max" // 用户图表收藏上限
+	TelAreaList         = "tel_area_list"
 	DefaultSpeakerHeadPic = "default_speaker_head_pic" // 默认演讲人头像
 )

+ 8 - 0
models/tables/yb_config/model.go

@@ -2,6 +2,14 @@ package yb_config
 
 import "hongze/hongze_yb/global"
 
+// GetConfigByCode 查询配置详情
+func GetConfigByCode(configCode string) (item *YbConfig, err error) {
+	err = global.DEFAULT_MYSQL.Model(YbConfig{}).
+		Where("config_code = ?", configCode).
+		First(&item).Error
+	return
+}
+
 func (m *YbConfig) Create() (err error) {
 	err = global.DEFAULT_MYSQL.Create(m).Error
 	return

+ 3 - 3
services/comment/comment.go

@@ -17,7 +17,7 @@ import (
 )
 
 // Comment 发布留言
-func Comment(user user.UserInfo, req reqComment.ReqComment) (ret response.RespCommentAdd, err error) {
+func Comment(user user.UserInfo, req reqComment.ReqComment, copyYb string) (ret response.RespCommentAdd, err error) {
 	var errMsg string
 	defer func() {
 		if err != nil {
@@ -49,8 +49,8 @@ func Comment(user user.UserInfo, req reqComment.ReqComment) (ret response.RespCo
 		return
 	}
 	// 敏感词过滤
-	if user.RecordInfo.OpenID != "" && user.RecordInfo.CreatePlatform == 6 {   //只有小程序的用户才能走敏感词过滤接口
-		checkResult, tErr := wx_app.MsgSecCheck(user.RecordInfo.OpenID, req.Content)
+	if user.RecordInfo.OpenID != "" && (user.RecordInfo.CreatePlatform == utils.USER_RECORD_PLATFORM_YB || user.RecordInfo.CreatePlatform == utils.USER_RECORD_PLATFORM_COPY_YB) {   //只有小程序的用户才能走敏感词过滤接口
+		checkResult, tErr := wx_app.MsgSecCheck(user.RecordInfo.OpenID, req.Content, copyYb)
 		/*if tErr != nil {
 			errMsg = "敏感词过滤失败" + tErr.Error()
 			err = errors.New("敏感词过滤失败")

+ 4 - 4
services/share_poster.go

@@ -83,7 +83,7 @@ func Html2ImgHttpPost(url, postData string, params ...string) ([]byte, error) {
 }
 
 // CreateAndUploadSunCode 生成太阳码并上传OSS
-func CreateAndUploadSunCode(page, scene, version string) (imgUrl string, err error) {
+func CreateAndUploadSunCode(page, scene, version, copyYb string) (imgUrl string, err error) {
 	if page == "" {
 		err = errors.New("page不能为空")
 		return
@@ -101,7 +101,7 @@ func CreateAndUploadSunCode(page, scene, version string) (imgUrl string, err err
 	if scene != "" {
 		sceneMD5 = utils.MD5(scene)
 	}
-	picByte, err := wx_app.GetSunCode(page, sceneMD5)
+	picByte, err := wx_app.GetSunCode(page, sceneMD5, copyYb)
 	if err != nil {
 		return
 	}
@@ -162,7 +162,7 @@ func CreateAndUploadSunCode(page, scene, version string) (imgUrl string, err err
 }
 
 // CreatePosterFromSourceV2 生成分享海报(通过配置获取相关信息)
-func CreatePosterFromSourceV2(codePage, codeScene, source, version, pars string) (imgUrl string, err error) {
+func CreatePosterFromSourceV2(codePage, codeScene, source, version, pars, copyYb string) (imgUrl string, err error) {
 	var errMsg string
 	defer func() {
 		if err != nil {
@@ -202,7 +202,7 @@ func CreatePosterFromSourceV2(codePage, codeScene, source, version, pars string)
 	width := ybPosterConfig.Width
 	height := ybPosterConfig.Hight
 	//生成太阳码
-	sunCodeUrl, err := CreateAndUploadSunCode(codePage, codeScene, version)
+	sunCodeUrl, err := CreateAndUploadSunCode(codePage, codeScene, version, copyYb)
 	if err != nil {
 		return
 	}

+ 10 - 1
services/sun_code.go

@@ -3,6 +3,7 @@ package services
 import (
 	"errors"
 	"fmt"
+	"hongze/hongze_yb/models/tables/yb_config"
 	"hongze/hongze_yb/models/tables/yb_pc_suncode"
 	"hongze/hongze_yb/models/tables/yb_resource"
 	"hongze/hongze_yb/models/tables/yb_suncode_pars"
@@ -30,7 +31,15 @@ func PcCreateAndUploadSunCode(scene, page string) (imgUrl string, err error) {
 	if scene != "" {
 		sceneMD5 = utils.MD5(scene)
 	}
-	picByte, err := wx_app.GetSunCode(page, sceneMD5)
+
+	// 根据配置选择小程序
+	conf, e := yb_config.GetConfigByCode(yb_config.KeyUseCopyYb)
+	if e != nil {
+		err = errors.New("获取小程序配置失败, Err: " + e.Error())
+		return
+	}
+
+	picByte, err := wx_app.GetSunCode(page, sceneMD5, conf.ConfigValue)
 	if err != nil {
 		return
 	}

+ 104 - 22
services/wx_app/wx_app.go

@@ -1,6 +1,7 @@
 package wx_app
 
 import (
+	"errors"
 	"fmt"
 	wechat "github.com/silenceper/wechat/v2"
 	"github.com/silenceper/wechat/v2/cache"
@@ -9,8 +10,11 @@ import (
 	"github.com/silenceper/wechat/v2/miniprogram/config"
 	"github.com/silenceper/wechat/v2/miniprogram/encryptor"
 	"github.com/silenceper/wechat/v2/miniprogram/qrcode"
+	"github.com/silenceper/wechat/v2/util"
 	"hongze/hongze_yb/global"
+	"hongze/hongze_yb/models/tables/yb_config"
 	"hongze/hongze_yb/services/wx_app/security"
+	"hongze/hongze_yb/utils"
 )
 
 // 微信小程序配置信息
@@ -37,60 +41,100 @@ func init() {
 	}
 }
 
-func GetWxApp() (miniprogram *miniprogram.MiniProgram) {
+// 注: 研报小程序及备用小程序在同时运行, 基础微信API通过前端请求Header判断来源
+// 模板消息等API则用配置控制具体使用哪一个小程序, 同一时间仅一个小程序可推消息
+func GetWxApp(copyYb string) (mp *miniprogram.MiniProgram) {
 	wc := wechat.NewWechat()
 	memory := cache.NewMemory()
 	//memory := cache.NewRedis(global.Redis)
+
+	mp = new(miniprogram.MiniProgram)
+
+	appConf := getWxAppConfByRequest(copyYb)
+
 	cfg := &config.Config{
-		AppID:     WxAppId,
-		AppSecret: WxAppSecret,
+		AppID:     appConf.WxAppId,
+		AppSecret: appConf.WxAppSecret,
 		Cache:     memory,
 	}
 
-	miniprogram = wc.GetMiniProgram(cfg)
-	return
-}
-
-// GetSession 获取用户详情
-func GetSession(code string) (userInfo auth.ResCode2Session, err error) {
-	wechatClient := GetWxApp()
-	authClient := wechatClient.GetAuth()
-	userInfo, err = authClient.Code2Session(code)
+	mp = wc.GetMiniProgram(cfg)
 	return
 }
 
 // GetSession 获取用户详情
-func GetUserInfo(code string) (userInfo auth.ResCode2Session, err error) {
-	wechatClient := GetWxApp()
+func GetSession(code, copyYb string) (userInfo auth.ResCode2Session, err error) {
+	wechatClient := GetWxApp(copyYb)
 	authClient := wechatClient.GetAuth()
-	fmt.Println("code:", code)
 	userInfo, err = authClient.Code2Session(code)
 	return
 }
 
 // 获取解密信息 GetDecryptInfo
-func GetDecryptInfo(sessionKey, encryptedData, iv string) (decryptData *encryptor.PlainData, err error) {
-	wechatClient := GetWxApp()
+func GetDecryptInfo(sessionKey, encryptedData, iv, copyYb string) (decryptData *encryptor.PlainData, err error) {
+	wechatClient := GetWxApp(copyYb)
 	encryptorClient := wechatClient.GetEncryptor()
 	decryptData, err = encryptorClient.Decrypt(sessionKey, encryptedData, iv)
 	return
 }
 
+// 微信小程序新版code获取手机号
+const (
+	getPhoneNumberURL = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=%s"
+)
+
+type GetPhoneNumberResponse struct {
+	util.CommonError
+	PhoneInfo PhoneInfo `json:"phone_info"`
+}
+
+type PhoneInfo struct {
+	PhoneNumber     string `json:"phoneNumber"`     // 用户绑定的手机号
+	PurePhoneNumber string `json:"purePhoneNumber"` // 没有区号的手机号
+	CountryCode     string `json:"countryCode"`     // 区号
+	WaterMark       struct {
+		Timestamp int64  `json:"timestamp"`
+		AppID     string `json:"appid"`
+	} `json:"watermark"` // 数据水印
+}
+
+func GetPhoneNumber(code, copyYb string) (result GetPhoneNumberResponse, err error) {
+	var response []byte
+	var (
+		at string
+	)
+	wechatClient := GetWxApp(copyYb)
+	authClient := wechatClient.GetAuth()
+	if at, err = authClient.GetAccessToken(); err != nil {
+		return
+	}
+	body := map[string]interface{}{
+		"code": code,
+	}
+	if response, err = util.PostJSON(fmt.Sprintf(getPhoneNumberURL, at), body); err != nil {
+		return
+	}
+	if err = util.DecodeWithError(response, &result, "phonenumber.getPhoneNumber"); err != nil {
+		return
+	}
+	return
+}
+
 // GetSunCode 获取太阳码
-func GetSunCode(page, scene string) (resp []byte, err error) {
+func GetSunCode(page, scene, copyYb string) (resp []byte, err error) {
 	codePars := qrcode.QRCoder{
 		Page:       page,
 		Scene:      scene,
 		EnvVersion: EnvVersion,
 	}
-	wechatClient := GetWxApp()
+	wechatClient := GetWxApp(copyYb)
 	qr := wechatClient.GetQRCode()
 	return qr.GetWXACodeUnlimit(codePars)
 }
 
 // MsgSecCheck 检查一段文本是否含有违法违规内容。
-func MsgSecCheck(openid string, content string) (result security.Result, err error) {
-	wechatClient := GetWxApp()
+func MsgSecCheck(openid, content, copyYb string) (result security.Result, err error) {
+	wechatClient := GetWxApp(copyYb)
 	myMiniprogram := security.NewMyMiniprogram(wechatClient)
 	bodyContent := &security.BodyContent{
 		Version: 2,
@@ -101,6 +145,44 @@ func MsgSecCheck(openid string, content string) (result security.Result, err err
 	return myMiniprogram.MsgSecCheckWithResult(bodyContent)
 }
 
+type WxAppConf struct {
+	WxId              string `description:"微信原始ID"`
+	WxAppId           string
+	WxAppSecret       string
+	WxPlatform        int `description:"app来源: 6-研报小程序; 9-研报备用小程序"`
+	MsgRedirectTarget int `description:"公共模板消息跳转类型:1-研报小程序; 4-备用研报小程序"`
+}
+
+// GetWxAppConf 获取小程序配置
+func GetWxAppConf() (appConf *WxAppConf, err error) {
+	// 根据配置选择小程序
+	conf, e := yb_config.GetConfigByCode(yb_config.KeyUseCopyYb)
+	if e != nil {
+		err = errors.New("获取小程序配置失败, Err: " + e.Error())
+		return
+	}
+	appConf = getWxAppConfByRequest(conf.ConfigValue)
+	return
+}
+
+func getWxAppConfByRequest(copyYb string) *WxAppConf {
+	appConf := &WxAppConf{
+		WxId:              `gh_75abb562a946`,
+		WxAppId:           `wxb059c872d79b9967`,
+		WxAppSecret:       `1737c73e9f69a21de1a345b8f0800258`,
+		WxPlatform:        utils.USER_RECORD_PLATFORM_YB,
+		MsgRedirectTarget: 1,
+	}
+	// 备用小程序
+	if copyYb == "true" {
+		appConf.WxAppId = `wx9a2a9b49a00513a0`
+		appConf.WxAppSecret = `4dea76ad9482bdd4e71cf305f669d09f`
+		appConf.WxPlatform = utils.USER_RECORD_PLATFORM_COPY_YB
+		appConf.MsgRedirectTarget = 4
+	}
+	return appConf
+}
+
 // GetSunCode 获取太阳码
 func GetSunCodeV2(page string) (resp []byte, err error) {
 	codePars := qrcode.QRCoder{
@@ -108,7 +190,7 @@ func GetSunCodeV2(page string) (resp []byte, err error) {
 		EnvVersion: EnvVersion,
 		Width:      256,
 	}
-	wechatClient := GetWxApp()
+	wechatClient := GetWxApp("false")
 	qr := wechatClient.GetQRCode()
 	return qr.GetWXACode(codePars)
 }

+ 10 - 7
utils/constants.go

@@ -174,6 +174,12 @@ var (
 const ALIYUN_YBIMG_HOST = "https://hzstatic.hzinsights.com/static/yb_wx/"
 const HZ_DEFAULT_AVATAR = "https://hzstatic.hzinsights.com/static/yb_wx/hz_default_avatar.png"
 
+const (
+	DEFAULT_HONGZE_USER_LOGO      = "https://hzstatic.hzinsights.com/static/icon/hzyb/default_avatar.png"      //个人中心默认头像、匿名用户留言默认头像
+	DEFAULT_HONGZE_USER_LOGO_GRAY = "https://hzstatic.hzinsights.com/static/icon/hzyb/default_avatar_gray.png" //默认头像-未登录状态
+	DEFAULT_HONGZE_SYS_LOGO       = "https://hzstatic.hzinsights.com/static/yb_wx/hongze_sys_default_head.png" //弘则官方默认头像
+)
+
 const HZPHONE = "057187186319" //弘则电话
 const HZ_ADMIN_WX_ACCESS_TOEKN = "hz_admin:wx:access_token:"
 
@@ -190,13 +196,10 @@ const (
 	USER_RECORD_PLATFORM_PC                   // PC端网站
 	USER_RECORD_PLATFORM_CYGX                 // 查研观向小程序
 	_
-	USER_RECORD_PLATFORM_YB // 研报小程序
-)
-
-const (
-	DEFAULT_HONGZE_USER_LOGO      = "https://hzstatic.hzinsights.com/static/icon/hzyb/default_avatar.png"      //个人中心默认头像、匿名用户留言默认头像
-	DEFAULT_HONGZE_USER_LOGO_GRAY = "https://hzstatic.hzinsights.com/static/icon/hzyb/default_avatar_gray.png" //默认头像-未登录状态
-	DEFAULT_HONGZE_SYS_LOGO       = "https://hzstatic.hzinsights.com/static/yb_wx/hongze_sys_default_head.png" //弘则官方默认头像
+	USER_RECORD_PLATFORM_YB      // 研报小程序-6
+	_                            // 查研观向开发平台-7
+	_                            // 查研观向小助手公众号-8
+	USER_RECORD_PLATFORM_COPY_YB // 研报备用小程序-9
 )
 
 const (