-
Notifications
You must be signed in to change notification settings - Fork 8
login
Ren Fei edited this page Dec 17, 2020
·
1 revision
原文:https://code.google.com/archive/p/discuz-ucenter-api-for-java/wikis/login.wiki
Client e = new Client(); String result = e.uc_user_login("username", "password");
LinkedList[String> rs = XMLHelper.uc_unserialize(result); if(rs.size()>0){
int $uid = Integer.parseInt(rs.get(0)); String $username = rs.get(1); String $password = rs.get(2); String $email = rs.get(3); if($uid > 0) {
System.out.println("登录成功"); System.out.println($username); System.out.println($password); System.out.println($email);
String $ucsynlogin = e.uc_user_synlogin($uid); System.out.println("登录成功"+$ucsynlogin);
//本地登陆代码 //TODO ... .... } else if($uid == -1) {
System.out.println("用户不存在,或者被删除");
} else if($uid == -2) {
System.out.println("密码错");
} else {
System.out.println("未定义");
} }else{
System.out.println("Login failed"); System.out.println(result);
}