Browse Source

移动端登录地址修改

wanxl 1 year ago
parent
commit
ed45d57abc

+ 6 - 2
src/main/java/com/template/controller/AppletLoginController.java

@@ -21,6 +21,7 @@ import com.template.services.PermissionSettingService;
 import com.template.services.UsersService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.MediaType;
@@ -49,6 +50,9 @@ public class AppletLoginController implements AppletLoginControllerAPI {
     @Autowired
     PermissionSettingService permissionSettingService;
 
+    @Value("${image.url}")
+    private String url;
+
     public static void main(String[] args) throws UnsupportedEncodingException {
         String name ="\u571f\u6728\u5efa\u7b51\u5206\u9662";
         String encodeName = URLEncoder.encode(name,"utf-8");
@@ -193,11 +197,11 @@ public class AppletLoginController implements AppletLoginControllerAPI {
            log.info("adminMenuId= "+adminMenuId);
 
           //  System.out.println("重定向路径=" + "redirect:"+ "https://chtech.ncjti.edu.cn/hotel/h5/#/?token="+token+"&adminId="+adminId+"&adminMenuId="+adminMenuId+"&adminMenuName="+adminMenuName+"&usersId="+usersId+"&user_head="+user_head);
-           return "redirect:"+ "https://chtech.ncjti.edu.cn/hotel/h5/#/?token="+token+"&adminId="+adminId+"&adminMenuId="+adminMenuId+"&adminMenuName="+adminMenuName+"&usersId="+usersId+"&user_head="+user_head+"&name="+encodeName+"&telephone="+telephone+"&department="+identityTitle+"&manager="+manager+"&head_image="+headImage+"&OrgIds="+OrgIds+"&parentId="+parentId;
+           return "redirect:"+url+ "/h5/#/?token="+token+"&adminId="+adminId+"&adminMenuId="+adminMenuId+"&adminMenuName="+adminMenuName+"&usersId="+usersId+"&user_head="+user_head+"&name="+encodeName+"&telephone="+telephone+"&department="+identityTitle+"&manager="+manager+"&head_image="+headImage+"&OrgIds="+OrgIds+"&parentId="+parentId;
 //            return "redirect:"+ "http://192.168.161.33:8000/hotel/h5/?token="+token+"&adminId="+adminId+"&adminMenuId="+adminMenuId+"&adminMenuName="+adminMenuName+"&usersId="+usersId+"&user_head="+user_head+"&name="+encodeName+"&telephone="+telephone+"&department="+identityTitle+"&manager="+manager;
         } catch (Exception e) {
             e.printStackTrace();
-            return "redirect:" + "https://chtech.ncjti.edu.cn/hotel/h5/#/error/?errorMsg=" + URLEncoder.encode("获取用户信息失败", "utf-8");
+            return "redirect:" +url+ "/h5/#/error/?errorMsg=" + URLEncoder.encode("获取用户信息失败", "utf-8");
 //           return "redirect:" + "http://192.168.161.33:8000/hotel/h5/#/error/?errorMsg=" + URLEncoder.encode("获取用户信息失败", "utf-8");
         }
     }

+ 1 - 1
src/main/java/com/template/controller/UploadServlet.java

@@ -52,7 +52,7 @@ public class UploadServlet {
 //            out.write(buffer, 0, bytesRead);
 //        }
 //        out.close();
-        String url=imageUrl+fileNameWithPath;
+        String url=imageUrl+"/image/"+fileNameWithPath;
 //        response.getWriter().println(url);
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("url",url);

+ 1 - 1
src/main/resources/application-dev.yml

@@ -128,5 +128,5 @@ wechat:
       serialNum: 61A33563F6158C1B921A27A23A4E94E963DD53DD
 #图片上传地址
 image:
-  url: https://chtech.ncjti.edu.cn/hotel/image/
+  url: https://chtech.ncjti.edu.cn/hotel
   path: /usr/local/nginx/html/image

+ 1 - 1
src/main/resources/application-prod.yml

@@ -112,5 +112,5 @@ wechat:
       domain: http://73j8db.natappfree.cc  #回调地址
 #图片上传地址
 image:
-  url: https://chtech.ncjti.edu.cn/hotel/image/
+  url: https://chtech.ncjti.edu.cn/hotel
   path: /usr/local/nginx/html/image

+ 1 - 1
src/main/resources/application-test.yml

@@ -133,5 +133,5 @@ wechat:
       serialNum: 61A33563F6158C1B921A27A23A4E94E963DD53DD
 #图片上传地址
 image:
-  url: https://chtech.ncjti.edu.cn/testingServer/image/
+  url: https://chtech.ncjti.edu.cn/testingServer
   path: /home/nginx/html/image

+ 1 - 1
src/main/resources/application.yml

@@ -125,5 +125,5 @@ wechat:
       serialNum: 61A33563F6158C1B921A27A23A4E94E963DD53DD
 #图片上传地址
 image:
-  url: https://chtech.ncjti.edu.cn/hotel/image/
+  url: https://chtech.ncjti.edu.cn/hotel
   path: /usr/local/nginx/html/image