From 821fc2f632f8b974a2c0fc37630e13c5fbe6086c Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 26 九月 2025 17:26:16 +0800
Subject: [PATCH] 修改bug

---
 UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java |   40 ++++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 6 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 23f8bac..4e745f5 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";
 
 
 
@@ -297,12 +300,12 @@
                 EmailUtil.send(email, language == 1 ? "邮箱验证" : language == 2 ? "Verification code" : "Code de validation",  document.html());
 
                 //开始生成pdf收据和html收据
-                File file = new File("/home/igotechgh/nginx/html/files/html/");
+                File file = new File("/data/nginx/html/files/html/");
                 if(!file.exists()){
                     file.mkdirs();
                 }
                 String randomString = ToolUtil.getRandomString(10);
-                file = new File("/home/igotechgh/nginx/html/files/html/mainbox_" + randomString + ".html");
+                file = new File("/data/nginx/html/files/html/mainbox_" + randomString + ".html");
                 if(!file.exists()){
                     file.createNewFile();
                 }
@@ -795,11 +798,15 @@
             @ApiImplicitParam(value = "电话号码,没有传空字符串", name = "phone", required = true, dataType = "String"),
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
     })
-    public ResultUtil setUrgentUser(String name, String phone, HttpServletRequest request){
+    public ResultUtil setUrgentUser(String name, String phone, Integer language, HttpServletRequest request){
         try {
             Integer uid = userInfoService.getUserIdFormRedis(request);
             if(null == uid){
                 return ResultUtil.tokenErr();
+            }
+            UserInfo userInfo = userInfoService.selectById(uid);
+            if(ToolUtil.isEmpty(userInfo.getPhone())){
+                return ResultUtil.error(language == 1 ? "请先绑定手机号码" : language == 2 ? "Please bind your mobile phone number first." : "Veuillez d’abord vous inscrire en liant votre numéro de téléphone portable.");
             }
             String substring = phone.substring(0, 1);
             if("0".equals(substring)){
@@ -1235,6 +1242,10 @@
             if(null == uid){
                 return ResultUtil.tokenErr();
             }
+            UserInfo userInfo = userInfoService.selectById(uid);
+            if(ToolUtil.isEmpty(userInfo.getPhone())){
+                return ResultUtil.error(language == 1 ? "请先绑定手机号码" : language == 2 ? "Please bind your mobile phone number first." : "Veuillez d’abord vous inscrire en liant votre numéro de téléphone portable.");
+            }
             BigDecimal bigDecimal = new BigDecimal(code);
             long max = Long.MAX_VALUE;
             if(bigDecimal.compareTo(new BigDecimal(max)) >= 0){
@@ -1332,10 +1343,10 @@
         ServletOutputStream outputStream = null;
         try {
             if(orderType == 1){
-                fileInputStream = new FileInputStream(new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"));
+                fileInputStream = new FileInputStream(new File("/data/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"));
             }
             if(orderType == 4){
-                fileInputStream = new FileInputStream(new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"));
+                fileInputStream = new FileInputStream(new File("/data/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"));
             }
             BufferedInputStream bf = new BufferedInputStream(fileInputStream);
             outputStream = response.getOutputStream();
@@ -1400,7 +1411,7 @@
                 public void run() {
                     try {
                         // 使用Runtime执行命令
-                        Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName + ".mp3");
+                        Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName + ".mp3");
                         // 读取命令的输出
                         BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                         String line;
@@ -1421,4 +1432,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