我是 Spring-Boot 的新手,目前,我正在开发一个带有 MySQL 数据库连接的自定义登录表单。
所以我已经开发了注册功能,它工作正常。
但是当我尝试登录帐户时,它总是显示“用户名和密码无效”。
我正在使用 Eclipse IDE。
下面是控制器类: WebMvcConfiguration.java
@ComponentScan("org.springframework.security.samples.mvc")
@Controller
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/login").setViewName("login");
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
}
@GetMapping("/login")
public String login() {
return "login";
}
@PostMapping("/customerAccount")
public String authenticate() {
// authentication logic here
return "customerAccount";
}
@GetMapping("/adminDashboard")
public String adminDashboard() {
return "adminDashboard";
}
@GetMapping("/Category")
public String Category() {
return "Category";
}
@GetMapping("/Index")
public String Index() {
return "Index";
}
@PostMapping("/RatingAccount")
public String RatingAccount() {
return …Run Code Online (Sandbox Code Playgroud) 我想在我的应用程序中使用谷歌地图。但我无法使用npm install --save google-map-react.
它在终端中显示以下错误。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: react-auth@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"~0.14.8 || ^15.0.0 || ^16.0.0" from google-maps-react@2.0.6
npm ERR! node_modules/google-maps-react
npm ERR! google-maps-react@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm …Run Code Online (Sandbox Code Playgroud) 我正在使用const [cookie, setCookie] = useCookies(["user_token"])cookie,我只想使用setCookie而不是使用cookie变量。tslint 正在使未使用的 cookie 的构建崩溃。我怎样才能只得到一个setCookie或通过这个问题。