[page.noauth.login] fetch UID from login request
This commit is contained in:
parent
bb8a985db3
commit
0676b8d747
|
@ -42,13 +42,13 @@ gs.get.login.func.login = function(){
|
||||||
api.call('GET /user/token', {}, function(rs){
|
api.call('GET /user/token', {}, function(rs){
|
||||||
|
|
||||||
// manage error
|
// manage error
|
||||||
if( rs.error !== 0 || rs.token == null )
|
if( rs.error !== 0 || rs.token == null || rs.uid == null )
|
||||||
return this.failed = true;
|
return this.failed = true;
|
||||||
|
|
||||||
// store TOKEN + user data
|
// store TOKEN + user data
|
||||||
auth.token = rs.token;
|
auth.token = rs.token;
|
||||||
auth.user = {
|
auth.user = {
|
||||||
uid: null, // todo
|
uid: rs.uid,
|
||||||
username: username
|
username: username
|
||||||
};
|
};
|
||||||
document.location = '';
|
document.location = '';
|
||||||
|
|
Loading…
Reference in New Issue