修改登录、管理员详情、对接销售服务

This commit is contained in:
2026-08-28 16:03:06 +08:00
parent 914a11d05a
commit 3759433495
6 changed files with 152 additions and 12 deletions
+13
View File
@@ -25,6 +25,8 @@ type UserInfo struct {
SaleMobile string // 销售手机
SaleProvince int64 // 销售省份
GroupId int64 // 分组ID
GroupName string // 分组名称
Type uint8 // 用户类型
Valid bool
}
@@ -44,6 +46,8 @@ func GetUserFromCtx(ctx context.Context) UserInfo {
saleName := md.Get("x-sale-name")
saleId := md.Get("x-sale-id")
groupId := md.Get("x-group-id")
groupName := md.Get("x-group-name")
Type := md.Get("x-user-type")
province := md.Get("x-sale-province")
mobile := md.Get("x-sale-mobile")
@@ -60,6 +64,15 @@ func GetUserFromCtx(ctx context.Context) UserInfo {
if len(storeName) > NumberZero {
userInfo.StoreName = storeName[NumberZero]
}
if len(groupName) > NumberZero {
userInfo.GroupName = groupName[NumberZero]
}
if len(Type) > NumberZero {
TypeInt, _ := strconv.ParseInt(Type[NumberZero], NumberTen, NumberSixtyFourth)
userInfo.Type = uint8(TypeInt)
}
if len(storeId) > NumberZero {
userInfo.StoreId, _ = strconv.ParseInt(storeId[NumberZero], NumberTen, NumberSixtyFourth)
}