huangjiajun hace 6 días
padre
commit
80b35e9762
Se han modificado 2 ficheros con 10 adiciones y 6 borrados
  1. +1
    -5
      app/store/svc/svc_index.go
  2. +9
    -1
      app/store/svc/svc_login.go

+ 1
- 5
app/store/svc/svc_index.go Ver fichero

@@ -11,13 +11,9 @@ import (

func UserInfo(c *gin.Context) {
store := svc.GetCampStore(c)
role := []string{"comm"}
if store.IsShowProject == 1 {
role = append(role, "project")
}

res := map[string]interface{}{
"phone": store.Phone,
"role": role,
}
e.OutSuc(c, res, nil)
return


+ 9
- 1
app/store/svc/svc_login.go Ver fichero

@@ -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


Cargando…
Cancelar
Guardar