报错log修改

This commit is contained in:
wenjiarui 2023-12-06 19:26:43 +08:00
parent 5503050c0e
commit e375feaec4
2 changed files with 7 additions and 7 deletions

View File

@ -136,15 +136,15 @@ async function dealWithUserState(user, context, tokenData) {
* @return tokenId
*/
async function setUpTokenAndUser(env, context, entity, // 支持更多的登录渠道使用此函数创建token
entityId, // 如果是现有对象传id如果没有对象传createData
createData, user) {
entityId, // 如果是现有对象传id如果没有对象传createData
createData, user) {
const currentToken = context.getToken(true);
const schema = context.getSchema();
(0, assert_1.assert)(schema.hasOwnProperty(entity), `${entity}必须是有效的对象名 `);
(0, assert_1.assert)(schema.token.attributes.entity.ref.includes(entity), `${entity}必须是token的有效关联对象`);
(0, assert_1.assert)(schema[entity].attributes.hasOwnProperty('userId') &&
schema[entity].attributes.userId.ref ===
'user', `${entity}必须有指向user的userId属性`);
'user', `${entity}必须有指向user的userId属性`);
if (currentToken) {
(0, assert_1.assert)(currentToken.id);
(0, assert_1.assert)(currentToken.userId);
@ -512,7 +512,7 @@ async function loginByMobile(params, context) {
}, { dontCollect: true });
if (!existMobile) {
closeRootMode();
throw new types_1.OakUserException('手机号无效,请先联系管理员获取权限');
throw new types_1.OakUserException('账号不存在');
}
}
const tokenId = await loginLogic();
@ -656,7 +656,7 @@ async function tryRefreshWechatPublicUserInfo(wechatUserId, context) {
const { nickname, gender, avatar } = await wechatInstance.getUserInfo(accessToken, openId);
await setUserInfoFromWechat(user, { nickname, gender: gender, avatar }, context);
}
async function refreshWechatPublicUserInfo({}, context) {
async function refreshWechatPublicUserInfo({ }, context) {
const tokenValue = context.getTokenValue();
const [token] = await context.select('token', {
data: {
@ -1225,7 +1225,7 @@ async function getWechatMpUserPhoneNumber({ code, env }, context) {
return reuslt;
}
exports.getWechatMpUserPhoneNumber = getWechatMpUserPhoneNumber;
async function logout({}, context) {
async function logout({ }, context) {
const tokenId = context.getTokenValue();
if (tokenId) {
const closeRootMode = context.openRootMode();

View File

@ -709,7 +709,7 @@ export async function loginByMobile<
);
if (!existMobile) {
closeRootMode();
throw new OakUserException('手机号无效,请先联系管理员获取权限');
throw new OakUserException('账号不存在');
}
}
const tokenId = await loginLogic();