Prechádzať zdrojové kódy

fix:未登录用户常用功能数量限制修改

duxin 11 mesiacov pred
rodič
commit
641ba4f665

+ 31 - 31
api/internal/handler/routes.go

@@ -14,8 +14,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 		[]rest.Route{
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/ent/examine",
-				Handler: ExamineHandler(serverCtx),
+				Path:    "/userCenter/ent/auth",
+				Handler: EntAuthHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -24,19 +24,29 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/ent/auth",
-				Handler: EntAuthHandler(serverCtx),
+				Path:    "/userCenter/ent/examine",
+				Handler: ExamineHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/ent/list",
-				Handler: EntListHandler(serverCtx),
+				Path:    "/userCenter/ent/examineInfo",
+				Handler: ExamineInfoHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/userCenter/ent/examineList",
 				Handler: ExamineListHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/userCenter/ent/getStatusByCode",
+				Handler: GetStatusByCodeHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/userCenter/ent/getUserInfoByPId",
+				Handler: GetEntUserInfoByPositonIdHandler(serverCtx),
+			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/userCenter/ent/info",
@@ -44,8 +54,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/ent/examineInfo",
-				Handler: ExamineInfoHandler(serverCtx),
+				Path:    "/userCenter/ent/list",
+				Handler: EntListHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
@@ -54,18 +64,13 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/ent/getStatusByCode",
-				Handler: GetStatusByCodeHandler(serverCtx),
-			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/userCenter/workDesktop/menuInfo",
-				Handler: WorkDesktopMenuInfoHandler(serverCtx),
+				Path:    "/userCenter/ent/userInfo",
+				Handler: GetEntUserInfoHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/workDesktop/renew/:actionMode",
-				Handler: WorkDesktopComprehensiveHandler(serverCtx),
+				Path:    "/userCenter/user/getUserInfo",
+				Handler: GetUserInfoHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodGet,
@@ -74,18 +79,13 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/user/getUserInfo",
-				Handler: GetUserInfoHandler(serverCtx),
-			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/userCenter/ent/userInfo",
-				Handler: GetEntUserInfoHandler(serverCtx),
+				Path:    "/userCenter/workDesktop/menuInfo",
+				Handler: WorkDesktopMenuInfoHandler(serverCtx),
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/userCenter/ent/getUserInfoByPId",
-				Handler: GetEntUserInfoByPositonIdHandler(serverCtx),
+				Path:    "/userCenter/workDesktop/renew/:actionMode",
+				Handler: WorkDesktopComprehensiveHandler(serverCtx),
 			},
 		},
 	)
@@ -97,11 +97,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/userCenter/user/add",
 				Handler: UserAddHandler(serverCtx),
 			},
-			{
-				Method:  http.MethodPost,
-				Path:    "/userCenter/user/updateById",
-				Handler: UserUpdateHandler(serverCtx),
-			},
 			{
 				Method:  http.MethodPost,
 				Path:    "/userCenter/user/deleteById",
@@ -112,6 +107,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/userCenter/user/identity",
 				Handler: UserIdentityHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/userCenter/user/updateById",
+				Handler: UserUpdateHandler(serverCtx),
+			},
 		},
 		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
 	)

+ 166 - 158
api/internal/types/types.go

@@ -1,69 +1,35 @@
 // Code generated by goctl. DO NOT EDIT.
 package types
 
-type Response struct {
-	Error_code int64  `json:"error_code"` //响应代码
-	Error_msg  string `json:"error_msg"`  //响应消息
-	Data       string `json:"data"`       //响应内容
-}
-
-type Resp struct {
-	Error_code int64       `json:"error_code"` //响应代码
-	Error_msg  string      `json:"error_msg"`  //响应消息
+type CommonResp struct {
+	Error_code int64       `json:"error_code"`
+	Error_msg  string      `json:"error_msg"`
 	Data       interface{} `json:"data"`
 }
 
-type ExamineReq struct {
-	EntId     int64  `json:"entId"`           //企业id
-	AuthType  string `json:"authType"`        //审核状态  2审核通过  3审核不通过
-	Reason    string `json:"reason,optional"` //不通过原因
-	AuditUser string `json:"auditUser"`       //审核人
-	ExamineId string `json:"examineId"`       //审核id 认证记录表主键id
-}
-
-type CheckEntReq struct {
-	EntId int64 `header:"entId"` //企业id
-}
-
-type AuthEntReq struct {
+type EntInfo struct {
 	Name             string `json:"name"`
+	OrganizationType string `json:"organizationType"`
 	CreditCode       string `json:"creditCode"`
+	CompanyType      int64  `json:"companyType"`
 	AreaNumber       string `json:"areaNumber"`
 	Business         string `json:"business"`
 	OfficialLetter   string `json:"officialLetter"`
-	OrganizationType string `json:"organizationType"` //机构类型  1投标企业  2招标采购单位 3厂商 4招标代理机构 5经销商  6服务提供商  7其他
-	ComPanyType      string `json:"comPanyType"`      //机构性质    1企业   2党政机关事业单位及其他
-	AuthName         string `json:"authName"`         //联系人姓名
-	AuthPhone        string `json:"authPhone"`        //联系人手机号
-	Phone            string `header:"phone"`          //注册手机号
-	EntId            int64  `header:"entId,optional"`
-}
-
-type EntListReq struct {
-	Name            string `json:"name,optional"`    //企业名称
-	PageNum         string `json:"pageNum,optional"` //页码,不传默认第一页 第一页为0
-	PageSize        string `json:"pageSize,optional"`
-	CreditCode      string `json:"creditCode,optional"`
-	CreateStartTime string `json:"createStartTime,optional"`
-	CreateEndTime   string `json:"createEndTime,optional"`
-	AuthStatus      string `json:"authStatus,optional"`
-	ValidStartTime  string `json:"validStartTime,optional"`
-	ValidEndTime    string `json:"validEndTime,optional"`
-	FrozenStatus    string `json:"frozenStatus,optional"`
-	RegPhone        string `json:"regPhone,optional"`
-	AuthPhone       string `json:"authPhone,optional"`
-}
-
-type EntListResp struct {
-	Error_code int64       `json:"error_code"` //响应代码
-	Error_msg  string      `json:"error_msg"`  //响应消息
-	Data       EntListData `json:"data"`
+	AuthStartTime    string `json:"createTime"`
+	AuthEndTime      string `json:"validTime"`
+	ForzenStatus     int64  `json:"forzenStatus"`
+	AuthState        int64  `json:"authStatus"`
+	ContactPerson    string `json:"contactPerson"`
+	ContactPhone     string `json:"contactPhone"`
+	AuthType         int64  `json:"authType"`   //审核状态 1:待审核  2:审核通过 3:审核不通过
+	SubmitTime       string `json:"submitTime"` //提交时间 即库中的createtime
+	AuthReason       string `json:"authReason"`
 }
 
-type EntListData struct {
-	Count    int64      `json:"count"`
-	PageSize int64      `json:"pageSize"`
-	List     []*EntList `json:"list"`
+type EntInfoResp struct {
+	Error_code int64    `json:"error_code"`
+	Error_msg  string   `json:"error_msg"`
+	Data       *EntInfo `json:"data"`
 }
 
 type EntList struct {
@@ -77,48 +43,20 @@ type EntList struct {
 	FrozenStatus     int64  `json:"frozenStatus"`     //冻结状态  1正常  0冻结
 }
 
-type ExamineListReq struct {
-	Name          string `json:"name,optional"`          //机构名称
-	AuthPhone     string `json:"authPhone,optional"`     //联系人手机号
-	RegPhone      string `json:"regPhone,optional"`      //注册人手机号
-	AuthType      string `json:"authType,optional"`      //审核状态 1:待审核  2:审核通过 3:审核不通过
-	AuthStartTime string `json:"authStartTime,optional"` //申请开始时间
-	AuthEndTime   string `json:"authEndTime,optional"`   //申请结束时间
-	PageNum       string `json:"pageNum,optional"`       //页码
-	PageSize      string `json:"pageSize,optional"`      //每页展示条数
-}
-
-type ExamineListResp struct {
-	Error_code int64           `json:"error_code"`
-	Error_msg  string          `json:"error_msg"`
-	Data       ExamineListData `json:"data"`
-}
-
-type ExamineListData struct {
-	Count    int64          `json:"count"`
-	PageSize int64          `json:"pageSize"`
-	List     []*ExamineList `json:"list"`
-}
-
-type ExamineList struct {
-	Id          int64  `json:"id"`          //机构id
-	EntId       int64  `json:"entId"`       //企业id
-	ComPanyType int64  `json:"comPanyType"` // 机构性质    1企业   2党政机关事业单位及其他
-	Name        string `json:"name"`        //机构名称
-	CreditCode  string `json:"creditCode"`  //统一社会信用代码
-	AuthPhone   string `json:"authPhone"`   //联系人手机号
-	ApplyTime   string `json:"applyTime"`   //申请时间戳
-	AuthType    int64  `json:"authType"`    //审核状态 1:待审核  2:审核通过 3:审核不通过
-	RegPhone    string `json:"regPhone"`    //注册人手机号
+type EntListData struct {
+	Count    int64      `json:"count"`
+	PageSize int64      `json:"pageSize"`
+	List     []*EntList `json:"list"`
 }
 
-type EntInfoResp struct {
-	Error_code int64    `json:"error_code"`
-	Error_msg  string   `json:"error_msg"`
-	Data       *EntInfo `json:"data"`
+type EntUserReq struct {
+	AppId           string `header:"appId,default=10000"`
+	EntUserId       int64  `json:"entUserId,optional"`
+	HeaderEntUserId int64  `header:"entUserId,optional"`
+	EntId           int64  `header:"entId,optional"`
 }
 
-type EntInfo struct {
+type ExamineInfo struct {
 	Name             string `json:"name"`
 	OrganizationType string `json:"organizationType"`
 	CreditCode       string `json:"creditCode"`
@@ -126,15 +64,14 @@ type EntInfo struct {
 	AreaNumber       string `json:"areaNumber"`
 	Business         string `json:"business"`
 	OfficialLetter   string `json:"officialLetter"`
-	AuthStartTime    string `json:"createTime"`
-	AuthEndTime      string `json:"validTime"`
-	ForzenStatus     int64  `json:"forzenStatus"`
 	AuthState        int64  `json:"authStatus"`
 	ContactPerson    string `json:"contactPerson"`
 	ContactPhone     string `json:"contactPhone"`
-	AuthType         int64  `json:"authType"`   //审核状态 1:待审核  2:审核通过 3:审核不通过
-	SubmitTime       string `json:"submitTime"` //提交时间 即库中的createtime
+	RegPhone         string `json:"regPhone"`
+	AuthTime         string `json:"authTime"`
 	AuthReason       string `json:"authReason"`
+	AuditUser        string `json:"auditUser"`
+	AuditTime        string `json:"auditTime"`
 }
 
 type ExamineInfoReq struct {
@@ -147,27 +84,48 @@ type ExamineInfoResp struct {
 	Data       *ExamineInfo `json:"data"`
 }
 
-type ExamineInfo struct {
-	Name             string `json:"name"`
-	OrganizationType string `json:"organizationType"`
-	CreditCode       string `json:"creditCode"`
-	CompanyType      int64  `json:"companyType"`
-	AreaNumber       string `json:"areaNumber"`
-	Business         string `json:"business"`
-	OfficialLetter   string `json:"officialLetter"`
-	AuthState        int64  `json:"authStatus"`
-	ContactPerson    string `json:"contactPerson"`
-	ContactPhone     string `json:"contactPhone"`
-	RegPhone         string `json:"regPhone"`
-	AuthTime         string `json:"authTime"`
-	AuthReason       string `json:"authReason"`
-	AuditUser        string `json:"auditUser"`
-	AuditTime        string `json:"auditTime"`
+type ExamineList struct {
+	Id          int64  `json:"id"`          //机构id
+	EntId       int64  `json:"entId"`       //企业id
+	ComPanyType int64  `json:"comPanyType"` // 机构性质    1企业   2党政机关事业单位及其他
+	Name        string `json:"name"`        //机构名称
+	CreditCode  string `json:"creditCode"`  //统一社会信用代码
+	AuthPhone   string `json:"authPhone"`   //联系人手机号
+	ApplyTime   string `json:"applyTime"`   //申请时间戳
+	AuthType    int64  `json:"authType"`    //审核状态 1:待审核  2:审核通过 3:审核不通过
+	RegPhone    string `json:"regPhone"`    //注册人手机号
 }
 
-type UpdateEntReq struct {
-	EntId      int64 `json:"entId"`      //企业id
-	UpdateType int64 `json:"updateType"` //1-冻结  2-解冻
+type ExamineListData struct {
+	Count    int64          `json:"count"`
+	PageSize int64          `json:"pageSize"`
+	List     []*ExamineList `json:"list"`
+}
+
+type ExamineListReq struct {
+	Name          string `json:"name,optional"`          //机构名称
+	AuthPhone     string `json:"authPhone,optional"`     //联系人手机号
+	RegPhone      string `json:"regPhone,optional"`      //注册人手机号
+	AuthType      string `json:"authType,optional"`      //审核状态 1:待审核  2:审核通过 3:审核不通过
+	AuthStartTime string `json:"authStartTime,optional"` //申请开始时间
+	AuthEndTime   string `json:"authEndTime,optional"`   //申请结束时间
+	PageNum       string `json:"pageNum,optional"`       //页码
+	PageSize      string `json:"pageSize,optional"`      //每页展示条数
+}
+
+type ExamineListResp struct {
+	Error_code int64  `json:"error_code"`
+	Error_msg  string `json:"error_msg"`
+	Data       struct {
+		Count    int64          `json:"count"`
+		PageSize int64          `json:"pageSize"`
+		List     []*ExamineList `json:"list"`
+	} `json:"data"`
+}
+
+type GetStatus struct {
+	AuthStatus int64 `json:"authStatus"`
+	IsInEnt    bool  `json:"isInEnt"`
 }
 
 type GetStatusByCodeReq struct {
@@ -181,23 +139,14 @@ type GetStatusByCodeResp struct {
 	Data       *GetStatus `json:"data"`
 }
 
-type GetStatus struct {
-	AuthStatus int64 `json:"authStatus"`
-	IsInEnt    bool  `json:"isInEnt"`
-}
-
-type UserReq struct {
-	AppId  string `header:"appId,default=10000"`
-	UserId int    `header:"newUserId,optional"` //session中的用户base_user_id
-	Uid    string `json:"uid,optional"`         //前端传的uid
-	Types  string `json:"types,optional"`       //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+type GetUserInfoByPIdReq struct {
+	AppId      string `header:"appId"`
+	PositionId string `json:"positionId"` //职位id
 }
 
-type EntUserReq struct {
-	AppId           string `header:"appId,default=10000"`
-	EntUserId       int64  `json:"entUserId,optional"`
-	HeaderEntUserId int64  `header:"entUserId,optional"`
-	EntId           int64  `header:"entId,optional"`
+type UpdateEntReq struct {
+	EntId      int64 `json:"entId"`      //企业id
+	UpdateType int64 `json:"updateType"` //1-冻结  2-解冻
 }
 
 type UserAddReq struct {
@@ -217,6 +166,24 @@ type UserAddReq struct {
 	Sex           int64  `json:"sex,optional"`
 }
 
+type UserDelReq struct {
+	Authorization string `header:"Authorization"`
+	Id            int64  `json:"id"`
+}
+
+type UserIdentityReq struct {
+	AppId     string `json:"appId"`
+	NewUserId int64  `json:"newUserId"`
+	EntId     int64  `json:"entId,optional"`
+}
+
+type UserReq struct {
+	AppId  string `header:"appId,default=10000"`
+	UserId int    `header:"newUserId,optional"` //session中的用户base_user_id
+	Uid    string `json:"uid,optional"`         //前端传的uid
+	Types  string `json:"types,optional"`       //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+}
+
 type UserUpdateReq struct {
 	Authorization string `header:"Authorization"`
 	Appid         string `json:"appid"`
@@ -232,69 +199,110 @@ type UserUpdateReq struct {
 	Unionid       string `json:"unionid,optional"`
 }
 
-type UserDelReq struct {
-	Authorization string `header:"Authorization"`
-	Id            int64  `json:"id"`
+type WorkDesktopClearUserInfo struct {
+	Platform   string `json:"platform,default=PC,options=PC|WX|APP|H5"`
+	PositionId string `header:"positionId,optional"` //职位id
+	UserId     string `header:"userId"`
+	AppId      string `header:"appId"`
 }
 
-type WorkDesktopMenuInfoReq struct {
+type WorkDesktopComprehensiveReq struct {
 	Platform     string `json:"platform,default=PC,options=PC|WX|APP|H5"`
-	UserId       string `header:"userId"`
+	UserId       string `header:"userId,optional"`
 	AppId        string `header:"appId"`
 	Phone        string `header:"phone,optional"`
-	NewUserId    string `header:"newUserId"` //base_user_id<---base_user
+	MenuMode     string `json:"menuMode,optional"`
+	MenuIds      string `json:"menuIds,optional"`
+	ActionMode   string `path:"actionMode,options=commonlyRenew|commonlyList|menuMode"`
+	NewUserId    string `header:"newUserId"`
 	EntId        string `header:"entId,optional"`
 	EntUserId    string `header:"entUserId,optional"`
 	AccountId    string `header:"accountId,optional"`    //账户id
 	EntAccountId string `header:"entAccountId,optional"` //企业账户id
 	PositionType string `header:"positionType,optional"` //职位类型 0个人 1企业
 	PositionId   string `header:"positionId,optional"`   //职位id
-	WorkStatus   int64  `json:"workStatus,optional"`     //服务是否可用;1:内网可用;-1:不可用
 	MgoUserId    string `header:"mgoUserId,optional"`    //原userId
 	EntNicheDis  int64  `header:"entNicheDis,optional"`  // 企业下角色 0:销售 1:企业资讯分配 2:部门资讯分配 3:企业资讯分配+销售 4:部门资讯分配+销售
 	EntUserRole  string `header:"entUserRole,optional"`  // 企业下角色 1:情报处理岗 2:情报分配岗 3:信息浏览岗 4:销售管理岗,多个逗号拼接
 }
 
-type WorkDesktopComprehensiveReq struct {
+type WorkDesktopMenuInfoReq struct {
 	Platform     string `json:"platform,default=PC,options=PC|WX|APP|H5"`
 	UserId       string `header:"userId"`
 	AppId        string `header:"appId"`
 	Phone        string `header:"phone,optional"`
-	MenuMode     string `json:"menuMode,optional"`
-	MenuIds      string `json:"menuIds,optional"`
-	ActionMode   string `path:"actionMode,options=commonlyRenew|commonlyList|menuMode"`
-	NewUserId    string `header:"newUserId"`
+	NewUserId    string `header:"newUserId"` //base_user_id<---base_user
 	EntId        string `header:"entId,optional"`
 	EntUserId    string `header:"entUserId,optional"`
 	AccountId    string `header:"accountId,optional"`    //账户id
 	EntAccountId string `header:"entAccountId,optional"` //企业账户id
 	PositionType string `header:"positionType,optional"` //职位类型 0个人 1企业
 	PositionId   string `header:"positionId,optional"`   //职位id
+	WorkStatus   int64  `json:"workStatus,optional"`     //服务是否可用;1:内网可用;-1:不可用
 	MgoUserId    string `header:"mgoUserId,optional"`    //原userId
 	EntNicheDis  int64  `header:"entNicheDis,optional"`  // 企业下角色 0:销售 1:企业资讯分配 2:部门资讯分配 3:企业资讯分配+销售 4:部门资讯分配+销售
 	EntUserRole  string `header:"entUserRole,optional"`  // 企业下角色 1:情报处理岗 2:情报分配岗 3:信息浏览岗 4:销售管理岗,多个逗号拼接
 }
 
-type CommonResp struct {
-	Error_code int64       `json:"error_code"`
-	Error_msg  string      `json:"error_msg"`
-	Data       interface{} `json:"data"`
+type AuthEntReq struct {
+	Name             string `json:"name"`
+	CreditCode       string `json:"creditCode"`
+	AreaNumber       string `json:"areaNumber"`
+	Business         string `json:"business"`
+	OfficialLetter   string `json:"officialLetter"`
+	OrganizationType string `json:"organizationType"` //机构类型  1投标企业  2招标采购单位 3厂商 4招标代理机构 5经销商  6服务提供商  7其他
+	ComPanyType      string `json:"comPanyType"`      //机构性质    1企业   2党政机关事业单位及其他
+	AuthName         string `json:"authName"`         //联系人姓名
+	AuthPhone        string `json:"authPhone"`        //联系人手机号
+	Phone            string `header:"phone"`          //注册手机号
+	EntId            int64  `header:"entId,optional"`
 }
 
-type WorkDesktopClearUserInfo struct {
-	Platform   string `json:"platform,default=PC,options=PC|WX|APP|H5"`
-	PositionId string `header:"positionId,optional"` //职位id
-	UserId     string `header:"userId"`
-	AppId      string `header:"appId"`
+type CheckEntReq struct {
+	EntId int64 `header:"entId"` //企业id
 }
 
-type UserIdentityReq struct {
-	AppId     string `json:"appId"`
-	NewUserId int64  `json:"newUserId"`
-	EntId     int64  `json:"entId,optional"`
+type EntListReq struct {
+	Name            string `json:"name,optional"`    //企业名称
+	PageNum         string `json:"pageNum,optional"` //页码,不传默认第一页 第一页为0
+	PageSize        string `json:"pageSize,optional"`
+	CreditCode      string `json:"creditCode,optional"`
+	CreateStartTime string `json:"createStartTime,optional"`
+	CreateEndTime   string `json:"createEndTime,optional"`
+	AuthStatus      string `json:"authStatus,optional"`
+	ValidStartTime  string `json:"validStartTime,optional"`
+	ValidEndTime    string `json:"validEndTime,optional"`
+	FrozenStatus    string `json:"frozenStatus,optional"`
+	RegPhone        string `json:"regPhone,optional"`
+	AuthPhone       string `json:"authPhone,optional"`
 }
 
-type GetUserInfoByPIdReq struct {
-	AppId      string `header:"appId"`
-	PositionId string `json:"positionId"` //职位id
+type EntListResp struct {
+	Error_code int64  `json:"error_code"` //响应代码
+	Error_msg  string `json:"error_msg"`  //响应消息
+	Data       struct {
+		Count    int64      `json:"count"`
+		PageSize int64      `json:"pageSize"`
+		List     []*EntList `json:"list"`
+	} `json:"data"`
+}
+
+type ExamineReq struct {
+	EntId     int64  `json:"entId"`           //企业id
+	AuthType  string `json:"authType"`        //审核状态  2审核通过  3审核不通过
+	Reason    string `json:"reason,optional"` //不通过原因
+	AuditUser string `json:"auditUser"`       //审核人
+	ExamineId string `json:"examineId"`       //审核id 认证记录表主键id
+}
+
+type Resp struct {
+	Error_code int64       `json:"error_code"` //响应代码
+	Error_msg  string      `json:"error_msg"`  //响应消息
+	Data       interface{} `json:"data"`
+}
+
+type Response struct {
+	Error_code int64  `json:"error_code"` //响应代码
+	Error_msg  string `json:"error_msg"`  //响应消息
+	Data       string `json:"data"`       //响应内容
 }

+ 70 - 83
api/userCenter.api

@@ -3,30 +3,27 @@ syntax = "v1"
 type (
 	response {
 		Error_code int64  `json:"error_code"` //响应代码
-		Error_msg  string `json:"error_msg"`  //响应消息
-		Data       string `json:"data"`       //响应内容
+		Error_msg  string `json:"error_msg"` //响应消息
+		Data       string `json:"data"` //响应内容
 	}
 	//
 	resp {
 		Error_code int64       `json:"error_code"` //响应代码
-		Error_msg  string      `json:"error_msg"`  //响应消息
+		Error_msg  string      `json:"error_msg"` //响应消息
 		Data       interface{} `json:"data"`
 	}
-
 	//机构审核入参
 	examineReq {
-		EntId     int64  `json:"entId"`           //企业id
-		AuthType  string `json:"authType"`        //审核状态  2审核通过  3审核不通过
+		EntId     int64  `json:"entId"` //企业id
+		AuthType  string `json:"authType"` //审核状态  2审核通过  3审核不通过
 		Reason    string `json:"reason,optional"` //不通过原因
-		AuditUser string `json:"auditUser"`       //审核人
-		ExamineId string `json:"examineId"`       //审核id 认证记录表主键id
+		AuditUser string `json:"auditUser"` //审核人
+		ExamineId string `json:"examineId"` //审核id 认证记录表主键id
 	}
-
 	//查看企业状态入参
 	checkEntReq {
 		EntId int64 `header:"entId"` //企业id
 	}
-
 	//认证企业 入参
 	authEntReq {
 		Name             string `json:"name"`
@@ -35,16 +32,15 @@ type (
 		Business         string `json:"business"`
 		OfficialLetter   string `json:"officialLetter"`
 		OrganizationType string `json:"organizationType"` //机构类型  1投标企业  2招标采购单位 3厂商 4招标代理机构 5经销商  6服务提供商  7其他
-		ComPanyType      string `json:"comPanyType"`      //机构性质    1企业   2党政机关事业单位及其他
-		AuthName         string `json:"authName"`         //联系人姓名
-		AuthPhone        string `json:"authPhone"`        //联系人手机号
-		Phone            string `header:"phone"`          //注册手机号
+		ComPanyType      string `json:"comPanyType"` //机构性质    1企业   2党政机关事业单位及其他
+		AuthName         string `json:"authName"` //联系人姓名
+		AuthPhone        string `json:"authPhone"` //联系人手机号
+		Phone            string `header:"phone"` //注册手机号
 		EntId            int64  `header:"entId,optional"`
 	}
-
 	//企业列表
 	entListReq {
-		Name            string `json:"name,optional"`    //企业名称
+		Name            string `json:"name,optional"` //企业名称
 		PageNum         string `json:"pageNum,optional"` //页码,不传默认第一页 第一页为0
 		PageSize        string `json:"pageSize,optional"`
 		CreditCode      string `json:"creditCode,optional"`
@@ -57,75 +53,66 @@ type (
 		RegPhone        string `json:"regPhone,optional"`
 		AuthPhone       string `json:"authPhone,optional"`
 	}
-
 	//企业列表出参
 	entListResp {
 		Error_code int64       `json:"error_code"` //响应代码
-		Error_msg  string      `json:"error_msg"`  //响应消息
+		Error_msg  string      `json:"error_msg"` //响应消息
 		Data       EntListData `json:"data"`
 	}
-
 	EntListData {
 		Count    int64      `json:"count"`
 		PageSize int64      `json:"pageSize"`
 		List     []*EntList `json:"list"`
 	}
-
 	EntList {
 		Id               int64  `json:"id"`
-		ComPanyType      int64  `json:"comPanyType"`      // 机构性质    1企业   2党政机关事业单位及其他
-		Name             string `json:"name"`             //机构名称
+		ComPanyType      int64  `json:"comPanyType"` // 机构性质    1企业   2党政机关事业单位及其他
+		Name             string `json:"name"` //机构名称
 		OrganizationType string `json:"organizationType"` //机构类型  1企业   2党政机关事业单位及其他
-		Createtime       string `json:"createTime"`       //创建时间
-		ValidTime        string `json:"validTime"`        //有效截至日期
-		AuthStatus       int64  `json:"authStatus"`       //认证状态
-		FrozenStatus     int64  `json:"frozenStatus"`     //冻结状态  1正常  0冻结
+		Createtime       string `json:"createTime"` //创建时间
+		ValidTime        string `json:"validTime"` //有效截至日期
+		AuthStatus       int64  `json:"authStatus"` //认证状态
+		FrozenStatus     int64  `json:"frozenStatus"` //冻结状态  1正常  0冻结
 	}
-
 	//审核列表入参
 	ExamineListReq {
-		Name          string `json:"name,optional"`          //机构名称
-		AuthPhone     string `json:"authPhone,optional"`     //联系人手机号
-		RegPhone      string `json:"regPhone,optional"`      //注册人手机号
-		AuthType      string `json:"authType,optional"`      //审核状态 1:待审核  2:审核通过 3:审核不通过
+		Name          string `json:"name,optional"` //机构名称
+		AuthPhone     string `json:"authPhone,optional"` //联系人手机号
+		RegPhone      string `json:"regPhone,optional"` //注册人手机号
+		AuthType      string `json:"authType,optional"` //审核状态 1:待审核  2:审核通过 3:审核不通过
 		AuthStartTime string `json:"authStartTime,optional"` //申请开始时间
-		AuthEndTime   string `json:"authEndTime,optional"`   //申请结束时间
-		PageNum       string `json:"pageNum,optional"`       //页码
-		PageSize      string `json:"pageSize,optional"`      //每页展示条数
+		AuthEndTime   string `json:"authEndTime,optional"` //申请结束时间
+		PageNum       string `json:"pageNum,optional"` //页码
+		PageSize      string `json:"pageSize,optional"` //每页展示条数
 	}
-
 	//审核列表出参
 	ExamineListResp {
 		Error_code int64           `json:"error_code"`
 		Error_msg  string          `json:"error_msg"`
 		Data       ExamineListData `json:"data"`
 	}
-
 	ExamineListData {
 		Count    int64          `json:"count"`
 		PageSize int64          `json:"pageSize"`
 		List     []*ExamineList `json:"list"`
 	}
-
 	ExamineList {
-		Id          int64  `json:"id"`          //机构id
-		EntId       int64  `json:"entId"`       //企业id
+		Id          int64  `json:"id"` //机构id
+		EntId       int64  `json:"entId"` //企业id
 		ComPanyType int64  `json:"comPanyType"` // 机构性质    1企业   2党政机关事业单位及其他
-		Name        string `json:"name"`        //机构名称
-		CreditCode  string `json:"creditCode"`  //统一社会信用代码
-		AuthPhone   string `json:"authPhone"`   //联系人手机号
-		ApplyTime   string `json:"applyTime"`   //申请时间戳
-		AuthType    int64  `json:"authType"`    //审核状态 1:待审核  2:审核通过 3:审核不通过
-		RegPhone    string `json:"regPhone"`    //注册人手机号
+		Name        string `json:"name"` //机构名称
+		CreditCode  string `json:"creditCode"` //统一社会信用代码
+		AuthPhone   string `json:"authPhone"` //联系人手机号
+		ApplyTime   string `json:"applyTime"` //申请时间戳
+		AuthType    int64  `json:"authType"` //审核状态 1:待审核  2:审核通过 3:审核不通过
+		RegPhone    string `json:"regPhone"` //注册人手机号
 	}
-
 	//企业信息出参
 	EntInfoResp {
 		Error_code int64    `json:"error_code"`
 		Error_msg  string   `json:"error_msg"`
 		Data       *EntInfo `json:"data"`
 	}
-
 	EntInfo {
 		Name             string `json:"name"`
 		OrganizationType string `json:"organizationType"`
@@ -140,23 +127,20 @@ type (
 		AuthState        int64  `json:"authStatus"`
 		ContactPerson    string `json:"contactPerson"`
 		ContactPhone     string `json:"contactPhone"`
-		AuthType         int64  `json:"authType"`   //审核状态 1:待审核  2:审核通过 3:审核不通过
+		AuthType         int64  `json:"authType"` //审核状态 1:待审核  2:审核通过 3:审核不通过
 		SubmitTime       string `json:"submitTime"` //提交时间 即库中的createtime
 		AuthReason       string `json:"authReason"`
 	}
-
 	//审核入参
 	ExamineInfoReq {
 		ExamineId int64 `json:"examineId"`
 	}
-
 	//审核详情出参
 	ExamineInfoResp {
 		Error_code int64        `json:"error_code"`
 		Error_msg  string       `json:"error_msg"`
 		Data       *ExamineInfo `json:"data"`
 	}
-
 	ExamineInfo {
 		Name             string `json:"name"`
 		OrganizationType string `json:"organizationType"`
@@ -174,45 +158,38 @@ type (
 		AuditUser        string `json:"auditUser"`
 		AuditTime        string `json:"auditTime"`
 	}
-
 	//冻结解冻入参
 	UpdateEntReq {
-		EntId      int64 `json:"entId"`      //企业id
+		EntId      int64 `json:"entId"` //企业id
 		UpdateType int64 `json:"updateType"` //1-冻结  2-解冻
 	}
-
 	//根据统一社会信用代码查看企业状态入参
 	GetStatusByCodeReq {
 		Code  string `json:"code"`
 		Phone string `header:"phone"`
 	}
-
 	//根据统一社会信用代码查看企业状态出参
 	GetStatusByCodeResp {
 		Error_code int64      `json:"error_code"`
 		Error_msg  string     `json:"error_msg"`
 		Data       *GetStatus `json:"data"`
 	}
-
 	GetStatus {
 		AuthStatus int64 `json:"authStatus"`
 		IsInEnt    bool  `json:"isInEnt"`
 	}
-
 	UserReq {
 		AppId  string `header:"appId,default=10000"`
 		UserId int    `header:"newUserId,optional"` //session中的用户base_user_id
-		Uid    string `json:"uid,optional"`         //前端传的uid
-		Types  string `json:"types,optional"`       //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
+		Uid    string `json:"uid,optional"` //前端传的uid
+		Types  string `json:"types,optional"` //类型,不传按默认规则获取 m大会员 e商机管理 v超级订阅 f免费订阅
 	}
-
 	EntUserReq {
 		AppId           string `header:"appId,default=10000"`
 		EntUserId       int64  `json:"entUserId,optional"`
 		HeaderEntUserId int64  `header:"entUserId,optional"`
 		EntId           int64  `header:"entId,optional"`
 	}
-
 	UserAddReq {
 		Authorization string `header:"Authorization"`
 		Appid         string `json:"appid"`
@@ -229,7 +206,6 @@ type (
 		Address       string `json:"address,optional"`
 		Sex           int64  `json:"sex,optional"`
 	}
-
 	UserUpdateReq {
 		Authorization string `header:"Authorization"`
 		Appid         string `json:"appid"`
@@ -244,12 +220,10 @@ type (
 		AOpenid       string `json:"a_openid,optional"`
 		Unionid       string `json:"unionid,optional"`
 	}
-
 	UserDelReq {
 		Authorization string `header:"Authorization"`
 		Id            int64  `json:"id"`
 	}
-
 	//工作桌面 -- 菜单
 	WorkDesktopMenuInfoReq {
 		Platform     string `json:"platform,default=PC,options=PC|WX|APP|H5"`
@@ -259,20 +233,20 @@ type (
 		NewUserId    string `header:"newUserId"` //base_user_id<---base_user
 		EntId        string `header:"entId,optional"`
 		EntUserId    string `header:"entUserId,optional"`
-		AccountId    string `header:"accountId,optional"`    //账户id
+		AccountId    string `header:"accountId,optional"` //账户id
 		EntAccountId string `header:"entAccountId,optional"` //企业账户id
 		PositionType string `header:"positionType,optional"` //职位类型 0个人 1企业
-		PositionId   string `header:"positionId,optional"`   //职位id
-		WorkStatus   int64  `json:"workStatus,optional"`     //服务是否可用;1:内网可用;-1:不可用
-		MgoUserId    string `header:"mgoUserId,optional"`    //原userId
-		EntNicheDis  int64  `header:"entNicheDis,optional"`  // 企业下角色 0:销售 1:企业资讯分配 2:部门资讯分配 3:企业资讯分配+销售 4:部门资讯分配+销售
-		EntUserRole  string `header:"entUserRole,optional"`  // 企业下角色 1:情报处理岗 2:情报分配岗 3:信息浏览岗 4:销售管理岗,多个逗号拼接
+		PositionId   string `header:"positionId,optional"` //职位id
+		WorkStatus   int64  `json:"workStatus,optional"` //服务是否可用;1:内网可用;-1:不可用
+		MgoUserId    string `header:"mgoUserId,optional"` //原userId
+		EntNicheDis  int64  `header:"entNicheDis,optional"` // 企业下角色 0:销售 1:企业资讯分配 2:部门资讯分配 3:企业资讯分配+销售 4:部门资讯分配+销售
+		EntUserRole  string `header:"entUserRole,optional"` // 企业下角色 1:情报处理岗 2:情报分配岗 3:信息浏览岗 4:销售管理岗,多个逗号拼接
 	}
 	//工作桌面-- 菜单模式:全部/可用选择记录
 	//工作桌面--常用功能更新
 	WorkDesktopComprehensiveReq {
 		Platform     string `json:"platform,default=PC,options=PC|WX|APP|H5"`
-		UserId       string `header:"userId"`
+		UserId       string `header:"userId,optional"`
 		AppId        string `header:"appId"`
 		Phone        string `header:"phone,optional"`
 		MenuMode     string `json:"menuMode,optional"`
@@ -281,13 +255,13 @@ type (
 		NewUserId    string `header:"newUserId"`
 		EntId        string `header:"entId,optional"`
 		EntUserId    string `header:"entUserId,optional"`
-		AccountId    string `header:"accountId,optional"`    //账户id
+		AccountId    string `header:"accountId,optional"` //账户id
 		EntAccountId string `header:"entAccountId,optional"` //企业账户id
 		PositionType string `header:"positionType,optional"` //职位类型 0个人 1企业
-		PositionId   string `header:"positionId,optional"`   //职位id
-		MgoUserId    string `header:"mgoUserId,optional"`    //原userId
-		EntNicheDis  int64  `header:"entNicheDis,optional"`  // 企业下角色 0:销售 1:企业资讯分配 2:部门资讯分配 3:企业资讯分配+销售 4:部门资讯分配+销售
-		EntUserRole  string `header:"entUserRole,optional"`  // 企业下角色 1:情报处理岗 2:情报分配岗 3:信息浏览岗 4:销售管理岗,多个逗号拼接
+		PositionId   string `header:"positionId,optional"` //职位id
+		MgoUserId    string `header:"mgoUserId,optional"` //原userId
+		EntNicheDis  int64  `header:"entNicheDis,optional"` // 企业下角色 0:销售 1:企业资讯分配 2:部门资讯分配 3:企业资讯分配+销售 4:部门资讯分配+销售
+		EntUserRole  string `header:"entUserRole,optional"` // 企业下角色 1:情报处理岗 2:情报分配岗 3:信息浏览岗 4:销售管理岗,多个逗号拼接
 	}
 	//
 	CommonResp {
@@ -302,13 +276,11 @@ type (
 		UserId     string `header:"userId"`
 		AppId      string `header:"appId"`
 	}
-
 	UserIdentityReq {
 		AppId     string `json:"appId"`
 		NewUserId int64  `json:"newUserId"`
 		EntId     int64  `json:"entId,optional"`
 	}
-
 	GetUserInfoByPIdReq {
 		AppId      string `header:"appId"`
 		PositionId string `json:"positionId"` //职位id
@@ -318,49 +290,64 @@ type (
 service userCenter-api {
 	@handler Examine
 	post /userCenter/ent/examine (examineReq) returns (resp)
+
 	@handler CheckEnt
 	post /userCenter/ent/check (checkEntReq) returns (resp)
+
 	@handler EntAuth
 	post /userCenter/ent/auth (authEntReq) returns (resp)
+
 	@handler EntList
 	post /userCenter/ent/list (entListReq) returns (entListResp)
+
 	@handler ExamineList
 	post /userCenter/ent/examineList (ExamineListReq) returns (ExamineListResp)
+
 	@handler EntInfo
 	post /userCenter/ent/info (checkEntReq) returns (EntInfoResp)
+
 	@handler ExamineInfo
 	post /userCenter/ent/examineInfo (ExamineInfoReq) returns (ExamineInfoResp)
+
 	@handler UpdateEnt
 	post /userCenter/ent/update (UpdateEntReq) returns (resp)
+
 	@handler GetStatusByCode
 	post /userCenter/ent/getStatusByCode (GetStatusByCodeReq) returns (GetStatusByCodeResp)
-	
+
 	@handler WorkDesktopMenuInfo
 	post /userCenter/workDesktop/menuInfo (WorkDesktopMenuInfoReq) returns (CommonResp)
+
 	@handler WorkDesktopComprehensive
 	post /userCenter/workDesktop/renew/:actionMode (WorkDesktopComprehensiveReq) returns (CommonResp)
+
 	@handler WorkDesktopClearUserInfo
 	get /userCenter/workDesktop/clearUserInfo (WorkDesktopClearUserInfo) returns (CommonResp)
-	
+
 	@handler GetUserInfo
 	post /userCenter/user/getUserInfo (UserReq) returns (resp)
+
 	@handler GetEntUserInfo
 	post /userCenter/ent/userInfo (EntUserReq) returns (resp)
+
 	@handler GetEntUserInfoByPositonId
 	post /userCenter/ent/getUserInfoByPId (GetUserInfoByPIdReq) returns (resp)
 }
 
-@server(
+@server (
 	jwt: Auth
 )
 service userCenter-api {
 	@handler UserAdd
 	post /userCenter/user/add (UserAddReq) returns (resp)
+
 	@handler UserUpdate
 	post /userCenter/user/updateById (UserUpdateReq) returns (resp)
+
 	@handler UserDel
 	post /userCenter/user/deleteById (UserDelReq) returns (resp)
+
 	@handler UserIdentity
 	post /userCenter/user/identity (UserIdentityReq) returns (resp)
-	
-}
+}
+

+ 1 - 0
entity/entity.go

@@ -28,6 +28,7 @@ type RpcConfig struct {
 	BigMemberOff         bool
 	CommonlySize         int64                 //常用功能设置数量
 	CommonlyIds          string                //初始化常用功能内容
+	NotLoginCommonlyIds  string                //未登录初始化常用功能内容
 	UserRolePower        []string              //用户角色权限集合
 	MedicalFieldTimespan int64                 //医疗领域化 超级订阅 大会员到期时间> 90天
 	DefaultPopup         map[string]Additional //菜单默认弹窗

+ 32 - 30
entity/workDesktop.go

@@ -428,39 +428,41 @@ func CommonlyUpdate(in *pb.WorkDesktopComprehensiveReq) (B bool, M string) {
 			break
 		}
 	}
-	//更新此用户设置的常用功能
-	if B = BaseMysql.ExecTx("常用功能批量更新", func(tx *sql.Tx) bool {
-		//查询此用户常用功能是否已存在记录
-		var (
-			id           = 0
-			existingData *[]map[string]interface{}
-		)
-		//P278 身份切换  常用功能和职业id 绑定
-		existingData = BaseMysql.SelectBySqlByTx(tx, `SELECT id  FROM `+WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ? AND userid = ?  ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode, in.UserId)
-		if existingData != nil && len(*existingData) > 0 {
-			id = MC.IntAll((*existingData)[0]["id"])
-			//} else {
-			//	//P278 之前版本查询逻辑
-			//	existingData = BaseMysql.SelectBySqlByTx(tx, `SELECT id  FROM `+WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ?  ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode)
-			//	if existingData != nil && len(*existingData) > 0 {
-			//		id = MC.IntAll((*existingData)[0]["id"])
-			//	}
-		}
-		switch {
-		case id > 0: //更新
-			if BaseMysql.UpdateOrDeleteBySqlByTx(tx, `UPDATE `+WorkCommonly+` SET value = ?,userid = ?  WHERE id = ?`, strings.Join(ids, ","), in.UserId, id) < 0 {
-				logx.Info("常用功能-更新数据失败")
-				return false
+	if in.UserId != "" {
+		//更新此用户设置的常用功能
+		if B = BaseMysql.ExecTx("常用功能批量更新", func(tx *sql.Tx) bool {
+			//查询此用户常用功能是否已存在记录
+			var (
+				id           = 0
+				existingData *[]map[string]interface{}
+			)
+			//P278 身份切换  常用功能和职业id 绑定
+			existingData = BaseMysql.SelectBySqlByTx(tx, `SELECT id  FROM `+WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ? AND userid = ?  ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode, in.UserId)
+			if existingData != nil && len(*existingData) > 0 {
+				id = MC.IntAll((*existingData)[0]["id"])
+				//} else {
+				//	//P278 之前版本查询逻辑
+				//	existingData = BaseMysql.SelectBySqlByTx(tx, `SELECT id  FROM `+WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ?  ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode)
+				//	if existingData != nil && len(*existingData) > 0 {
+				//		id = MC.IntAll((*existingData)[0]["id"])
+				//	}
 			}
-		default: //插入
-			if BaseMysql.InsertBySqlByTx(tx, `INSERT INTO `+WorkCommonly+`  (appid,base_userid,platform,field,value,userid) VALUES (?,?,?,?,?,?)`, in.AppId, in.NewUserId, in.Platform, in.ActionMode, strings.Join(ids, ","), in.UserId) < 0 {
-				logx.Info("常用功能-插入数据失败")
-				return false
+			switch {
+			case id > 0: //更新
+				if BaseMysql.UpdateOrDeleteBySqlByTx(tx, `UPDATE `+WorkCommonly+` SET value = ?,userid = ?  WHERE id = ?`, strings.Join(ids, ","), in.UserId, id) < 0 {
+					logx.Info("常用功能-更新数据失败")
+					return false
+				}
+			default: //插入
+				if BaseMysql.InsertBySqlByTx(tx, `INSERT INTO `+WorkCommonly+`  (appid,base_userid,platform,field,value,userid) VALUES (?,?,?,?,?,?)`, in.AppId, in.NewUserId, in.Platform, in.ActionMode, strings.Join(ids, ","), in.UserId) < 0 {
+					logx.Info("常用功能-插入数据失败")
+					return false
+				}
 			}
+			return true
+		}); !B {
+			M = "常用功能更新数据失败"
 		}
-		return true
-	}); !B {
-		M = "常用功能更新数据失败"
 	}
 	return
 }

+ 1 - 0
rpc/etc/usercenter.yaml

@@ -90,3 +90,4 @@ WorkTableOut: work_menu_new
 WorkTableInside: work_menu_new
 RpcPort: "8081"
 MenuCacheKey: menu1
+NotLoginCommonlyIds: 47,51,63,524,163,165,55,515,167,59,57 #默认常用功能

+ 91 - 70
service/workDesktop.go

@@ -36,83 +36,103 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
 			pIds []string
 		)
 		logx.Info("--------------------:", fmt.Sprintf(`SELECT value  FROM `+entity.WorkCommonly+` WHERE base_userid = '%s' AND appid = %s AND field = '%s' AND userid = '%s' ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode, in.UserId))
-		//常用功能查看
-		existingData := entity.BaseMysql.SelectBySql(`SELECT value  FROM `+entity.WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ? AND userid = ? ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode, in.UserId)
-		if existingData == nil || len(*existingData) == 0 {
-			//P278原查询逻辑
-			existingData = entity.BaseMysql.SelectBySql(`SELECT value  FROM `+entity.WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ? ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode)
-		}
-		if existingData != nil && len(*existingData) > 0 {
-			eData := (*existingData)[0]
-			if MC.ObjToString(eData["value"]) != "" {
-				for _, pv := range strings.Split(MC.ObjToString(eData["value"]), ",") {
-					if pv == "" {
-						continue
+		if in.UserId != "" {
+			//常用功能查看
+			existingData := entity.BaseMysql.SelectBySql(`SELECT value  FROM `+entity.WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ? AND userid = ? ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode, in.UserId)
+			if existingData == nil || len(*existingData) == 0 {
+				//P278原查询逻辑
+				existingData = entity.BaseMysql.SelectBySql(`SELECT value  FROM `+entity.WorkCommonly+` WHERE base_userid = ? AND appid = ? AND field = ? ORDER BY id DESC `, in.NewUserId, in.AppId, in.ActionMode)
+			}
+			if existingData != nil && len(*existingData) > 0 {
+				eData := (*existingData)[0]
+				if MC.ObjToString(eData["value"]) != "" {
+					for _, pv := range strings.Split(MC.ObjToString(eData["value"]), ",") {
+						if pv == "" {
+							continue
+						}
+						pIds = append(pIds, pv)
+					}
+				}
+			} else {
+				if entity.ConfigJson.CommonlyIds != "" && len(strings.Split(entity.ConfigJson.CommonlyIds, ",")) > 0 {
+					// 判断用户身份
+					var ids []string
+					var oIds []string // 没有加密的id
+					var (
+						entId, _        = strconv.ParseInt(in.EntId, 10, 64)
+						newUserId, _    = strconv.ParseInt(in.NewUserId, 10, 64)
+						entUserId, _    = strconv.ParseInt(in.EntUserId, 10, 64)
+						accountId, _    = strconv.ParseInt(in.AccountId, 10, 64)
+						entAccountId, _ = strconv.ParseInt(in.EntAccountId, 10, 64)
+						positionType, _ = strconv.ParseInt(in.PositionType, 10, 64)
+						positionId, _   = strconv.ParseInt(in.PositionId, 10, 64)
+					)
+					userInfoRpc := entity.UserInfoRpc{
+						AppId:        in.AppId,
+						UserId:       in.UserId,
+						BaseUserId:   newUserId,
+						EntId:        entId,
+						EntUserId:    entUserId,
+						AccountId:    accountId,
+						EntAccountId: entAccountId,
+						PositionType: positionType,
+						PositionId:   positionId,
+						MgoUserId:    in.MgoUserId,
+					}
+					userPowers := userInfoRpc.GetUserPowers()
+					var subBool bool
+					for _, v := range strings.Split(entity.ConfigJson.CommonlyIds, ",") {
+						//  p562 我的订阅判断用户身份
+						if userPowers != nil {
+							if v == "163" { // 我的订阅(大会员)
+								if userPowers.Member.Status <= 0 {
+									continue
+								} else {
+									subBool = true
+								}
+							} else if v == "165" { // 我的订阅(超级订阅)
+								if subBool || userPowers.Vip.Status <= 0 {
+									continue
+								} else {
+									subBool = true
+								}
+							} else if v == "55" { // 我的订阅(商机管理)新版
+								if subBool || userPowers.Entniche.Status <= 0 || userPowers.Entniche.IsNew <= 0 {
+									continue
+								} else {
+									subBool = true
+								}
+							} else if v == "515" { // 我的订阅(商机管理)老版
+								if subBool || userPowers.Entniche.Status <= 0 || userPowers.Entniche.IsNew > 0 {
+									continue
+								} else {
+									subBool = true
+								}
+							} else if v == "167" { // 我的订阅
+								if subBool || userPowers.Vip.Status > 0 || userPowers.Member.Status > 0 || userPowers.Entniche.Status > 0 {
+									continue
+								}
+							}
+						}
+						oIds = append(oIds, v)
+						ids = append(ids, encrypt.SE.EncodeString(v))
+					}
+					in.MenuIds = strings.Join(ids, ",")
+					//初始化 常用功能
+					if b, _ := entity.CommonlyUpdate(in); b {
+						pIds = oIds
+					} else {
+						logx.Info("初始化常用功能异常")
 					}
-					pIds = append(pIds, pv)
 				}
 			}
-		} else {
-			if entity.ConfigJson.CommonlyIds != "" && len(strings.Split(entity.ConfigJson.CommonlyIds, ",")) > 0 {
+		} else { //未登录用户
+			if entity.ConfigJson.NotLoginCommonlyIds != "" && len(strings.Split(entity.ConfigJson.NotLoginCommonlyIds, ",")) > 0 {
 				// 判断用户身份
 				var ids []string
 				var oIds []string // 没有加密的id
-				var (
-					entId, _        = strconv.ParseInt(in.EntId, 10, 64)
-					newUserId, _    = strconv.ParseInt(in.NewUserId, 10, 64)
-					entUserId, _    = strconv.ParseInt(in.EntUserId, 10, 64)
-					accountId, _    = strconv.ParseInt(in.AccountId, 10, 64)
-					entAccountId, _ = strconv.ParseInt(in.EntAccountId, 10, 64)
-					positionType, _ = strconv.ParseInt(in.PositionType, 10, 64)
-					positionId, _   = strconv.ParseInt(in.PositionId, 10, 64)
-				)
-				userInfoRpc := entity.UserInfoRpc{
-					AppId:        in.AppId,
-					UserId:       in.UserId,
-					BaseUserId:   newUserId,
-					EntId:        entId,
-					EntUserId:    entUserId,
-					AccountId:    accountId,
-					EntAccountId: entAccountId,
-					PositionType: positionType,
-					PositionId:   positionId,
-					MgoUserId:    in.MgoUserId,
-				}
-				userPowers := userInfoRpc.GetUserPowers()
-				var subBool bool
+
 				for _, v := range strings.Split(entity.ConfigJson.CommonlyIds, ",") {
-					//  p562 我的订阅判断用户身份
-					if userPowers != nil {
-						if v == "163" { // 我的订阅(大会员)
-							if userPowers.Member.Status <= 0 {
-								continue
-							} else {
-								subBool = true
-							}
-						} else if v == "165" { // 我的订阅(超级订阅)
-							if subBool || userPowers.Vip.Status <= 0 {
-								continue
-							} else {
-								subBool = true
-							}
-						} else if v == "55" { // 我的订阅(商机管理)新版
-							if subBool || userPowers.Entniche.Status <= 0 || userPowers.Entniche.IsNew <= 0 {
-								continue
-							} else {
-								subBool = true
-							}
-						} else if v == "515" { // 我的订阅(商机管理)老版
-							if subBool || userPowers.Entniche.Status <= 0 || userPowers.Entniche.IsNew > 0 {
-								continue
-							} else {
-								subBool = true
-							}
-						} else if v == "167" { // 我的订阅
-							if subBool || userPowers.Vip.Status > 0 || userPowers.Member.Status > 0 || userPowers.Entniche.Status > 0 {
-								continue
-							}
-						}
-					}
 					oIds = append(oIds, v)
 					ids = append(ids, encrypt.SE.EncodeString(v))
 				}
@@ -125,6 +145,7 @@ func RenewWorkDesktopMenuModeOrCommonly(in *WorkDesktopComprehensiveReq) (r *Wor
 				}
 			}
 		}
+
 		if len(pIds) > 0 {
 			//P278 身份切换
 			positionType := ``