0👍
I think the problem might be caused by this line:
if(!res.code==20000){
// Some stuff here
}
It should probably read:
if(res.code!=20000){
// Some stuff here
}
!res.code
will always evaluate to either true
or false
. So !res.code==20000
will always be false. No matter the input the following error callback will never execute:
return callback(new Error('the code is wrong or expired'))
Here’s a little demo to show that "bar" will always be printed out
function simple_if(number) {
if (!number == 20000) {
return "foo"
} else {
return "bar"
}
}
console.log(`res=20000. Expect 'bar': ${simple_if(2000)}`)
console.log(`res=3. Expect 'foo': ${simple_if(3)}`)
console.log(`res=0. Expect 'foo': ${simple_if(0)}`)
- [Vuejs]-Display only one attribute of arrayed objects in md-autocomplete :md-options
- [Vuejs]-Docker – Can't connect to my VueJS project
Source:stackexchange.com