这是我使用的简化代码:
{"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."}
当我输入错误的用户名或密码时,我会遇到异常:
export class AuthGuard implements CanActivate, CanLoad {
constructor(private router: Router) {
}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
if(!this.checkLogin()){
this.router.navigate(['/login']);
return false;
}
return true;
}
canLoad(route: Route): boolean {
return this.checkLogin();
}
checkLogin(): boolean {
return false
}
}
但我想得到更具体的错误,以便我知道这是错误的用户名密码异常还是......不同。有没有办法配置它?