小编mrh*_*mrh的帖子

在Chrome或Firefox上使用Visual Studio 2015调试Java脚本

我可以毫无问题地使用IE进行调试,但是当我尝试不同的浏览器时,代码并没有停止在断点上.我有一个目前与IE不兼容的项目.我在项目中使用OpenJSCAD作为依赖项,因此我需要在Chrome或Firefox上进行调试.

是否可以在Chrome或Firefox上使用Visual Studio 2015调试Java Script?

javascript c# firefox google-chrome visual-studio

16
推荐指数
2
解决办法
3万
查看次数

使用anotation进行测试@DataJpaTest - 需要EmbeddedDatabaseType

我想使用Spring Boot 1.4.RELEASE在内存DB中创建测试.当我在测试中添加anotation @DataJpaTest并执行测试时,我遇到以下错误:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: EmbeddedDatabaseType is required; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: EmbeddedDatabaseType is required
Run Code Online (Sandbox Code Playgroud)

我的Spring启动属性:

spring.jpa.database=ORACLE
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=validate

spring.datasource.driverClassName=oracle.jdbc.OracleDriver
spring.datasource.url=..
spring.datasource.username=..
spring.datasource.password=..

spring.datasource.max-active=20
spring.datasource.max-idle=5
spring.datasource.min-idle=1
spring.datasource.initial-size=5


spring.datasource.testWhileIdle = true
spring.datasource.timeBetweenEvictionRunsMillis = 20000
#spring.datasource.test-on-borrow=true
spring.datasource.validation-query=select 1 from …
Run Code Online (Sandbox Code Playgroud)

java integration-testing unit-testing spring-boot

8
推荐指数
1
解决办法
2842
查看次数

Angular2:触发当前路径保护 - 处理注销操作

我正在使用JWT对用户进行身份验证.我的angular2应用程序中的部分路径受CanActivate Guard保护,如果用户未登录,它将重定向到登录页面.现在我正在实现注销按钮,并希望重定向到登录页面.我想仅在非登录用户(例如帐户页面)看不到当前路由时才重定向.如果用户在例如主页中,我不想重定向到登录页面.

如果我能够检查当前路线是否有防守并且如果存在则触发该防护,那将是完美的.有可能这样做吗?

守护:

public canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
    if (this.loginService.getCurrentUserName()) {
        // logged in so return true
        return true;
    }
    // not logged in so redirect to login page with the return url
    this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }});
    return false;
}
Run Code Online (Sandbox Code Playgroud)

angular2-routing angular

6
推荐指数
1
解决办法
654
查看次数