| | |
| | | } else if ((passWordBean == null && psStr.equals("123456")) |
| | | || passWordBean != null && passWordBean.getPassWord().equalsIgnoreCase(WSMD5.getMD5Str(psStr))) { |
| | | startToHomeActivity(); |
| | | } else if (MyApplication.myApplication.libraryType == BaseCommon.Generalv1Library) { |
| | | com.dayu.general.activity.LoginActivity.login(nameStr, psStr, this); |
| | | } else { |
| | | Toast.makeText(LoginActivity.this, "密码错误", Toast.LENGTH_SHORT).show(); |
| | | } |
| | |
| | | protected void onResume() { |
| | | super.onResume(); |
| | | Log.i("LoginActivity", "onResume"); |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.QHOnLineLibrary) { |
| | | if (MyApplication.myApplication.libraryType == BaseCommon.QHOnLineLibrary || MyApplication.myApplication.libraryType == BaseCommon.Generalv1Library) { |
| | | binding.nameLL.setVisibility(View.VISIBLE); |
| | | } |
| | | } |
| | |
| | | } else if (type == BaseCommon.QHOnLineLibrary) { |
| | | getQHOnlinPermission(); |
| | | binding.nameLL.setVisibility(View.VISIBLE); |
| | | } else if (type == BaseCommon.Generalv1Library) { |
| | | binding.nameLL.setVisibility(View.VISIBLE); |
| | | getGeneralV1Permission(); |
| | | } |
| | | MyApplication.myApplication.initApplication(); |
| | | }); |
| | |
| | | startActivity(new Intent(LoginActivity.this, HomeActivityQHAlone.class)); |
| | | } else if (MyApplication.myApplication.libraryType == BaseCommon.QHOnLineLibrary) { |
| | | startActivity(new Intent(LoginActivity.this, HomeActivityQHOline.class)); |
| | | } else if (MyApplication.myApplication.libraryType == BaseCommon.Generalv1Library) { |
| | | startActivity(new Intent(LoginActivity.this, com.dayu.general.activity.MainActivity.class)); |
| | | } |
| | | LoginActivity.this.finish(); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取通用权限V1版本 |
| | | * 该方法用于请求应用所需的权限,以便应用可以正常运行 |
| | | */ |
| | | private void getGeneralV1Permission() { |
| | | try { |
| | | XXPermissions.with(this) |
| | | // 申请单个权限 |
| | | // .permission(Permission.RECORD_AUDIO) |
| | | // 申请多个权限 |
| | | .permission(Permission.READ_PHONE_STATE, |
| | | Permission.READ_EXTERNAL_STORAGE, |
| | | Permission.WRITE_EXTERNAL_STORAGE) |
| | | // 设置权限请求拦截器(局部设置) |
| | | //.interceptor(new PermissionInterceptor()) |
| | | // 设置不触发错误检测机制(局部设置) |
| | | //.unchecked() |
| | | .request(new OnPermissionCallback() { |
| | | |
| | | @Override |
| | | public void onGranted(@NonNull List<String> permissions, boolean allGranted) { |
| | | if (allGranted) { |
| | | if (allGranted) {//所有申请的权限都已通过 |
| | | try { |
| | | File file = new File(com.dayu.general.dao.BaseDaoSingleton.SqlitePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onDenied(@NonNull List<String> permissions, boolean doNotAskAgain) { |
| | | if (doNotAskAgain) { |
| | | // 如果是被永久拒绝就跳转到应用权限系统设置页面 |
| | | } else { |
| | | // toast("获取录音和日历权限失败"); |
| | | } |
| | | } |
| | | }); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | long mExitTime; |
| | | |
| | | @Override |