slider-puzzle-captcha
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -37,2 +37,10 @@ 'use strict'; | ||
var _config = require('../config'); | ||
var _config2 = _interopRequireDefault(_config); | ||
var _merge = require('lodash/merge'); | ||
var _merge2 = _interopRequireDefault(_merge); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -69,2 +77,8 @@ | ||
sliderPuzzle.emitter = _emitter2.default; | ||
// overwrite some config | ||
sliderPuzzle.setConfig = function (overConfig) { | ||
(0, _merge2.default)(_config2.default, overConfig); | ||
}; | ||
exports.default = sliderPuzzle; |
@@ -57,4 +57,4 @@ 'use strict'; | ||
// 允许访问的ip,至少填一个 | ||
allowedIps: ['127.0.0.1'], | ||
// 允许访问的ip,不填则为不验证 | ||
// allowedIps: ['127.0.0.1'], | ||
@@ -61,0 +61,0 @@ // 背景图存放路径,以/结尾 |
@@ -25,3 +25,3 @@ 'use strict'; | ||
redisConfig: { | ||
host: '127.0.0.1', | ||
host: '10.12.30.1', | ||
port: '6379' | ||
@@ -44,3 +44,3 @@ }, | ||
// 允许访问的ip,至少填一个 | ||
allowedIps: ['127.0.0.1'], | ||
//allowedIps: ['127.0.0.1'], | ||
@@ -47,0 +47,0 @@ // 背景图存放路径,以/结尾 |
@@ -18,2 +18,5 @@ 'use strict'; | ||
var testIp = function testIp(ip) { | ||
if (!_config2.default.allowedIps) { | ||
return true; | ||
} | ||
if (!ip) { | ||
@@ -20,0 +23,0 @@ return false; |
@@ -51,2 +51,6 @@ 'use strict'; | ||
}); | ||
} | ||
} | ||
setInterval(function () { | ||
store.clear(); | ||
}, _config2.default.expire * 2); |
{ | ||
"name": "slider-puzzle-captcha", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "url": "https://github.com/superwf/slider-puzzle-captcha.git", |
@@ -12,2 +12,4 @@ import 'isomorphic-fetch' | ||
import {onHover, offHover, onStart, onRefresh} from './slider/handler' | ||
import config from '../config' | ||
import merge from 'lodash/merge' | ||
@@ -39,2 +41,8 @@ | ||
sliderPuzzle.emitter = emitter | ||
// overwrite some config | ||
sliderPuzzle.setConfig = overConfig => { | ||
merge(config, overConfig) | ||
} | ||
export default sliderPuzzle |
@@ -40,4 +40,4 @@ import config1 from './config1' | ||
// 允许访问的ip,至少填一个 | ||
allowedIps: ['127.0.0.1'], | ||
// 允许访问的ip,不填则为不验证 | ||
// allowedIps: ['127.0.0.1'], | ||
@@ -44,0 +44,0 @@ // 背景图存放路径,以/结尾 |
@@ -20,3 +20,3 @@ export default { | ||
redisConfig: { | ||
host: '127.0.0.1', | ||
host: '10.12.30.1', | ||
port: '6379', | ||
@@ -39,3 +39,3 @@ }, | ||
// 允许访问的ip,至少填一个 | ||
allowedIps: ['127.0.0.1'], | ||
//allowedIps: ['127.0.0.1'], | ||
@@ -42,0 +42,0 @@ // 背景图存放路径,以/结尾 |
@@ -8,2 +8,5 @@ import config from '../config' | ||
const testIp = ip => { | ||
if (!config.allowedIps) { | ||
return true | ||
} | ||
if (!ip) { | ||
@@ -10,0 +13,0 @@ return false |
@@ -32,1 +32,5 @@ import express from 'express' | ||
} | ||
setInterval(() => { | ||
store.clear() | ||
}, config.expire * 2) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
503630
142
3269
1
57