...
|
...
|
@@ -69,7 +69,18 @@ passport.use('local', new LocalStrategy({ |
|
|
if (result.code && result.code === 200 && result.data.uid) {
|
|
|
cache.del(errorLoginKey).catch(() => {});
|
|
|
|
|
|
done(null, result.data);
|
|
|
let uid = {
|
|
|
toString() {
|
|
|
return this.uid;
|
|
|
},
|
|
|
uid: result.data.uid,
|
|
|
sessionKey: result.data.session_key,
|
|
|
isValid() {
|
|
|
return this.uid && this.sessionKey;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
done(null, {uid});
|
|
|
} else {
|
|
|
errLoginTimes = errLoginTimes + 1;
|
|
|
accountTimes = accountTimes + 1;
|
...
|
...
|
|