小编Pur*_*raw的帖子

如何使用ui路由器在html中使用锚点

我使用了角度ui路由器,就像

.state('home', {
        url: '/home',
        templateUrl: 'view/home/home.html',
        controller: 'homeCtrl'
    })
.state('guide', {
        url: '/guide',
        templateUrl: 'view/guide/guide.html',
        controller: 'guideCtrl'
    })
Run Code Online (Sandbox Code Playgroud)

我可以在浏览器中访问一个网址,http:// localhost:8000/dist /#/ home 但是,如果home.html中有一个锚点我不能在我的html中使用锚点

<a href="#aaa">scroll to aaa</a>
....
<h1 id="aaa">AAA</h1>
Run Code Online (Sandbox Code Playgroud)

当我点击"滚动到aaa"时,网址将是http:// localhost:8000/dist /#/ aaa 并返回一个空白页面.home.html中的锚点不起作用.

我该如何解决这个问题?

anchor angular-ui-router

9
推荐指数
1
解决办法
5777
查看次数

错误:所有配置的身份验证方法均失败级别:“客户端身份验证”

我正在使用 node.js ssh2 模块。我已经通过执行命令“npm install ssh2”安装了 ssh2 模块。但是,当我使用 ssh2 连接到远程服务器时,它总是输出错误:[错误:所有配置的身份验证方法失败] 级别:“客户端身份验证”

这是我的代码

var Client = require('ssh2').Client
var conn = new Client();
var option = {
    host: '10.171.65.154',
    port: 22,
    username: 'root',
    password: '123456'
};

conn.on('ready', function(){
    console.log('Client :: ready');
    conn.sftp(function(err, sftp){
        if(err) throw err;
        sftp.readdir('home', function(err, list){
            if(err) throw err;
            console.dir(list);
            conn.end();
        });
    });
}).on('error', function(err){
    console.log(err);
}).connect(option);
Run Code Online (Sandbox Code Playgroud)

但是,我无法成功连接。我确定用户名和密码正确,并且可以通过 SecureCRT 成功连接。

它总是输出错误:[错误:所有配置的身份验证方法失败]级别:'client-authentication'

ssh node.js

5
推荐指数
1
解决办法
9824
查看次数

如何获取带有注解的参数值?

我使用spring aop来拦截方法的调用。然后我定义了一个注解TestParam

@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface TestParam{}
Run Code Online (Sandbox Code Playgroud)

我尝试将此注释添加到方法中的参数中。

public class Test {
    public void test(String abc, @TestParam String def) {
    }
}
Run Code Online (Sandbox Code Playgroud)

我尝试拦截调用

@Around
public Object intercept(ProceedingJoinPoint proceedingJoinPoint) {
    Signature signature = proceedingJoinPoint.getSignature();
    MethodSignature methodSignature = (MethodSignature)signature;
    Method method = methodSignature.getMethod();
    Parameter[] parameters = method.getParameters();
    for (Parameter parameter : parameters) {
        Annotation annotation = parameter.getAnnotation(TestParam.class);
        if (annotation != null) {
            // how can I can the value of this parameter
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

那么如何获取被注解的参数的值呢@TestParam
我想获取参数的值,而不是注释的值。

spring annotations spring-aop

4
推荐指数
1
解决办法
3168
查看次数

如何使用 mybatis 获取更新行?

如果我使用mybatis,我可以很容易地获得更新的行数,就像

update table set desc = 'xxx' where name = ?
Run Code Online (Sandbox Code Playgroud)

但是,如果我想获取更新的行数,而不是计数,mybatis 如何实现呢?

mybatis

2
推荐指数
1
解决办法
1777
查看次数