-
我打算用 thinkjs 3.0 开发一个 api 接口中心
用 think-session-jwt 作为身份认证服务
网站统一返回json形式的信息(类似微服务规范)形式如下:
```
{
"errno": 0,
"errmsg": "",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6Ik…
-
## DESC
think.js 2.4版本 两天前端机 nginx 轮询做分发 2w并发的时候会导致前端页面挂起 一直处于loading状态
### ENV
production
OS Platform:
cnetos
Node.js Version:
6.7
ThinkJS Version:
2.4
### code
```js
'use strict';
/**…
-
npm start 正常运行,pm2 启动项目也正常运行,但是 /root/.pm2/logs/xxxxx-error.log 里面的项目错误日志每天会有几百M,都是重复的报错,如下:
`Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at process.target.send (internal/child_process.js:636…
-
如果think-models 直接支持泛型就发了,所以数据库里面出来的 都可以直接对应上接口,typescript写的不要太爽
-
这还是一个颇为常见的问题,一个正常的 node 服务,可能只是作一些很轻的转发和数据收拢。这造成了它需要依靠大量的微服务。
为了方便维护,大家一般会将所有微服务的相关配置写在一份**配置**中,在不同的环境下替换该份配置。但是随着项目越来越大,依赖的服务越来越多,会发现这个配置越来越大。几百行不在话下。
而且这种配置,一般是**多人使用**、**多人维护**,在不同环境下**多人操作*…
-
## DESC
开发模式下用webpack 配合中间件调试,会重复执行多次打包编译,如果不断刷新浏览器,重复次数几何试增加。求解。
中间件用的是 :
think-webpack-dev-middleware - 在服务端编译 webpack 项目
think-webpack-hot-middleware - ThinkJS webpack 热更新插件
webpack: C…
-
## 目标
使用平台化管理`api接口`:
- 使用可视化管理接口参数、返回值
- 根据规则自动生成文档
- 返回值支持`mockjs`语法
- 支持`jsonp`、`CORS`跨域
## 前后端分离
- 管理平台前端使用`vue`构建, 以`/apijs-admin/`为前缀, 模板在 [apijs/apijs-admin](http://github.co…
xuexb updated
7 years ago
-
强烈推荐 GitHub 上值得前端学习的开源实战项目。
## Vue.js
- [vue-element-admin 是一个后台前端解决方案,它基于和 element-ui 实现](https://panjiachen.github.io/vue-element-admin)
- [基于 iView 的 Vue 2.0 管理系统模板](https://github.com/iv…
-
查询经常会返回ResourceRequest timed out,设置了超时时间也还是这样,求解
-
## DESC
model A 和 model B是一对多关系
await think.model('A').where({ status: 2 }).setRelation('B', {
type: think.Model.HAS_MANY,
where: { status: 1 },
}).sel…