|
@@ -3,6 +3,7 @@ package com.jeeplus.modules.sys.service;
|
|
|
|
|
|
import com.easemob.server.example.api.impl.EasemobIMUsers;
|
|
|
import com.google.common.base.Strings;
|
|
|
+import com.jeeplus.common.bos.BOSClientUtil;
|
|
|
import com.jeeplus.common.config.Global;
|
|
|
import com.jeeplus.common.oss.OSSClientUtil;
|
|
|
import com.jeeplus.common.utils.DateUtils;
|
|
@@ -208,14 +209,17 @@ public class UserService extends BaseController {
|
|
|
inputStream = httpURLConnection.getInputStream();
|
|
|
|
|
|
}
|
|
|
- OSSClientUtil ossUtil =new OSSClientUtil();
|
|
|
- String[] arr = temp.split("/");
|
|
|
- String photoName = System.currentTimeMillis()+arr[arr.length-1];
|
|
|
- ossUtil.uploadFile2OSS(inputStream, Global.getPhoto(), photoName);
|
|
|
- user.setPhoto(Global.getAliyunUrl()+"/"+ Global.getPhoto() + photoName);
|
|
|
+ String path = new StringBuilder("/headImg/")
|
|
|
+ .append(userName+System.currentTimeMillis()).toString();
|
|
|
+ BOSClientUtil bosClientUtil = new BOSClientUtil();
|
|
|
+ String uploadPath = bosClientUtil.upload(path, inputStream);
|
|
|
+ user.setPhoto(uploadPath);
|
|
|
+// OSSClientUtil ossUtil =new OSSClientUtil();
|
|
|
+// String[] arr = temp.split("/");
|
|
|
+// String photoName = System.currentTimeMillis()+arr[arr.length-1];
|
|
|
+// ossUtil.uploadFile2OSS(inputStream, Global.getPhoto(), photoName);
|
|
|
+// user.setPhoto(Global.getAliyunUrl()+"/"+ Global.getPhoto() + photoName);
|
|
|
FileUtils.delFile(Global.getUserfilesBaseDir() + Global.USERFILES_BASE_URL +time);
|
|
|
- } catch (MalformedURLException e) {
|
|
|
- e.printStackTrace();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|