Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e4c97fc

Browse files
committed
注册的时候添加创建时间
1 parent 34780c1 commit e4c97fc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎routes/addUser.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const express = require('express')
22
const router = express.Router()
33
const mysql = require('./../mysql/db')
44
const md5 = require("blueimp-md5")
5+
const moment = require('moment')
56

67
router.post('/', addUser)
78

@@ -27,11 +28,11 @@ async function addUser(req, res, next) {
2728
});
2829
}
2930

30-
insertData = await mysql.query('INSERT INTO vue_blog_author (authorName, authorPassword, authorEmail, admin, authority, token) VALUES (?, ?, ?, 0, 2, ?)',
31-
[req.body.name, req.body.password, req.body.email, token])
31+
insertData = await mysql.query('INSERT INTO vue_blog_author (authorName, authorPassword, authorEmail, admin, authority, token, createTime) VALUES (?, ?, ?, 0, 2, ?, ?)',
32+
[req.body.name, req.body.password, req.body.email, token,moment().format('YYYY-MM-DD HH:mm:ss')])
3233
} else {
33-
insertData = await mysql.query('INSERT INTO vue_blog_author (authorName, authorPassword, authorEmail, admin, authority, token) VALUES (?, ?, ?, 1, 0, ?)',
34-
[req.body.name, req.body.password, req.body.email, token])
34+
insertData = await mysql.query('INSERT INTO vue_blog_author (authorName, authorPassword, authorEmail, admin, authority, token, createTime) VALUES (?, ?, ?, 1, 0, ?, ?)',
35+
[req.body.name, req.body.password, req.body.email, token,moment().format('YYYY-MM-DD HH:mm:ss')])
3536
}
3637
return res.json({
3738
isok: true,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /