change from mysql to mysql2
This commit is contained in:
+2
-2
@@ -54,7 +54,7 @@ export const setup = function (router, con, server) {
|
||||
res.locals.username = result[0].User_Name;
|
||||
res.locals.bio = result[0].User_Bio || "";
|
||||
res.locals.avatar = result[0].User_Avatar || "";
|
||||
res.locals.settings = JSON.parse(result[0].User_Settings) || {};
|
||||
res.locals.settings = result[0].User_Settings || {};
|
||||
|
||||
res.locals.isbot = true; //only apps/bots use auth tokens
|
||||
|
||||
@@ -96,7 +96,7 @@ export const setup = function (router, con, server) {
|
||||
res.locals.username = result[0].User_Name;
|
||||
res.locals.bio = result[0].User_Bio || "";
|
||||
res.locals.avatar = result[0].User_Avatar || "";
|
||||
res.locals.settings = JSON.parse(result[0].User_Settings) || {};
|
||||
res.locals.settings = result[0].User_Settings || {};
|
||||
|
||||
}
|
||||
next()
|
||||
|
||||
+1
-6
@@ -160,12 +160,7 @@ export const setup = function (router, con, server) {
|
||||
}
|
||||
}
|
||||
|
||||
let sql = `
|
||||
START TRANSACTION;
|
||||
insert into ipost.posts (post_user_name,post_text,post_time,post_receiver_name,post_from_bot,post_reply_id,file_0,file_1,file_2,file_3,file_4) values (?,?,?,?,?,?,?,?,?,?,?);
|
||||
SELECT LAST_INSERT_ID() as ID;
|
||||
COMMIT;
|
||||
`;
|
||||
let sql = `START TRANSACTION;INSERT INTO ipost.posts (post_user_name,post_text,post_time,post_receiver_name,post_from_bot,post_reply_id,file_0,file_1,file_2,file_3,file_4) VALUES (?,?,?,?,?,?,?,?,?,?,?);SELECT LAST_INSERT_ID() as ID;COMMIT;`;
|
||||
let values = [encodeURIComponent(res.locals.username), message, Date.now(), receiver, res.locals.isbot, reply_id,...file_names];
|
||||
con.query(sql, values, function (err, result) {
|
||||
if (err){
|
||||
|
||||
Reference in New Issue
Block a user