Skip to content

Commit 26da60e

Browse files
committed
feat: show user info
1 parent 54a7f5e commit 26da60e

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

app/controller/user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const Controller = require('egg').Controller;
55
class UserController extends Controller {
66
async index() {
77
const { ctx } = this;
8-
const { nick } = ctx.user;
8+
const { nick, userId } = ctx.user;
99

10-
ctx.body = { ok: true, data: { name: nick } };
10+
ctx.body = { ok: true, data: { name: nick, id: userId } };
1111
}
1212
}
1313

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/public/js/app.8768ff5a.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/public/js/app.d755df01.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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.805d9178.css rel=preload as=style><link href=/public/css/chunk-vendors.1bc8cbb4.css rel=preload as=style><link href=/public/js/app.d755df01.js rel=preload as=script><link href=/public/js/chunk-vendors.8e038e6d.js rel=preload as=script><link href=/public/css/chunk-vendors.1bc8cbb4.css rel=stylesheet><link href=/public/css/app.805d9178.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.8e038e6d.js></script><script src=/public/js/app.d755df01.js></script></body></html>
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>

0 commit comments

Comments
 (0)