0x0000000000000000000000000

Results 8 comments of 0x0000000000000000000000000

一样的问题,调试控制台中文乱码,设置了参数还是一样 文件编码:gb2312 "consoleCoding": "ansi", "sourceCoding": "ansi", ------ "Lua.runtime.version": "Lua 5.1", "files.encoding":"gb2312", "lua.debug.settings.consoleCoding": "ansi", "lua.debug.settings.sourceCoding": "ansi", "Lua.runtime.fileEncoding": "ansi", "lua.debug.settings.luaVersion": "5.1", 但是如果将文件编码改为utf8,print就能输出中文,(项目要求GB2312...)

调试过程中,变量页内容涉及到中文也全都显示乱码。

@lizheming 感谢回复。 通过扩展可以对controller最终返回的结果进行再一步处理吗? 现在项目都是controller返回this.fail或者this.success。 看了下文档,还是不大清楚扩展如果对结果进行拦截及进一步处理。 有小例子吗?

@chenyuncai 按照文档覆盖success函数,内部直接 return this.ctx.success(data,message); 发现不行,断点看了下,进入了node_modules\thinkjs\lib\extend\context.js 在this.type = this.config('jsonContentType'); 的时候飞了,是少了什么东西吗? 请求直接返回OK,并且捕捉到一个错误。但是没有往外抛。 Message:Can't set headers after they are sent. Stack: "Error: Can't set headers after they are sent. at validateHeader (_http_outgoing.js:491:11) at...

@welefen 可能没表达清楚,我在其他的node中可以这样做一个监听: `process.on('exit',async () => { ...[我这边可以先处理完,再退出] console.log(new Date() + "process exit"); }); process.on('SIGINT', async () => { console.log('Got SIGINT. Press Control-D/Control-C to exit.'); ...[我这边可以先处理完,再退出] process.kill(process.pid, "SIGINT"); });` thinkjs 是不是有这种机制?

我试了在master中增加 process.on('SIGINT', async () => { console.log('1'); // coding... console.log('2'); process.kill(process.pid, "SIGINT"); }); 关闭应用是进来了,但是好像执行过程中,就会被kill掉了。导致有时候会输出1,2但是有时候只输出1...

在think中如何起一个新的node进程吗?(这边指的是子进程吗?) 我还想在新的进程中调用thinjs一些内置的函数,比如model,比如service... 我用deamon进程创建方式进行的话,会报 thinkjs_1.think.model is not a function 内部调用了think.model(...)

在master.js中 ` require('child_process').exec('node production.js support') ; // 启动一个进程 { process.send("Exit"); }); ` support.js 这边怎么处理? 加事件监听也不行,进程通信也不行. ` const cluster = require('cluster'); cluster.on('message',(worker: any, message: any) => { //... }); process.on('message', async...