mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 00:15:12 +00:00
custom server
This commit is contained in:
9
node_modules/api.js
generated
vendored
9
node_modules/api.js
generated
vendored
@@ -51,8 +51,9 @@ var Api = {
|
||||
// 是否断网
|
||||
unConnected: function(error) {
|
||||
var me = this;
|
||||
// console.log(error);
|
||||
if(error && (error.code == "ECONNREFUSED" || error.code == 'ECONNRESET')) { // socket hand up
|
||||
console.error('---------------------')
|
||||
console.error(error);
|
||||
Web.unConnected();
|
||||
return true;
|
||||
}
|
||||
@@ -79,9 +80,12 @@ var Api = {
|
||||
return url;
|
||||
},
|
||||
// 登录
|
||||
auth: function(email, pwd, callback) {
|
||||
auth: function(email, pwd, host, callback) {
|
||||
var me = this;
|
||||
|
||||
// 设置server host
|
||||
Evt.setHost(host);
|
||||
|
||||
// log({emai: email, pwd: pwd});
|
||||
console.log(this.getUrl('auth/login', {email: email, pwd: pwd}));
|
||||
// console.log('????????????')
|
||||
@@ -97,6 +101,7 @@ var Api = {
|
||||
// console.log(ret);
|
||||
if(Common.isOk(ret)) {
|
||||
ret.Pwd = pwd;
|
||||
ret['Host'] = Evt.leanoteUrl;
|
||||
User.setCurUser(ret);
|
||||
callback && callback(ret);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user