From 7d85830f3b7b6b9ef4ffece2b7df7d65c9b30fab Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期三, 29 三月 2023 20:15:43 +0800 Subject: [PATCH] 门户跨域 --- src/main/java/com/qxueyou/scc/base/service/impl/FileUploadService.java | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/base/service/impl/FileUploadService.java b/src/main/java/com/qxueyou/scc/base/service/impl/FileUploadService.java index 6a767a0..9df5e10 100644 --- a/src/main/java/com/qxueyou/scc/base/service/impl/FileUploadService.java +++ b/src/main/java/com/qxueyou/scc/base/service/impl/FileUploadService.java @@ -25,7 +25,7 @@ /** - * 所有文件上传的操作,单独到文件上传工程后,后续业务操作需要下载文件调用的方法 + * 鎵�鏈夋枃浠朵笂浼犵殑鎿嶄綔锛屽崟鐙埌鏂囦欢涓婁紶宸ョ▼鍚庯紝鍚庣画涓氬姟鎿嶄綔闇�瑕佷笅杞芥枃浠惰皟鐢ㄧ殑鏂规硶 * @author ody.yuan * */ @@ -53,7 +53,7 @@ file = ossService.getObject(key, directory); return file; }catch( Exception e ){ - log.error(userId + "失败:OSS下载路径:" + key + " ;应用服务器路径:" + directory + " ; errMsg=" + e.getMessage() , e ); + log.error(userId + "澶辫触锛歄SS涓嬭浇璺緞锛�" + key + " ;搴旂敤鏈嶅姟鍣ㄨ矾寰勶細" + directory + " ; errMsg=" + e.getMessage() , e ); return file ; } @@ -66,7 +66,7 @@ file = ossVideoService.getObject(key, directory); return file; }catch( Exception e ){ - log.error(userId + "失败:OSSVideo下载路径:" + key + " ;应用服务器路径:" + directory + " ; errMsg=" + e.getMessage() , e ); + log.error(userId + "澶辫触锛歄SSVideo涓嬭浇璺緞锛�" + key + " ;搴旂敤鏈嶅姟鍣ㄨ矾寰勶細" + directory + " ; errMsg=" + e.getMessage() , e ); return file ; } @@ -78,7 +78,7 @@ Boolean result = FileUtils.deleteQuietly(new File(directory)); if( result ){ - this.insertUploadLog(userId,"成功删除:OSS-OSSVideo0:" + directory , module ); + this.insertUploadLog(userId,"鎴愬姛鍒犻櫎锛歄SS-OSSVideo0锛�" + directory , module ); return new Result(true); }else{ return new Result(false); @@ -91,11 +91,11 @@ Boolean result = FileUtils.deleteQuietly(file); if( result ){ - this.insertUploadLog(userId,"成功删除:OSS-OSSVideo1:" + file.getAbsolutePath() , module ); + this.insertUploadLog(userId,"鎴愬姛鍒犻櫎锛歄SS-OSSVideo1锛�" + file.getAbsolutePath() , module ); return new Result(true); }else{ - log.error(userId + "失败:OSS-OSSVideo删除本地文件1:" + file.getAbsolutePath() ); - this.insertUploadLog(userId,"失败删除:OSS-OSSVideo1:" + file.getAbsolutePath() , module ); + log.error(userId + "澶辫触锛歄SS-OSSVideo鍒犻櫎鏈湴鏂囦欢1:" + file.getAbsolutePath() ); + this.insertUploadLog(userId,"澶辫触鍒犻櫎锛歄SS-OSSVideo1锛�" + file.getAbsolutePath() , module ); return new Result(false); } @@ -103,9 +103,9 @@ } /** - * 插入本地文件下载日志 - * @param content 内容 - * @param desp 上传模块 + * 鎻掑叆鏈湴鏂囦欢涓嬭浇鏃ュ織 + * @param content 鍐呭 + * @param desp 涓婁紶妯″潡 * @return */ private Result insertUploadLog(String userId ,String content, String desp ){ @@ -126,11 +126,11 @@ } /** - * 更新上传文件使用轨迹 - * @param fullPath 路径 + * 鏇存柊涓婁紶鏂囦欢浣跨敤杞ㄨ抗 + * @param fullPath 璺緞 * @param module - * @param useFlag 使用状态 - * @param bussinessId 业务ID + * @param useFlag 浣跨敤鐘舵�� + * @param bussinessId 涓氬姟ID * @return */ public Result updateUploadTrace(String fullPath,String module,int useFlag,String bussinessId){ @@ -147,7 +147,7 @@ } /** - * 通过路径下载微信图像到服务器 + * 閫氳繃璺緞涓嬭浇寰俊鍥惧儚鍒版湇鍔″櫒 * @return */ @SuppressWarnings("unused") @@ -161,7 +161,7 @@ HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setRequestMethod("GET"); conn.setConnectTimeout(5 * 1000); - InputStream inStream = conn.getInputStream();//通过输入流获取图片数据 + InputStream inStream = conn.getInputStream();//閫氳繃杈撳叆娴佽幏鍙栧浘鐗囨暟鎹� String uuid = UUIDUtils.generateUUID(); String imgPath = "/web/res/img/user/"+uuid+"/" + openId + ".png"; // Result result = ossService.uplpadImage(inStream, "png", imgPath); @@ -171,7 +171,7 @@ // } } catch (Exception e) { e.printStackTrace(); - log.error("微信头像上传失败" + e); + log.error("寰俊澶村儚涓婁紶澶辫触" + e); } return null; -- Gitblit v1.8.0