|
|
|
@ -61,11 +61,7 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
user.setTeamBeens(teamBeens);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPda();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -93,7 +89,6 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
if (loginState) {
|
|
|
|
|
SharedPreferencesUtils.putstring("pdaName", pdaList.get(index).getPdaName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
Toast.makeText(MainActivity.this, result.getMsg(), Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
@ -130,10 +125,10 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
|
|
|
|
|
// 登录
|
|
|
|
|
public void login(View view) {
|
|
|
|
|
// if (!loginState) {
|
|
|
|
|
// Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show();
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if (!loginState) {
|
|
|
|
|
Toast.makeText(this, "设备未注册,不允许登录", Toast.LENGTH_SHORT).show();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String teamCode = user.getTeamCode();
|
|
|
|
|
if (teamCode==null||teamCode.isEmpty()) return;
|
|
|
|
|
dialog.show();
|
|
|
|
@ -143,7 +138,6 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(Response<String> response) {
|
|
|
|
|
LoginBack loginBack = gson.fromJson(response.body(), LoginBack.class);
|
|
|
|
|
|
|
|
|
|
if (loginBack.getCode() == 200) {
|
|
|
|
|
getUserInfo(loginBack.getToken());
|
|
|
|
|
} else {
|
|
|
|
@ -151,7 +145,6 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
Toast.makeText(MainActivity.this, loginBack.getMsg(), Toast.LENGTH_SHORT).show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onError(Response<String> response) {
|
|
|
|
|
super.onError(response);
|
|
|
|
@ -179,6 +172,7 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
SharedPreferencesUtils.putstring("teamCode", user.getTeamCode());
|
|
|
|
|
SharedPreferencesUtils.putstring("teamName", user.getTeamName());
|
|
|
|
|
SharedPreferencesUtils.putstring("token", token);
|
|
|
|
|
intent.putExtra("userPermission", loginBack.getUserPermission());
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
finish();
|
|
|
|
|
} else {
|
|
|
|
|