|
发表于 2016-8-15 09:50:24
|
显示全部楼层
client.validPerson(pid, pname).done(function(state) {
if (state === "logged_in") {
loginOKdeferred.promise().then(function() {
self.loadPerson(persons, pid).done(function() {
var uid = client.getUid();
if (uid) {
self.updatePersonUid(uid, pid).done(function() {
// self.doLoginAfter(result);
deferred.resolve(result);
}).fail(function(error) {
deferred.reject("同步UID失败!");
});
} else {
deferred.reject("无法获取UID");
self.logout();
}
}).fail(function(error) {
deferred.reject("加载人员失败 ," + (error || '未知错误'));
});
}, function(info) {
self.logout();
throw new Error(info);
});
} else if (state === "signup") {
deferred.reject("signUp unSupported");
} else {
deferred.reject("Unsupported state: " + state);
}
}).fail(function(error) {
deferred.reject("登录出错! 原因: " + error);
});
im.impl.js中loginActor中的这段代码是第一次登录注册dangchat-sever用户的逻辑 |
|