Browse Source

Merge branch 'yb/nologin' into debug

hsun 2 years ago
parent
commit
00a90b23d0
2 changed files with 40 additions and 35 deletions
  1. 7 1
      logic/user/user.go
  2. 33 34
      utils/constants.go

+ 7 - 1
logic/user/user.go

@@ -211,9 +211,15 @@ func GetUserInfo(userInfo user.UserInfo) (userDetail Detail, err error, errMsg s
 		errMsg = "查询消息未读数失败"
 		return
 	}
+
+	// 用户头像
 	headimgurl := userInfo.Headimgurl
 	if headimgurl == "" {
-		headimgurl = utils.DEFAULT_HONGZE_USER_LOGO
+		// 未绑定-灰色头像
+		headimgurl = utils.DEFAULT_HONGZE_USER_LOGO_GRAY
+		if userInfo.UserID > 0 {
+			headimgurl = utils.DEFAULT_HONGZE_USER_LOGO
+		}
 	}
 
 	// 查询是否为内部员工、研究员、语音管理员

+ 33 - 34
utils/constants.go

@@ -42,36 +42,36 @@ const (
 
 //数据来源渠道
 const (
-	DATA_SOURCE_THS                  = iota + 1 //同花顺
-	DATA_SOURCE_WIND                            //wind
-	DATA_SOURCE_PB                              //彭博
-	DATA_SOURCE_CALCULATE                       //指标运算
-	DATA_SOURCE_CALCULATE_LJZZY                 //累计值转月
-	DATA_SOURCE_CALCULATE_TBZ                   //同比值
-	DATA_SOURCE_CALCULATE_TCZ                   //同差值
-	DATA_SOURCE_CALCULATE_NSZYDPJJS             //N数值移动平均计算
-	DATA_SOURCE_MANUAL                          //手工指标
-	DATA_SOURCE_LZ                              //隆众
-	DATA_SOURCE_YS                              //有色
-	DATA_SOURCE_CALCULATE_HBZ                   //环比值->12
-	DATA_SOURCE_CALCULATE_HCZ                   //环差值->13
-	DATA_SOURCE_CALCULATE_BP                    //变频->14
-	DATA_SOURCE_GL                              //钢联->15
-	DATA_SOURCE_ZZ                              //郑商所->16
-	DATA_SOURCE_DL                              //大商所->17
-	DATA_SOURCE_SH                              //上期所->18
-	DATA_SOURCE_CFFEX                           //中金所->19
-	DATA_SOURCE_SHFE                            //上期能源->20
-	DATA_SOURCE_GIE                             //欧洲天然气->21
-	DATA_SOURCE_CALCULATE_TIME_SHIFT            //时间移位->22
-	DATA_SOURCE_CALCULATE_ZJPJ                  //直接拼接->23
-	DATA_SOURCE_CALCULATE_LJZTBPJ               //累计值同比拼接->24
-	DATA_SOURCE_LT                              //路透->25
-	DATA_SOURCE_COAL                            //中国煤炭网->26
-	DATA_SOURCE_PYTHON                          //python代码->27
-	DATA_SOURCE_PB_FINANCE                      //彭博财务数据->28
-	DATA_SOURCE_GOOGLE_TRAVEL                   //谷歌出行数据->29
-	DATA_SOURCE_PREDICT                         //普通预测指标->30
+	DATA_SOURCE_THS                   = iota + 1 //同花顺
+	DATA_SOURCE_WIND                             //wind
+	DATA_SOURCE_PB                               //彭博
+	DATA_SOURCE_CALCULATE                        //指标运算
+	DATA_SOURCE_CALCULATE_LJZZY                  //累计值转月
+	DATA_SOURCE_CALCULATE_TBZ                    //同比值
+	DATA_SOURCE_CALCULATE_TCZ                    //同差值
+	DATA_SOURCE_CALCULATE_NSZYDPJJS              //N数值移动平均计算
+	DATA_SOURCE_MANUAL                           //手工指标
+	DATA_SOURCE_LZ                               //隆众
+	DATA_SOURCE_YS                               //有色
+	DATA_SOURCE_CALCULATE_HBZ                    //环比值->12
+	DATA_SOURCE_CALCULATE_HCZ                    //环差值->13
+	DATA_SOURCE_CALCULATE_BP                     //变频->14
+	DATA_SOURCE_GL                               //钢联->15
+	DATA_SOURCE_ZZ                               //郑商所->16
+	DATA_SOURCE_DL                               //大商所->17
+	DATA_SOURCE_SH                               //上期所->18
+	DATA_SOURCE_CFFEX                            //中金所->19
+	DATA_SOURCE_SHFE                             //上期能源->20
+	DATA_SOURCE_GIE                              //欧洲天然气->21
+	DATA_SOURCE_CALCULATE_TIME_SHIFT             //时间移位->22
+	DATA_SOURCE_CALCULATE_ZJPJ                   //直接拼接->23
+	DATA_SOURCE_CALCULATE_LJZTBPJ                //累计值同比拼接->24
+	DATA_SOURCE_LT                               //路透->25
+	DATA_SOURCE_COAL                             //中国煤炭网->26
+	DATA_SOURCE_PYTHON                           //python代码->27
+	DATA_SOURCE_PB_FINANCE                       //彭博财务数据->28
+	DATA_SOURCE_GOOGLE_TRAVEL                    //谷歌出行数据->29
+	DATA_SOURCE_PREDICT                          //普通预测指标->30
 	DATA_SOURCE_PREDICT_CALCULATE                //预测指标运算->31
 	DATA_SOURCE_PREDICT_CALCULATE_TBZ            //同比值->32
 	DATA_SOURCE_PREDICT_CALCULATE_TCZ            //同差值->33
@@ -127,8 +127,9 @@ 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_SYS_LOGO  = "https://hzstatic.hzinsights.com/static/yb_wx/hongze_sys_default_head.png" //弘则官方默认头像
+	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" //弘则电话
@@ -201,7 +202,6 @@ const (
 	SendTemplateMsgAuthorization = "dc855fce962a639faa779cbdd4cd332f"
 )
 
-
 //缓存key
 const (
 	CACHE_KEY_LOGS               = "HZ_ADMIN_CACHE_KEY_LOGS"         //api用户操作日志队列
@@ -214,4 +214,3 @@ const (
 	CACHE_CHART_CLASSIFY         = "chart:classify"                  //图表分类数据
 	CACHE_IMPORT_MANUAL_DATA     = "import:manual:data"              //手工数据导入后刷新
 )
-