refs #5595 remove OkPackets from logIn and logOut
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
ad3c6dcee2
commit
b3100d2653
|
@ -197,7 +197,7 @@ module.exports = function(Self) {
|
|||
* Shortcut to VnMySQL.executeP()
|
||||
*/
|
||||
rawSql(query, params, options, cb) {
|
||||
const userId = options.userId;
|
||||
const userId = options?.userId;
|
||||
if (userId) {
|
||||
params.unshift(userId);
|
||||
return this.dataSource.connector.executeP(
|
||||
|
|
|
@ -17,6 +17,12 @@ class VnMySQL extends MySQL {
|
|||
executeP(query, params, options = {}, cb) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.execute(query, params, options, (error, response) => {
|
||||
if(options?.userId)
|
||||
{
|
||||
response.shift(); // Remove OkPacket from logIn
|
||||
response.pop(); // Remove OkPacket from logOut
|
||||
response = response[response.length - 1] // Keep only query response
|
||||
}
|
||||
if (cb)
|
||||
cb(error, response);
|
||||
if (error)
|
||||
|
|
Loading…
Reference in New Issue