diff --git a/lib/aspects/token.js b/lib/aspects/token.js index d9a8c807f..fbb122fb8 100644 --- a/lib/aspects/token.js +++ b/lib/aspects/token.js @@ -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(); diff --git a/src/aspects/token.ts b/src/aspects/token.ts index dad46fa38..ef671dfc3 100644 --- a/src/aspects/token.ts +++ b/src/aspects/token.ts @@ -709,7 +709,7 @@ export async function loginByMobile< ); if (!existMobile) { closeRootMode(); - throw new OakUserException('手机号无效,请先联系管理员获取权限'); + throw new OakUserException('账号不存在'); } } const tokenId = await loginLogic();