我使用了角度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中的锚点不起作用.
我该如何解决这个问题?
我正在使用 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'
我使用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
?
我想获取参数的值,而不是注释的值。
如果我使用mybatis,我可以很容易地获得更新的行数,就像
update table set desc = 'xxx' where name = ?
Run Code Online (Sandbox Code Playgroud)
但是,如果我想获取更新的行数,而不是计数,mybatis 如何实现呢?