Unverified Commit 172d69dd authored by CHEN/GUANG WU's avatar CHEN/GUANG WU Committed by GitHub

Merge pull request #1 from YMFE/master

update forks
parents 67e7dcf8 2ca9b34e
## v1.9.2
* fix: 修复高级 mock 无效的bug
* opti: 对登录 email 空格的过滤
* fix: 修复deepMath 增加对原型属性比较
## v1.9.1
* 修复因 mongodb 一个废弃报错导致部署不成功问题
......
......@@ -74,7 +74,7 @@ YApi 是<strong>高效</strong>、<strong>易用</strong>、<strong>功能强大
### YApi docker部署(非官方)
* [使用 alpine 版 docker 镜像快速部署 yapi](https://www.jianshu.com/p/a97d2efb23c5)
* [docker-yapi](https://github.com/Ryan-Miao/docker-yapi)
* [docker-yapi: 基于官方yapi-cli的docker-compose方案](https://github.com/Ryan-Miao/docker-yapi)
* [docker-compose一键部署yapi](https://github.com/jinfeijie/yapi)
* [docker-YApi: 更易用的 YApi 镜像](https://github.com/fjc0k/docker-YApi)
* [使用DockerCompose构建部署Yapi](https://github.com/MyHerux/daily-code/blob/master/Program/%E5%B7%A5%E5%85%B7%E7%AF%87/Yapi/%E4%BD%BF%E7%94%A8DockerCompose%E6%9E%84%E5%BB%BA%E9%83%A8%E7%BD%B2Yapi.md)
......
......@@ -85,7 +85,9 @@ exports.isDeepMatch = function(obj, properties) {
}
let match = true;
for (var i in properties) {
let keys = Object.keys(properties)
for (let index=0; index< keys.length; index++) {
let i = keys[index];
if (!Compare(obj[i], properties[i])) {
match = false;
break;
......
{
"name": "yapi-vendor",
"version": "1.9.1",
"version": "1.9.2",
"description": "YAPI",
"main": "server/app.js",
"scripts": {
......
......@@ -51,7 +51,8 @@ class baseController {
'/api/interface/list_cat',
'/api/project/get',
'/api/plugin/export',
'/api/project/up'
'/api/project/up',
'/api/plugin/exportSwagger'
];
let params = Object.assign({}, ctx.query, ctx.request.body);
......
......@@ -31,6 +31,7 @@ class userController extends baseController {
//登录
let userInst = yapi.getInst(userModel); //创建user实体
let email = ctx.request.body.email;
email = (email || '').trim();
let password = ctx.request.body.password;
if (!email) {
......
......@@ -282,17 +282,13 @@ exports.verifyPath = path => {
*/
exports.sandbox = (sandbox, script) => {
try {
const { NodeVM } = require('vm2');
sandbox = sandbox || {};
const vm = new NodeVM({
require: {
external: true
},
sandbox: sandbox,
timeout: 3000
})
vm.run(script)
const vm = require('vm');
sandbox = sandbox || {};
script = new vm.Script(script);
const context = new vm.createContext(sandbox);
script.runInContext(context, {
timeout: 3000
});
return sandbox
} catch (err) {
throw err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment