第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

用戶實體 - 找不到符號

用戶實體 - 找不到符號

慕少森 2023-02-23 10:13:29
我正在嘗試使用 OAuth 設置用戶和身份驗證。我所有的源代碼都在這里: https: //github.com/Incybro/Spring-Blog我在我的 Intellij IDEA 中安裝了 lombok 插件,重新啟動了 IDE,但出現了一些錯誤:在這一行中:public class ResourceServerConfig extends ResourceServerConfigurerAdapter {public void save(User user){    user.setPassword(passwordEncoder.encode(user.getPassword()));    repo.save(user);}@Beanpublic CommandLineRunner setupDefaultUser(UserService service) {    return args -> {        service.save(new User(                "user", //username                "user", //password                Arrays.asList(new Role("USER"), new Role("ACTUATOR")),//roles                true//Active        ));    };}  @Override    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {        return repo                .findByUsername(username)                .map(u -> new org.springframework.security.core.userdetails.User(                        u.getUsername(),                        u.getPassword(),                        u.isActive(),                        u.isActive(),                        u.isActive(),                        u.isActive(),                        AuthorityUtils.createAuthorityList(                                u.getRoles()                                        .stream()                                        .map(r -> "ROLE_" + r.getName().toUpperCase())                                        .collect(Collectors.toList())                                        .toArray(new String[]{}))))                .orElseThrow(() -> new UsernameNotFoundException("No user with "                        + "the name " + username + "was found in the database"));    }}沒有任何東西被標記為紅色。我無法啟動我的應用程序。源代碼復制自https://www.youtube.com/watch?v=IOgCMtYMr2Q&list=PLcoE64orFoVsxAam_BuQBrNC8IO238SwH&index=2
查看完整描述

1 回答

?
慕森卡

TA貢獻1806條經驗 獲得超8個贊

修復你的ResourceServerConfig類。使用下面的代碼


@Configuration

@EnableResourceServer

public class ResourceServerConfig extends ResourceServerConfigurerAdapter {

代替


public class ResourceServerConfig {


@Configuration

@EnableResourceServer

public class ResourceServerConfig extends ResourceServerConfigurerAdapter {


查看完整回答
反對 回復 2023-02-23
  • 1 回答
  • 0 關注
  • 112 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號