创建并连接数据库,并修改登录和注册接口

This commit is contained in:
2026-08-30 18:14:49 +08:00
parent 4d11a1237f
commit 51c41e8fb7
331 changed files with 90228 additions and 16 deletions
+25
View File
@@ -0,0 +1,25 @@
'use strict';
/** @param {Function} constructorOpt Passed to Error.captureStackTrace (omit this frame from stacks). */
function captureStackHolder(constructorOpt) {
const holder = {};
Error.captureStackTrace(holder, constructorOpt);
return holder;
}
/**
* Replace `err.stack` frames with the capture from `holder`, keeping the
* callback error instance and its MySQL fields.
*
* @param {Error} err
* @param {{ stack?: string }} holder
*/
function applyCapturedStack(err, holder) {
const stack = holder && holder.stack;
if (typeof stack !== 'string' || !stack) return;
const lines = stack.split('\n');
lines[0] = `${err.name}: ${err.message}`;
err.stack = lines.join('\n');
}
module.exports = { captureStackHolder, applyCapturedStack };