lianjiatech / fee Goto Github PK
View Code? Open in Web Editor NEW灯塔开源文档地址
Home Page: https://aa978563552.github.io/FEE-doc/
License: MIT License
灯塔开源文档地址
Home Page: https://aa978563552.github.io/FEE-doc/
License: MIT License
日志格式只给了结果,没有配置参考
server/src/routes/api/project/item/index.js 中的路由/api/project/item/update。
客户端请求时候 'displayName','projectName','cDesc'都是驼峰命名,但是数据库中用的是下划线命名,应该在真正更新数据前,应该相应的把驼峰的值转一下给display_name等。
server/src/routes/api/project/item/index.js 中路由/api/project/item/delete 请求方式最好是post或者delete
window.addEventListener('error', function(e) {
console.log(e);
}, true)
会调用两次,也就是说会打印两次错误,这是为什么呢
按照文档启动项目后,进行注册和登录,抛出以下异常
[2019-07-19 17:35:21.619]-[runtime] info信息不是标准json
[2019-07-19 17:35:21.658]-[runtime] error.massage =>Cannot read property 'getUnixTime' of undefined
error.stack =>TypeError: Cannot read property 'getUnixTime' of undefined
at Object. (/home/alain/Developer/web/fee/server/dist/model/project/user.js:95:34)
at Generator.next ()
at asyncGeneratorStep (/home/alain/Developer/web/fee/server/dist/model/project/user.js:20:103)
at _next (/home/alain/Developer/web/fee/server/dist/model/project/user.js:22:194)
at /home/alain/Developer/web/fee/server/dist/model/project/user.js:22:364
at new Promise ()
at Object. (/home/alain/Developer/web/fee/server/dist/model/project/user.js:22:97)
at Object._register (/home/alain/Developer/web/fee/server/dist/model/project/user.js:143:20)
at Object.register (/home/alain/Developer/web/fee/server/dist/model/project/user.js:60:20)
at /home/alain/Developer/web/fee/server/dist/routes/api/user/index.js:227:45
at Generator.next ()
at asyncGeneratorStep (/home/alain/Developer/web/fee/server/dist/routes/api/user/index.js:32:103)
at _next (/home/alain/Developer/web/fee/server/dist/routes/api/user/index.js:34:194)
at /home/alain/Developer/web/fee/server/dist/routes/api/user/index.js:34:364
at new Promise ()
at /home/alain/Developer/web/fee/server/dist/routes/api/user/index.js:34:97 => {"method":"func.catch.e","path":"/home/alain/Developer/web/fee/server/dist/library/utils/modules/router_config_builder.js","line":"33","pos":"25","file":"router_config_builder.js"}
node版本: 8.14.0
系统:ubuntu 16.04 LTS
访问浏览器: Mozilla Firefox for Ubuntu 1.0 & Chromium Version 74
目前client里没有发现,添加项目的入口,但是在server里有添加项目的api
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
server/src/routes/api/user/index.js 中 /api/user/register 路由:
129行,判断此账号是否存在,let rawUser = MUser.getByAccount(account),应该加await,不然直接走“账号已存在”
server/src/routes/api/project/item/index.js 中的路由/api/project/item/detail.
项目id:${id}不存在的情况除了包括_.isEmpty(project), 应该还包括project.is_delete == 1。建议优化
Describe the bug
Chinese characters encode error
To Reproduce
Steps to reproduce the behavior:
https://github.com/LianjiaTech/fee/tree/master/client#%E9%A1%B9%E7%9B%AE%E5%8A%9F%E8%83%BD
Expected behavior
encode UTF-8
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
server/src/routes/index.js中
// 注册路由中间件, 需要在注册路由地址之前使用
loginRouter.use(PrivilegeChecker.checkLogin)
loginProjectRouter.use(PrivilegeChecker.checkPrivilege)
注册中间件在注册路由地址之前使用,的确会提前检测login和privilege,但是对于应该返回404的路由,就无法正常通过了。
建议优化: 注册中间件的时机,应该注册路由地址之后,加入URL进行过滤。
代码如下:
for (let url of Object.keys(routerConfigMap)) {
let routerConfig = routerConfigMap[url];
if (routerConfig.needLogin) {
// 需要登录
loginRouter.use(url, PrivilegeChecker.checkLogin);
if (routerConfig.needProjectId) {
// 需要校验项目权限
loginProjectRouter.use(url, PrivilegeChecker.checkPrivilege);
Logger.log(`需要登录,也需要检验项目权限(Method: ${routerConfig.methodType}) =>`, url);
registerRouterByMethod(loginProjectRouter, routerConfig, url)
} else {
// 不需要校验项目权限
Logger.log(`需要登录,但不需要检验项目权限(Method: ${routerConfig.methodType}) =>`, url)
registerRouterByMethod(loginCommonRouter, routerConfig, url)
}
} else {
Logger.log(`不需要登录(Method: ${routerConfig.methodType}) =>`, url)
// 不需要登录
registerRouterByMethod(withoutLoginRouter, routerConfig, url)
}
}
按照文档指引,启动项目后,在clinet端会报找不到文件的错误,然后去查看了一下view下确实缺少device-detail/mobileview.vue。将这部分相关的代码注释掉后项目成功启动
parseNginxLog里面由于在分析83行,定期清理stream:
jsonWriteStreamPool.size > 100 || rawLogWriteStreamPool.size > 100 ,由于jsonWriteStreamPool和rawLogWriteStreamPool都是NginxParseLog子类中定义的Map,没有对相关map进行set处理,所以,size应该永远是0,这个判断应该去base中获取jsonWriteStreamPool的size。
在save_log/base中,63行,autoCloseOldStream循环:
首先是10分钟之内,startAt = nowAt - 60 * 100,finishAt = nowAt - 60 * 100,那不是startAt===finishAt了么? 其次,循环中 let survivalAtLogUri = LKafka.getAbsoluteLogUriByType(nowAt, LKafka.LOG_TYPE_JSON) 使用nowAt去获取文件路径,按照目前的逻辑,只有nowAt这一刻的stream可以幸免被关闭。原本设计的应该是获取10分钟内需要被避免关闭的stream,然后关闭其他。所以这边应该是LKafka.getAbsoluteLogUriByType(survivalAt, LKafka.LOG_TYPE_JSON)
我看到task的manage启动任务在启动parseNginx的时候是按定时任务,每分钟执行一次parseNginxLog。如果每个nginx的日志里面的内容很多。而这一分钟没有处理完这些数据,那么这些定时任务开启的node进程是不是越来越多呢。这样内存是不是会占满,fee是如何处理这个问题的呢,还是我的理解有问题,能不能说下呢。
在parseNginxLog文件的每行数据接收回调函数onDataIn中,我看到有每当处理好的数据文件写入流个数大于100就会删除老的流,那样老的数据是不是就不再处理了。还是有哪里处理了呢。
server下,处理上报的路由的地址在哪里配置(比如:https://dig.xxxx.com/fee.gif?d=)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.