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 24067ab
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/public/js/app.2036d1fd.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion app/public/js/app.8768ff5a.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/view/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/public/favicon.ico><title>Easy-Monitor</title><link href=/public/css/app.f0acf7f7.css rel=preload as=style><link href=/public/css/chunk-vendors.1bc8cbb4.css rel=preload as=style><link href=/public/js/app.8768ff5a.js rel=preload as=script><link href=/public/js/chunk-vendors.530a93a7.js rel=preload as=script><link href=/public/css/chunk-vendors.1bc8cbb4.css rel=stylesheet><link href=/public/css/app.f0acf7f7.css rel=stylesheet></head><body><noscript><strong>We're sorry but xprofiler doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/public/js/chunk-vendors.530a93a7.js></script><script src=/public/js/app.8768ff5a.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/public/favicon.ico><title>Easy-Monitor</title><link href=/public/css/app.d69f8a1e.css rel=preload as=style><link href=/public/css/chunk-vendors.1bc8cbb4.css rel=preload as=style><link href=/public/js/app.2036d1fd.js rel=preload as=script><link href=/public/js/chunk-vendors.530a93a7.js rel=preload as=script><link href=/public/css/chunk-vendors.1bc8cbb4.css rel=stylesheet><link href=/public/css/app.d69f8a1e.css rel=stylesheet></head><body><noscript><strong>We're sorry but xprofiler doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/public/js/chunk-vendors.530a93a7.js></script><script src=/public/js/app.2036d1fd.js></script></body></html>

0 comments on commit 24067ab

Please sign in to comment.