From 51b190f22aa8751bd9fbe5229ab5546facdef632 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 11 二月 2025 16:23:53 +0800
Subject: [PATCH] 修改订单问题和定时任务bug

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java |   41 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
index 7ba230c..3c211b4 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
@@ -6,6 +6,7 @@
 import com.google.code.kaptcha.Constants;
 import com.stylefeng.guns.core.common.constant.JwtConstants;
 import com.stylefeng.guns.core.common.exception.InvalidKaptchaException;
+import com.stylefeng.guns.core.shiro.ShiroKit;
 import com.stylefeng.guns.core.support.HttpKit;
 import com.stylefeng.guns.core.util.ToolUtil;
 import com.stylefeng.guns.modular.system.model.BankCard;
@@ -89,6 +90,8 @@
     
     @Autowired
     private FleetEngineUtil fleetEngineUtil;
+    
+    private String salt = "&a.s";
 
 
 
@@ -1398,14 +1401,21 @@
             new Timer().schedule(new TimerTask() {
                 @Override
                 public void run() {
-                    Process process = null;
                     try {
-                        process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName + ".mp3");
-                    } catch (IOException e) {
-                        throw new RuntimeException(e);
-                    }
-                    if (process != null) {
-                        process.destroy();
+                        // 使用Runtime执行命令
+                        Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName + ".mp3");
+                        // 读取命令的输出
+                        BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+                        String line;
+                        while ((line = reader.readLine()) != null) {
+                            System.out.println(line);
+                        }
+                        // 等待命令执行完成
+                        process.waitFor();
+                        // 关闭流
+                        reader.close();
+                    } catch (IOException | InterruptedException e) {
+                        e.printStackTrace();
                     }
                 }
             }, 30000);
@@ -1414,4 +1424,21 @@
             throw new RuntimeException(e);
         }
     }
+    
+    
+    
+    @PostMapping("/base/user/delUserInfo")
+    public ResultUtil delUserInfo(String username, String password){
+        UserInfo userInfo = userInfoService.selectOne(new EntityWrapper<UserInfo>().eq("phone", username)
+                .ne("flag", 3));
+        if(null == userInfo){
+            return ResultUtil.error("Invalid account");
+        }
+        if(!ShiroKit.md5(password, salt).equals(userInfo.getPassWord())){
+            return ResultUtil.error("Wrong password");
+        }
+        userInfo.setFlag(3);
+        userInfoService.updateById(userInfo);
+        return ResultUtil.success();
+    }
 }

--
Gitblit v1.7.1