Commit 41883d3c authored by qinhaitao's avatar qinhaitao

fix: 🐛 自己不能给自己助力

parent 12a74255
...@@ -64,6 +64,10 @@ export const BusinessError = { ...@@ -64,6 +64,10 @@ export const BusinessError = {
code: `430007`, code: `430007`,
defaultMsg: `已经成功邀请过` defaultMsg: `已经成功邀请过`
}, },
ERROR_NO_INVITE_SELF: {
code: `430008`,
defaultMsg: `自己不能给自己助力`
},
ERROR_FORBIDDEN_OPE: { ERROR_FORBIDDEN_OPE: {
code: `530001`, code: `530001`,
defaultMsg: `非法操作` defaultMsg: `非法操作`
......
...@@ -23,6 +23,8 @@ export default class Share { ...@@ -23,6 +23,8 @@ export default class Share {
const { inviteId } = context.data const { inviteId } = context.data
const { openId } = context const { openId } = context
if (openId === inviteId) return resultsModel.error(CODE_TYPES.ERROR_NO_INVITE_SELF)
const inviteUserInfo: IUserInfo = await userService.getUserInfoByOpenId(inviteId) const inviteUserInfo: IUserInfo = await userService.getUserInfoByOpenId(inviteId)
// inviteId的用户信息查询不到, 则inviteId无效 // inviteId的用户信息查询不到, 则inviteId无效
if (!inviteUserInfo) return resultsModel.error(CODE_TYPES.ERROR_INVALID_INVITE_ID) if (!inviteUserInfo) return resultsModel.error(CODE_TYPES.ERROR_INVALID_INVITE_ID)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment