|
|
@@ -44,8 +44,16 @@ func Login(c *gin.Context) { |
|
|
|
} |
|
|
|
key := fmt.Sprintf("%s:camp_token:%s", c.GetString("mid"), user.Phone) |
|
|
|
cache.SetEx(key, token, 39528000) // 半年 |
|
|
|
res := map[string]string{ |
|
|
|
role := []string{"comm"} |
|
|
|
if user.Pid > 0 { |
|
|
|
user, _ = NewCampTaskStoreUserDb.GetCampTaskStoreUser(user.Pid) |
|
|
|
} |
|
|
|
if user.IsShowProject == 1 { |
|
|
|
role = append(role, "project") |
|
|
|
} |
|
|
|
res := map[string]interface{}{ |
|
|
|
"token": token, |
|
|
|
"role": role, |
|
|
|
} |
|
|
|
e.OutSuc(c, res, nil) |
|
|
|
return |
|
|
|