Showing
1 changed file
with
5 additions
and
3 deletions
@@ -33,6 +33,8 @@ const risk = { | @@ -33,6 +33,8 @@ const risk = { | ||
33 | var key = ctx.request.query.key; | 33 | var key = ctx.request.query.key; |
34 | var oldRet = ''; | 34 | var oldRet = ''; |
35 | 35 | ||
36 | + key = key.replace(/\s+/g, '+'); | ||
37 | + | ||
36 | if (key) { | 38 | if (key) { |
37 | var app = key.split('/')[0]; | 39 | var app = key.split('/')[0]; |
38 | var path = formatPath(app); | 40 | var path = formatPath(app); |
@@ -41,7 +43,7 @@ const risk = { | @@ -41,7 +43,7 @@ const risk = { | ||
41 | if (oldRet) { | 43 | if (oldRet) { |
42 | oldRet = JSON.parse(oldRet); | 44 | oldRet = JSON.parse(oldRet); |
43 | } | 45 | } |
44 | - | 46 | + |
45 | data = _.find(oldRet, function(o) { | 47 | data = _.find(oldRet, function(o) { |
46 | return `${o.app}/${o.route}` === key; | 48 | return `${o.app}/${o.route}` === key; |
47 | }); | 49 | }); |
@@ -167,7 +169,7 @@ const risk = { | @@ -167,7 +169,7 @@ const risk = { | ||
167 | }); | 169 | }); |
168 | 170 | ||
169 | let result = await zookeeperModel.setPath(path, JSON.stringify(oldRet)); | 171 | let result = await zookeeperModel.setPath(path, JSON.stringify(oldRet)); |
170 | - | 172 | + |
171 | 173 | ||
172 | if (result) { | 174 | if (result) { |
173 | ctx.body = { | 175 | ctx.body = { |
@@ -193,4 +195,4 @@ r.post('/setter', risk.setter); | @@ -193,4 +195,4 @@ r.post('/setter', risk.setter); | ||
193 | r.post('/edit', risk.edit); | 195 | r.post('/edit', risk.edit); |
194 | r.post('/remove', risk.remove); | 196 | r.post('/remove', risk.remove); |
195 | 197 | ||
196 | -module.exports = r; | ||
198 | +module.exports = r; |
-
Please register or login to post a comment