From e8e09a99c17a3e5805b55c6fb79638d7b6ad91e4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 23 Nov 2024 12:42:24 +0800 Subject: [PATCH] bugfix --- bricks/bricks.js | 1 + bricks/utils.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/bricks/bricks.js b/bricks/bricks.js index 03c8726..ac9b146 100644 --- a/bricks/bricks.js +++ b/bricks/bricks.js @@ -445,6 +445,7 @@ bricks.App = class extends bricks.Layout { /* opts = { appname: + debug:false, true, 'server' login_url: "charsize: "language": diff --git a/bricks/utils.js b/bricks/utils.js index d9cdfa4..6c5a60f 100644 --- a/bricks/utils.js +++ b/bricks/utils.js @@ -13,10 +13,24 @@ bricks.is_empty = function(obj){ if (obj === null) return true; return JSON.stringify(obj) === '{}'; } +bricks.serverdebug = async function(message){ + console.log(arguments, 'er==============er'); + var jc = new bricks.HttpJson(); + await jc.post(url='/debug', {params:{ + message:message + }}); + return; +} bricks.debug = function(...args){ if (! bricks.bug){ return; } + if (bricks.bug == 'server'){ + var message = args.join(" "); + f = bricks.serverdebug.bind(null, message); + schedule_once(f, 0.1); + return; + } var callInfo; try { throw new Error();