mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(config) add traverse
This commit is contained in:
parent
6f1d49fcca
commit
3896abe972
1 changed files with 13 additions and 8 deletions
|
|
@ -75,10 +75,7 @@
|
|||
} else {
|
||||
cryptoPass(json);
|
||||
|
||||
Object.keys(json).forEach(function(name) {
|
||||
data = CloudFunc.formatMsg('config', name);
|
||||
set(name, json[name]);
|
||||
});
|
||||
data = traverse(json);
|
||||
|
||||
save(function(error) {
|
||||
if (error) {
|
||||
|
|
@ -141,10 +138,7 @@
|
|||
else
|
||||
cryptoPass(json);
|
||||
|
||||
Object.keys(json).forEach(function(name) {
|
||||
data = CloudFunc.formatMsg('config', name);
|
||||
set(name, json[name]);
|
||||
});
|
||||
data = traverse(json);
|
||||
|
||||
save(function(error) {
|
||||
if (error)
|
||||
|
|
@ -155,6 +149,17 @@
|
|||
});
|
||||
}
|
||||
|
||||
function traverse(json) {
|
||||
var data;
|
||||
|
||||
Object.keys(json).forEach(function(name) {
|
||||
data = CloudFunc.formatMsg('config', name);
|
||||
set(name, json[name]);
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function cryptoPass(json) {
|
||||
if (json && json.password)
|
||||
json.password = crypt(json.password);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue