parent
612123abc6
commit
5d085306f1
Binary file not shown.
@ -0,0 +1,25 @@
|
||||
@Override
|
||||
public void onSucess(String response) {
|
||||
//执行登陆请求成功 解析返回json内容
|
||||
System.out.println("response = " + response);
|
||||
JSONObject object = JSON.parseObject(response);
|
||||
Integer status = object.getInteger("status");
|
||||
String msg = object.getString("msg");
|
||||
String data = object.getString("data");
|
||||
if (status == 200) {
|
||||
/*Looper.prepare();
|
||||
Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_SHORT).show();
|
||||
Looper.loop();*/
|
||||
System.out.println("登录成功");
|
||||
//更新界面
|
||||
User user = JSON.parseObject(data, User.class);
|
||||
App.user = user;
|
||||
startActivity(new Intent(getApplicationContext(), MainActivity.class));
|
||||
finish();
|
||||
} else {
|
||||
Looper.prepare();
|
||||
Toast.makeText(getApplicationContext(), "登录失败", Toast.LENGTH_SHORT).show();
|
||||
Looper.loop();
|
||||
System.out.println("登录失败");
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue