tigerui
tigerui
## DESC this.fail(errno) 不能查找到相应的在 src/common/config/locale/zh-cn.js 中定义的 export default { //这样不行 10001:'此手机号已存在', //可行的 'PHONE_IS_EXIST': [10001,'此手机号已存在'] } ## ENV development Node.js Version:5.6.0 ThinkJS Version:2.1.8
## DESC > 事务使用方式 ``` let model = this.model('log') try { await model.startTrans() let res = await model.where({ id: 10 }).update({ text: 'xxxxxxx' }) await model.commit(model.connection) return this.success() } catch(e)...
## DESC > 事务 ``` const Base = require('./base.js'); module.exports = class extends Base { async indexAction() { let model = this.model('log') try { await model.startTrans() let res = await...
## DESC 本地文件缓存报错, 报错退出 业务无法继续 ``` { Error: ENOENT: no such file or directory, stat '/Users/charmtiger/Documents/WORK/thinkjs/mengti/runtime/cache/1/1efe3befc89dcd8d4a281ef67dbe73bd' at Error (native) at Object.fs.statSync (fs.js:987:18) at Object.isFile (/Users/charmtiger/Documents/WORK/thinkjs/mengti/node_modules/think-helper/index.js:377:19) at FileStore.delete (/Users/charmtiger/Documents/WORK/thinkjs/mengti/node_modules/think-store-file/index.js:95:17) at FileCache.delete...
## DESC 查询的代码 ```js async getByIds(ids) { let where = { id: ["IN", ids] } return this.model('goods').where(where).countSelect() } ``` ``` [2017-08-16 20:00:04.118] [85397] [INFO] - SQL: SELECT COUNT(mt_goods.id) AS think_count...
## DESC ``` [2017-08-17 16:26:12.585] [6358] [INFO] - SQL: SELECT * FROM `mt_shop_design` WHERE ( `shop_id` = 117981 ) LIMIT 1, Time: 139ms [2017-08-17 16:26:12.586] [6358] [DEBUG] - {} ```...
## DESC 本地开发的时候也经常 TIMEOUT 必须重启项目,本来以为是网络问题,数据库是外网访问rds。 ## ENV Platform: centos Node.js Version: v6.11.0 ThinkJS Version: thinkjs beta4
## DESC 本地环境翻墙回来后,就出现此问题 之前服务器也出现过,不过没有报错,之前是一段时间后,查询直接不返回,必须要重启thinkjs 服务才可以。不过很久没出现了。 ``` [2017-10-26 12:14:27.574] [3984] [INFO] - SQL: SELECT * FROM `mt_user` WHERE ( `phone` = '12345678901' ) LIMIT 1, Time: 102ms Error: update data is...