mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(config) auth check
This commit is contained in:
parent
ffa8a44320
commit
bb0b1f2bce
1 changed files with 25 additions and 25 deletions
|
|
@ -66,35 +66,35 @@ var CloudCmd, Util, DOM, io;
|
|||
path: prefix + '/socket.io'
|
||||
});
|
||||
|
||||
auth(socket, function() {
|
||||
socket.on('connect', function() {
|
||||
Config.save = save;
|
||||
});
|
||||
|
||||
socket.on('config', function(config) {
|
||||
DOM.Storage.setAllowed(config.localStorage);
|
||||
});
|
||||
|
||||
socket.on('message', function(data) {
|
||||
onSave(data);
|
||||
});
|
||||
|
||||
socket.on('log', function(msg) {
|
||||
CloudCmd.log(msg);
|
||||
});
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
Config.save = saveHttp;
|
||||
});
|
||||
|
||||
socket.on('err', function(error) {
|
||||
Dialog.alert(TITLE, error);
|
||||
});
|
||||
authCheck(socket);
|
||||
|
||||
socket.on('connect', function() {
|
||||
Config.save = save;
|
||||
});
|
||||
|
||||
socket.on('config', function(config) {
|
||||
DOM.Storage.setAllowed(config.localStorage);
|
||||
});
|
||||
|
||||
socket.on('message', function(data) {
|
||||
onSave(data);
|
||||
});
|
||||
|
||||
socket.on('log', function(msg) {
|
||||
CloudCmd.log(msg);
|
||||
});
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
Config.save = saveHttp;
|
||||
});
|
||||
|
||||
socket.on('err', function(error) {
|
||||
Dialog.alert(TITLE, error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function auth(socket) {
|
||||
function authCheck(socket) {
|
||||
Files.get('config', function(error, config) {
|
||||
if (error)
|
||||
return Dialog.alert(TITLE, error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue