Javascript 仅显示注册API中的nonce
我怎么能只得到一次呢Javascript 仅显示注册API中的nonce,javascript,json,ionic-framework,Javascript,Json,Ionic Framework,我怎么能只得到一次呢 谢谢大家! 您不必执行JSON.parse()与在ionic 2+中一样,数据始终是JSON格式的 假设您的响应中有对象\u body 要访问该属性,您只需执行data.\u body['nonce']或data.\u body.nonce this.http.get("/api/get_nonce/?controller=user&method=register").subscribe(data => { console.log(JSON.parse(d
谢谢大家! 您不必执行
JSON.parse()
与在ionic 2+中一样,数据始终是JSON格式的
假设您的响应中有对象\u body
要访问该属性,您只需执行data.\u body['nonce']
或data.\u body.nonce
this.http.get("/api/get_nonce/?controller=user&method=register").subscribe(data => {
console.log(JSON.parse(data._body));
}, error => {
console.log("Register get nonce error");
});
parse(data.\u body).nonceWorks很棒。非常感谢。非常感谢。作品我该怎么做?
this.http.get("/api/get_nonce/?controller=user&method=register").subscribe (data => {
console.log(JSON.parse(data._body));
console.log(data._body['nonce']);
}, error => {
console.log("Register get nonce error");
});