From 937daff0ebc1aa16a852d5a86434ab1994d8a02d Mon Sep 17 00:00:00 2001
From: 胡仁荣 <897853850@qq.com>
Date: 星期一, 11 九月 2023 10:41:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/main/java/com/qxueyou/scc/sys/action/LoginController.java                   |   16 +++++++---------
 src/main/java/com/qxueyou/scc/teach/res/service/impl/HweiYunOBSServiceImpl.java |   13 +++++++------
 src/main/java/com/qxueyou/scc/controller/HweiYunOBSController.java              |    1 +
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/qxueyou/scc/controller/HweiYunOBSController.java b/src/main/java/com/qxueyou/scc/controller/HweiYunOBSController.java
index d076b5e..6a33973 100644
--- a/src/main/java/com/qxueyou/scc/controller/HweiYunOBSController.java
+++ b/src/main/java/com/qxueyou/scc/controller/HweiYunOBSController.java
@@ -41,6 +41,7 @@
  * @Version: 1.0
  */
 @RestController
+@CrossOrigin
 @RequestMapping("/file")// @RequestMapping("/file")
 public class HweiYunOBSController {
     private final Logger log = LogManager.getLogger("FileController");
diff --git a/src/main/java/com/qxueyou/scc/sys/action/LoginController.java b/src/main/java/com/qxueyou/scc/sys/action/LoginController.java
index ad3a838..de0c8ba 100644
--- a/src/main/java/com/qxueyou/scc/sys/action/LoginController.java
+++ b/src/main/java/com/qxueyou/scc/sys/action/LoginController.java
@@ -439,8 +439,6 @@
         // 鏌ヨ鐢ㄦ埛淇℃伅
         User user = commonDAO.findUnique(hql,params, User.class);
 
-		System.out.println(user);
-
     	if(uuNumber!=null&&!"".equals(uuNumber)&&!"null".equals(uuNumber)){
     		//褰曟垚鍔熷瓨鍏ser閲岋紝鍒犻櫎session閲岀殑uuNumber锛屼笅涓汉鏃犳硶浣跨敤
 			user.setEmail(uuNumber);
@@ -462,7 +460,7 @@
 		//姣旇緝鐢ㄦ埛杈撳叆鐨勫瘑鐮佸姞瀵嗗悗鐨勫瓧绗︿覆鏄惁璺熸敞鍐屾椂濉啓鐨勫姞瀵嗗瘑鐮佺浉鍚�
 		if("study".equals(logType) || "portal".equals(logType) || "adminis".equals(logType)){
 			if (!newPassword.equals(user.getPassword())) {
-				return new Result(false, "瀵嗙爜閿欒");
+				return new Result(false, "鐢ㄦ埛璐︽埛銆佸瘑鐮侀敊璇垨缂哄皯鍑瘉");
 			}
 		}
 
@@ -568,12 +566,12 @@
      * @param account 璐︽埛
      * @return
      */
-//	@ApiOperation(value = "閫�鍑哄悗鍙扮郴缁熸搷浣�", notes = "")
-//    @RequestMapping(value = "out", method = RequestMethod.GET)
-//    public String release(HttpServletRequest httpRequest, HttpServletResponse response) {
-//        doRelease(httpRequest, response);
-//        return "閫�鍑烘垚鍔�";
-//    }
+	@ApiOperation(value = "閫�鍑哄悗鍙扮郴缁熸搷浣�", notes = "")
+    @RequestMapping(value = "release", method = RequestMethod.GET)
+    public String release(HttpServletRequest httpRequest, HttpServletResponse response) {
+        doRelease(httpRequest, response);
+        return "redirect:/web/admin/index.html#login";
+    }
 
     /**
      * 鍚庡彴锛氶��鍑哄綍,鍚庡彴绯荤粺
diff --git a/src/main/java/com/qxueyou/scc/teach/res/service/impl/HweiYunOBSServiceImpl.java b/src/main/java/com/qxueyou/scc/teach/res/service/impl/HweiYunOBSServiceImpl.java
index 8964cf2..4ddf1e5 100644
--- a/src/main/java/com/qxueyou/scc/teach/res/service/impl/HweiYunOBSServiceImpl.java
+++ b/src/main/java/com/qxueyou/scc/teach/res/service/impl/HweiYunOBSServiceImpl.java
@@ -5,6 +5,7 @@
 import com.obs.services.ObsClient;
 import com.obs.services.exception.ObsException;
 import com.obs.services.model.*;
+import com.qxueyou.scc.base.model.CacheConstants;
 import com.qxueyou.scc.base.model.FileMeta;
 import com.qxueyou.scc.base.model.Result;
 import com.qxueyou.scc.base.service.ICacheService;
@@ -128,7 +129,8 @@
         List<FileMeta> files = new ArrayList<FileMeta>(2);
         FileMeta fileMeta = null;
         try {
-            String destPath = getDestPath(objectKey);
+            System.out.println(objectKey);
+//            String destPath = getDestPath(objectKey);
             String bucketName = hweiOBSConfig.getBucketName();
             obsClient = hweiOBSConfig.getInstance();
 
@@ -142,7 +144,7 @@
             }
             InputStream inputStream = uploadFile.getInputStream();
             long available = inputStream.available();
-            PutObjectRequest request = new PutObjectRequest(bucketName,destPath,inputStream);
+            PutObjectRequest request = new PutObjectRequest(bucketName,objectKey,inputStream);
             ObjectMetadata objectMetadata = new ObjectMetadata();
             objectMetadata.setContentLength(available);
             request.setMetadata(objectMetadata);
@@ -416,8 +418,7 @@
 
     @Override
     public Result initUploadChunk(String uniqueId, String fileName, String md5) {
-        String path = getDestPath(fileName);
-        String key = chopPath(path);
+        String key = chopPath(fileName);
 
         //娓呯紦瀛�
         cache.template().delete(uniqueId + ClientUtils.getUserId());
@@ -434,12 +435,12 @@
 
         //涓洪厤鍚堝垎鐗囦笂浼狅紝鍚庡彴鍏堟柊寤烘枃浠惰褰�
 
-        ResFile file = newFileToDB(fileName, path, getFileType(fileName), 0l, md5);
+        ResFile file = newFileToDB(fileName, fileName, getFileType(fileName), 0l, md5);
 
         //娣诲姞鍒扮紦瀛�
         cache.template().opsForHash().put(uniqueId + ClientUtils.getUserId(), "uploadId", uploadId);
         cache.template().opsForHash().put(uniqueId + ClientUtils.getUserId(), "key", key);
-        cache.template().opsForHash().put(uniqueId + ClientUtils.getUserId(), "path", path);
+        cache.template().opsForHash().put(uniqueId + ClientUtils.getUserId(), "path", fileName);
         cache.template().opsForHash().put(uniqueId + ClientUtils.getUserId(), "fileId", file.getFileId());
 
         //闃叉浜х敓杩囧缂撳瓨鍨冨溇

--
Gitblit v1.8.0