登录:实名认证
This commit is contained in:
@@ -17,6 +17,8 @@ module.exports = () => {
|
||||
ctx.uid = user.uid;
|
||||
ctx.serverType = user.serverType;
|
||||
ctx.auth = user.auth;
|
||||
ctx.userCode = user.userCode;
|
||||
ctx.pkgName = user.pkgName;
|
||||
await next();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import { getExpByLv, getHeroExpByLv, gameData } from 'app/pubUtils/data';
|
||||
import { isString } from 'underscore';
|
||||
import { getAge } from 'app/pubUtils/timeUtil';
|
||||
import { shouldRefresh } from 'app/pubUtils/util';
|
||||
import { authenticate } from 'app/pubUtils/httpUtil';
|
||||
|
||||
/**
|
||||
* Test Service
|
||||
@@ -161,7 +162,7 @@ export default class Auth extends Service {
|
||||
|
||||
let user = await UserModel.findUserByTel(tel);
|
||||
return this.ctx.service.utils.resResult(STATUS.SUCCESS, {
|
||||
hasAccount: !!user
|
||||
hasAccount: !!user && user.hasSetPw
|
||||
});
|
||||
}
|
||||
|
||||
@@ -367,6 +368,8 @@ export default class Auth extends Service {
|
||||
const ctx = this.ctx;
|
||||
// TODO 接SDK
|
||||
console.log(name, idNum);
|
||||
let result = await authenticate(name, idNum, ctx.userCode, ctx.pkgName);
|
||||
if(!result) return ctx.service.utils.resResult(STATUS.AUTHEN_FAIL);
|
||||
|
||||
let birthday = this.getBirthdayByIdCard(idNum);
|
||||
let user = await UserModel.authentication(ctx.uid, birthday, '');
|
||||
|
||||
Reference in New Issue
Block a user