diff --git a/app/lib/db/mysql.js b/app/lib/db/mysql.js index 9e22b0c046413f92cff95e5626628d01c010e895..8aaebdb7a31da502d08258f8d2aa5c360844b8f4 100644 --- a/app/lib/db/mysql.js +++ b/app/lib/db/mysql.js @@ -15,16 +15,17 @@ module.exports = class MySQLDB extends Base { this.connection.connect(); } - getUserById(id) { - const sql = `select * from user where id = ${id}`; - - return new Promise((resolve, reject) => { - this.connection.query(sql, function (err, results, fields) { - err ? reject(err) : resolve(results); - }); - }); + async getUserById(id) { + const sql = 'SELECT * FROM user WHERE id = ?'; + try { + const results = await this.connection.query(sql, [id]); + return results; + } catch (err) { + throw err; + } } + getPager(collectionName, json) { return this.getUserById(1); } diff --git a/config/manifest.json b/config/manifest.json index 0237015edb9b908d1560e8d8c79c8dbed3c687ee..27ddcdf2977ff2e7f57ff35fd03aaadd5f98bf4e 100644 --- a/config/manifest.json +++ b/config/manifest.json @@ -1,9 +1,4 @@ { - "chunk/0.js": "/public/js/chunk/0.js", - "chunk/1.js": "/public/js/chunk/1.js", - "chunk/2.js": "/public/js/chunk/2.js", - "chunk/3.js": "/public/js/chunk/3.js", - "chunk/4.js": "/public/js/chunk/4.js", "about/about.js": "/public/js/chunk/about/about.js", "admin/home/home.js": "/public/js/chunk/admin/home/home.js", "admin/login/login.js": "/public/js/chunk/admin/login/login.js", @@ -13,15 +8,10 @@ "runtime.js": "/public/js/runtime.js", "font/element-icons.ttf": "/public/font/element-icons.ttf", "font/element-icons.woff": "/public/font/element-icons.woff", - "font/fontawesome-webfont.eot?v=4.7.0": "/public/font/fontawesome-webfont.eot", - "font/fontawesome-webfont.ttf?v=4.7.0": "/public/font/fontawesome-webfont.ttf", - "font/fontawesome-webfont.woff?v=4.7.0": "/public/font/fontawesome-webfont.woff", - "font/fontawesome-webfont.woff2?v=4.7.0": "/public/font/fontawesome-webfont.woff2", "font/glyphicons-halflings-regular.eot": "/public/font/glyphicons-halflings-regular.eot", "font/glyphicons-halflings-regular.ttf": "/public/font/glyphicons-halflings-regular.ttf", "font/glyphicons-halflings-regular.woff": "/public/font/glyphicons-halflings-regular.woff", "font/glyphicons-halflings-regular.woff2": "/public/font/glyphicons-halflings-regular.woff2", - "img/fontawesome-webfont.svg?v=4.7.0": "/public/img/fontawesome-webfont.svg", "img/glyphicons-halflings-regular.svg": "/public/img/glyphicons-halflings-regular.svg", "img/loading.gif": "/public/img/loading.gif", "img/logo.png": "/public/img/logo.png",