Skip to content

Commit

Permalink
fix: wrong identity id
Browse files Browse the repository at this point in the history
  • Loading branch information
hyj1991 committed Nov 6, 2021
1 parent 26da60e commit 5b91593
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controller/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ const Controller = require('egg').Controller;

class UserController extends Controller {
async index() {
const { ctx } = this;
const { ctx, ctx: { service: { mysql } } } = this;
const { nick, userId } = ctx.user;

ctx.body = { ok: true, data: { name: nick, id: userId } };
const [{ identity }] = await mysql.getUserByUserIds([userId]);

ctx.body = { ok: true, data: { name: nick, id: identity } };
}
}

Expand Down

0 comments on commit 5b91593

Please sign in to comment.