| | |
| | | String password = "admin"; |
| | | String site = ""; |
| | | String teamGroup = ""; |
| | | String team = ""; |
| | | |
| | | String path = Login.class.getClassLoader().getResource("config.properties").getPath(); |
| | | InputStream inStream = null; |
| | |
| | | password = properties.get("password").toString(); |
| | | site = properties.get("site").toString(); |
| | | teamGroup = properties.get("teamGroup").toString(); |
| | | team = properties.get("team").toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | } finally { |
| | | if (reader != null) { |
| | | try { |
| | | reader.close(); |
| | |
| | | |
| | | String finalSite = site; |
| | | String finalTeamGroup = teamGroup; |
| | | String finalTeam = team; |
| | | loginButton.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | |
| | | String str = String.valueOf(password); //将char数组转化为string类型 |
| | | |
| | | |
| | | user = userService.login(name,str); |
| | | user = userService.login(name, str); |
| | | exist = user.getExist(); |
| | | |
| | | |
| | |
| | | } |
| | | properties.setProperty("userName", name); |
| | | properties.setProperty("password", str); |
| | | properties.setProperty("url", "11"); |
| | | properties.store(outputStream, "rxkj"); |
| | | outputStream.close(); |
| | | } catch (FileNotFoundException ex) { |
| | |
| | | } catch (IOException ep) { |
| | | ep.printStackTrace(); |
| | | } |
| | | |
| | | user.setBoatfleet(finalTeam); |
| | | CacheUtils.put("user", "user", user); |
| | | CacheUtils.put("site", "site", finalSite); |
| | | CacheUtils.put("teamGroup", "teamGroup", finalTeamGroup); |