我明白了
路径“/src/app/employee.service.ts”上的合并发生冲突。
当运行这个命令时
ng 生成服务员工 --skipTests=true
我的操作系统是 Ubuntu 20.04 。我已经搜索了 1 小时的解决方案,但没有成功
我正在尝试使用 totp 在我的应用程序中实现 MFA 身份验证。波纹管是我使用的库。注册用户一切顺利,我收到了二维码,扫描它并每 30 秒在谷歌身份验证器中获取一次代码。当我尝试登录以验证代码时,代码验证不起作用(在身份验证服务中,方法验证)。我花了几个小时但无法弄清楚,尝试了不同的用户、日志但没有成功。
<dependency>
<groupId>dev.samstevens.totp</groupId>
<artifactId>totp</artifactId>
<version>1.7.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
这是我的代码
AuthContoller.java
import com.example.jsonfaker.model.dto.LoginRequest;
import com.example.jsonfaker.model.dto.SignupRequest;
import com.example.jsonfaker.model.dto.VerifyRequest;
import com.example.jsonfaker.service.Exporter;
import com.example.jsonfaker.service.UserAuthService;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@RestController
@RequestMapping("/auth")
@CrossOrigin
public class AuthController {
private final Exporter exporter;
private final UserAuthService userAuthService;
public AuthController(Exporter exporter, UserAuthService userAuthService) {
this.exporter = exporter;
this.userAuthService = userAuthService;
}
@PostMapping("/login")
public ResponseEntity<String> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {
String response = userAuthService.login(loginRequest);
return ResponseEntity
.ok()
.body(response); …
Run Code Online (Sandbox Code Playgroud)