在pigx-register模块下
WebSecurityConfig类中
@Override
public void configure(WebSecurity web) {
//注释掉如下代码,将之配置在bootstrap.yml中
//String ignoreURLs = env.getProperty("nacos.security.ignore.urls", "/**");
String ignoreURLs =env.getProperty("nacos.security.ignore.urls");
for (String ignoreURL : ignoreURLs.trim().split(SECURITY_IGNORE_URLS_SPILT_CHAR)) {
web.ignoring().antMatchers(ignoreURL.trim());
}
}
bootstrap.yml中增加nacos.security.ignore.urls配置即可
nacos:
cmdb:
dumpTaskInterval: 3600
eventTaskInterval: 10
labelTaskInterval: 300
loadDataAtStart: false
security:
ignore:
urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health/**,/v1/cs/**,/v1/ns/**,/v1/cmdb/**,/actuator/**,/v1/console/server/**
nacos默认的登录用户名和密码都是nacos,在users表中可以修改,密码是用pigx-register模块下PasswordEncoderUtil类生成