| | |
| | | tv_register = findView(R.id.tv_register); |
| | | et_phone = findView(R.id.et_phone); |
| | | et_pwd = findView(R.id.et_pwd); |
| | | et_phone.setText("15950198162"); |
| | | et_pwd.setText("888888"); |
| | | et_phone.setText("18362724160"); |
| | | et_pwd.setText("123456"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | private void login(String tel, final String pwd) { |
| | | String url = API.LOGIN; |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("username", tel); |
| | | params.put("phone", tel); |
| | | params.put("password", pwd); |
| | | HttpUtils.doPost(url, params, CacheMode.DEFAULT, true, new HttpCallBack() { |
| | | @Override |
| | |
| | | User user = FastJsonTools.getJson(res,User.class); |
| | | if(user!=null){ |
| | | MainApp.theApp.sharedPreferencesUtil.saveLoginInfo(user); |
| | | // MainApp.theApp.userId = user.get_id(); |
| | | MainApp.theApp.userId = user.get_id(); |
| | | Intent intent = new Intent(getApplicationContext(), MainActivity.class); |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putBoolean("islogin",true); |