|
|
@@ -35,9 +35,7 @@ export class TeamController {
|
|
|
if (!user) {
|
|
|
return reply.code(403).send({ message: '用户未登录' })
|
|
|
}
|
|
|
- if (user.role === UserRole.USER) {
|
|
|
- return reply.code(403).send({ message: '用户无权限' })
|
|
|
- } else if (user.role === UserRole.TEAM) {
|
|
|
+ if (user.role === UserRole.TEAM) {
|
|
|
request.query.userId = user.id
|
|
|
}
|
|
|
const result = await this.teamService.findAll(request.query)
|
|
|
@@ -132,9 +130,6 @@ export class TeamController {
|
|
|
if (!user) {
|
|
|
return reply.code(403).send({ message: '用户未登录' })
|
|
|
}
|
|
|
- if (user.role === UserRole.USER) {
|
|
|
- return reply.code(403).send({ message: '用户无权限' })
|
|
|
- }
|
|
|
const team = await this.teamService.findByUserId(user.id)
|
|
|
return reply.send(team)
|
|
|
} catch (error) {
|