提交 391e3f2f authored 作者: Whispa's avatar Whispa

commit

上级 09e653c8
......@@ -8,7 +8,7 @@ import java.util.List;
import java.util.Optional;
public interface UserRepository extends PagingAndSortingRepository<TbCfUserInfo,String> {
Optional<TbCfUserInfo> findByAccount(String s);
Optional<TbCfUserInfo> findFirstByAccount(String s);
boolean existsByAccount(String s);
Optional<TbCfUserInfo> findByFirebaseUid(String s);
boolean existsByFirebaseUid(String s);
......
......@@ -2,7 +2,6 @@ package com.example.afrishop_v3.security.services;
import com.example.afrishop_v3.models.TbCfUserInfo;
import com.example.afrishop_v3.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
......@@ -22,7 +21,7 @@ public class AuthenticationUser implements IAuthenticationFacade {
}
public TbCfUserInfo user(){
return repository.findByAccount(getAuthentication().getName()).orElseGet(null);
return repository.findByFirebaseUid(getAuthentication().getName()).orElseGet(null);
}
public String userId(){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论