未登录可先进入首页浏览、触发敏感功能再登录
This commit is contained in:
@@ -152,7 +152,7 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
public void setTitle() {
|
||||
// initFontScale();
|
||||
top_title.setText("登录");
|
||||
top_back_layout.setVisibility(View.GONE);
|
||||
top_back_layout.setVisibility(View.VISIBLE);
|
||||
// top_right_text.setVisibility(View.VISIBLE);
|
||||
// top_right_text.setText("注册");
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
View view = View.inflate(ct, R.layout.activity_login_new, null);
|
||||
|
||||
// initFontScale();
|
||||
Constant.islogout = 1;
|
||||
// Constant.islogout = 1;
|
||||
DestroyActivityUtil.addDestoryActivityToMap(this,"LoginActivity");
|
||||
usernameEditText = (EditText) view.findViewById(R.id.username);// 账号
|
||||
// 设置输入框获得焦点hint提示消失添加监听
|
||||
@@ -883,8 +883,9 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
} else if (id == R.id.top_back_layout) {
|
||||
// 返回
|
||||
finish();
|
||||
AppManager.getAppManager().finishAllActivity();
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
}
|
||||
} else if (id == R.id.bt_login) {
|
||||
// 登录
|
||||
|
||||
@@ -1119,8 +1120,9 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
super.onBackPressed();
|
||||
// 监听返回键
|
||||
finish();
|
||||
AppManager.getAppManager().finishAllActivity();
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1212,6 +1214,8 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
// {
|
||||
intent.setClass(this, MainActivity.class);
|
||||
// }
|
||||
Constant.islogout = 2;
|
||||
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true);
|
||||
intent.putExtra("launcher_from", 1);
|
||||
|
||||
startActivity(intent);
|
||||
@@ -1220,7 +1224,8 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true);
|
||||
|
||||
// 1登入系统 2退出系统 3专家客户端在手机前台运行 4.专家客户端在手机后台运行
|
||||
BaseActivity.foreBack(LoginNewActivity.this, 1);
|
||||
BaseActivity.foreBack(LoginNewActivity.this, 1);
|
||||
finish();
|
||||
}
|
||||
|
||||
public final static int GET_SYSTEM_TIME_RESULT = 103;
|
||||
@@ -1571,10 +1576,29 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK&& event.getAction() == KeyEvent.ACTION_DOWN){
|
||||
finishAffinity();
|
||||
AppManager.getAppManager().finishAllActivity();
|
||||
System.exit(0);
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK&& event.getAction() == KeyEvent.ACTION_DOWN){
|
||||
handleBackClose();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private void handleBackClose() {
|
||||
if (MainActivity.mMainActivity == null || MainActivity.mMainActivity.isFinishing() || MainActivity.mMainActivity.isDestroyed()) {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
private boolean unusedExitStub() {
|
||||
if (false) {
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -588,7 +588,10 @@ public class MainActivity extends BaseActivity implements
|
||||
sendJsonPostParamtoNetSignMD5(getShowMagazine,param,666,this);
|
||||
}
|
||||
|
||||
private void getAccessToken(){
|
||||
private void getAccessToken(){
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String, String> param = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(getAccessToken, param, ACCESS_TOKEN,this);
|
||||
}
|
||||
@@ -766,7 +769,10 @@ public class MainActivity extends BaseActivity implements
|
||||
/**
|
||||
* 云信
|
||||
*/
|
||||
private void login() {
|
||||
private void login() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String yx_accid = SharePrefUtil.getString(MainActivity.this, Constant.yx_accid, "");
|
||||
String yx_token = SharePrefUtil.getString(MainActivity.this, Constant.yx_token, "");
|
||||
if(StringUtil.isEmpty(yx_accid)||StringUtil.isEmpty(yx_token))
|
||||
@@ -837,7 +843,10 @@ public class MainActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
|
||||
private void setPolvPlayViewerId() {
|
||||
private void setPolvPlayViewerId() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String mobile = SharePrefUtil.getString(MainActivity.this, Constant.mobile, "");
|
||||
String mobile_encryption = mobile +Url.polvId;
|
||||
|
||||
@@ -864,6 +873,10 @@ public class MainActivity extends BaseActivity implements
|
||||
|
||||
private void getIsAccount() {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(Url.getGray,map,222,this);
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(Url.getIsAccount,map,GETISACCOUNT,this);
|
||||
sendJsonPostParamtoNetSignMD5(Url.getGray,map,222,this);
|
||||
sendJsonPostParamtoNetSignMD5(Url.checkUser,map,333,this);
|
||||
@@ -876,7 +889,10 @@ public class MainActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
|
||||
private void isMaiLanExpert() {
|
||||
private void isMaiLanExpert() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String,String> map = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(Url.isMaiLanExpert,map,ISMAILANEXPERT,this);
|
||||
}
|
||||
@@ -995,7 +1011,10 @@ public class MainActivity extends BaseActivity implements
|
||||
|
||||
}
|
||||
|
||||
private void getWelfareNotice() {
|
||||
private void getWelfareNotice() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
if(!isSendGetUP)
|
||||
{
|
||||
Map<String,String> map = new HashMap<>();
|
||||
@@ -1407,7 +1426,10 @@ public class MainActivity extends BaseActivity implements
|
||||
};
|
||||
|
||||
//展示uniapp mp
|
||||
public void showUniMp(boolean showLoading, String targetPath){
|
||||
public void showUniMp(boolean showLoading, String targetPath){
|
||||
if (!UIUtils.checkLoginAndJump(MainActivity.this)) {
|
||||
return;
|
||||
}
|
||||
if(showLoading){
|
||||
showFullScreenLoading();
|
||||
}
|
||||
@@ -1726,6 +1748,9 @@ public class MainActivity extends BaseActivity implements
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UIUtils.checkLoginAndJump(MainActivity.this)) {
|
||||
return;
|
||||
}
|
||||
if (isSign) {
|
||||
MobclickAgent.onEvent(MainActivity.this, StaUtil.EXPERT_HOME_SIGN_IN_AGAIN);
|
||||
dilaog2 = ECAlertDialog.buildAlert(MainActivity.this,
|
||||
@@ -2098,7 +2123,17 @@ public class MainActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
super.onResume();
|
||||
ShowMagazine();
|
||||
ShowMagazine();
|
||||
if (UIUtils.isLogined()) {
|
||||
isMaiLanExpert();
|
||||
getIsAccount();
|
||||
setPolvPlayViewerId();
|
||||
login();
|
||||
getHospital();
|
||||
if (StringUtil.isEmpty(Constant.Repotr_token)) {
|
||||
initReport();
|
||||
}
|
||||
}
|
||||
getAccessToken();
|
||||
if(!needshowGuideView()&&order>0)
|
||||
{
|
||||
@@ -2127,7 +2162,7 @@ public class MainActivity extends BaseActivity implements
|
||||
|
||||
/**退出账号会重新加载此页面,有时判断是*/
|
||||
if (TextUtils.isEmpty(account)) {
|
||||
if (Constant.islogout == 1){
|
||||
if (Constant.islogout == 1 && false){
|
||||
// 注销账号,清除该账号的所有文件,
|
||||
DataCleanManager.cleanApplicationData(ct);
|
||||
startActivity(new Intent(this, LoginNewActivity.class));
|
||||
@@ -3494,6 +3529,9 @@ public class MainActivity extends BaseActivity implements
|
||||
// param.put("user_name", "吴从兴");
|
||||
// param.put("mobile", "13196988208");
|
||||
// param.put("user_name", "顾生旺 ");
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
param.put("mobile", SharePrefUtil.getString(this, "mobile", ""));
|
||||
param.put("user_name", SharePrefUtil.getString(this, "realName", ""));
|
||||
Map<String,String> map = new HashMap<>();
|
||||
@@ -3551,6 +3589,9 @@ public class MainActivity extends BaseActivity implements
|
||||
{
|
||||
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(Url.getTagToken,map,1122,this);
|
||||
|
||||
|
||||
|
||||
@@ -220,7 +220,10 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
||||
m_help.setOnClickListener(this);
|
||||
rl_setting_yinsi.setOnClickListener(this);
|
||||
rl_setting_yinsi1.setOnClickListener(this);
|
||||
m_out.setOnClickListener(this);
|
||||
m_out.setOnClickListener(this);
|
||||
if (!UIUtils.isLogined()) {
|
||||
m_out.setVisibility(View.GONE);
|
||||
}
|
||||
m_abouat.setOnClickListener(this);
|
||||
rl_gdxz_live.setOnClickListener(this);
|
||||
rl_shareapp.setOnClickListener(this);
|
||||
@@ -353,7 +356,12 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
||||
@Override
|
||||
protected void processClick(View v) {
|
||||
// AGP 8.0+ R.id 不再是 final 常量,不能用于 switch,改用 if-else
|
||||
int id = v.getId();
|
||||
int id = v.getId();
|
||||
if ((id == R.id.rl_setting_feedback || id == R.id.rl_setting_zhuxiao
|
||||
|| id == R.id.rl_setting_changepsw || id == R.id.rl_changenum
|
||||
|| id == R.id.rl_setting_bindwx) && !UIUtils.checkLoginAndJump(this)) {
|
||||
return;
|
||||
}
|
||||
if (id == R.id.ll_dynamic) {
|
||||
goToNotificationSetting();
|
||||
} else if (id == R.id.rl_setting_version) {// 版本
|
||||
@@ -703,7 +711,12 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
||||
// LogUtil.i("容联连接失败");
|
||||
// }
|
||||
// PatientSqlManager.delAllPatientInfo(Constant.typePatient);
|
||||
LogoutHelper.logout();
|
||||
LogoutHelper.logout();
|
||||
SharePrefUtil.saveBoolean(ctx, Constant.IS_LOGIN, false);
|
||||
SharePrefUtil.saveString(ctx, Constant.uuid, "");
|
||||
SharePrefUtil.saveString(ctx, Constant.USERID, "");
|
||||
SharePrefUtil.saveString(ctx, "access_token", "");
|
||||
SharePrefUtil.saveString(ctx, "refresh_token", "");
|
||||
addUMToken("");
|
||||
Intent intent = new Intent(ctx, LoginNewActivity.class);
|
||||
intent.putExtra("flag", true);
|
||||
|
||||
Reference in New Issue
Block a user