作者 tangxvhui

Merge branch 'dev' into test

@@ -20,6 +20,10 @@ func MiniUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { @@ -20,6 +20,10 @@ func MiniUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
20 20
21 l := user.NewMiniUserInfoLogic(r.Context(), svcCtx) 21 l := user.NewMiniUserInfoLogic(r.Context(), svcCtx)
22 resp, err := l.MiniUserInfo(&req) 22 resp, err := l.MiniUserInfo(&req)
  23 + if len(resp.Accounts) == 0 { // 无账号时登出
  24 + httpx.WriteJson(w, http.StatusUnauthorized, nil)
  25 + return
  26 + }
23 result.HttpResult(r, w, resp, err) 27 result.HttpResult(r, w, resp, err)
24 } 28 }
25 } 29 }
@@ -83,8 +83,8 @@ func (l *MiniUserInfoLogic) MiniUserInfo(req *types.MiniUserInfoRequest) (resp * @@ -83,8 +83,8 @@ func (l *MiniUserInfoLogic) MiniUserInfo(req *types.MiniUserInfoRequest) (resp *
83 CompanyName: companyName, 83 CompanyName: companyName,
84 Logo: logo, 84 Logo: logo,
85 UserId: account.Id, 85 UserId: account.Id,
86 - Name: user.Name,  
87 - Position: user.Position, 86 + Name: account.Name,
  87 + Position: account.Position,
88 }) 88 })
89 } 89 }
90 // 拥有的权限 90 // 拥有的权限
@@ -44,7 +44,11 @@ func (repository *ArticleRepository) Update(ctx context.Context, conn transactio @@ -44,7 +44,11 @@ func (repository *ArticleRepository) Update(ctx context.Context, conn transactio
44 return nil, err 44 return nil, err
45 } 45 }
46 queryFunc := func() (interface{}, error) { 46 queryFunc := func() (interface{}, error) {
  47 +<<<<<<< HEAD
47 tx = tx.Model(m).Save(m) 48 tx = tx.Model(m).Save(m)
  49 +=======
  50 + tx = tx.Model(m).Select("*").Updates(m)
  51 +>>>>>>> dev
48 return nil, tx.Error 52 return nil, tx.Error
49 } 53 }
50 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { 54 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {
@@ -42,7 +42,7 @@ func (repository *ArticleSectionRepository) Update(ctx context.Context, conn tra @@ -42,7 +42,7 @@ func (repository *ArticleSectionRepository) Update(ctx context.Context, conn tra
42 return nil, err 42 return nil, err
43 } 43 }
44 queryFunc := func() (interface{}, error) { 44 queryFunc := func() (interface{}, error) {
45 - tx = tx.Model(m).Save(m) 45 + tx = tx.Model(m).Select("*").Updates(m)
46 return nil, tx.Error 46 return nil, tx.Error
47 } 47 }
48 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil { 48 if _, err = repository.Query(queryFunc, m.CacheKeyFunc()); err != nil {