【file】更新用户头像预览

pull/3/head
fengshuonan 2021-02-02 20:31:37 +08:00
parent 88377c28d4
commit 831525b71f
4 changed files with 37 additions and 1 deletions

View File

@ -30,4 +30,15 @@ public interface FileInfoApi {
*/
String getFileAuthUrl(Long fileId);
/**
*
*
* @param fileId id
* @param token token
* @return 访url
* @author fengshuonan
* @date 2020/10/26 10:40
*/
String getFileAuthUrl(Long fileId, String token);
}

View File

@ -372,6 +372,15 @@ public class SysFileInfoServiceImpl extends ServiceImpl<SysFileInfoMapper, SysFi
return FileConfigExpander.getServerDeployHost() + contextPath + FileConstants.FILE_PRIVATE_PREVIEW_URL + "?fileId=" + fileId + "&token=" + token;
}
@Override
public String getFileAuthUrl(Long fileId, String token) {
// 获取context-path
String contextPath = HttpServletUtil.getRequest().getContextPath();
return FileConfigExpander.getServerDeployHost() + contextPath + FileConstants.FILE_PRIVATE_PREVIEW_URL + "?fileId=" + fileId + "&token=" + token;
}
/**
* servletresponse
*

View File

@ -2,7 +2,6 @@ package cn.stylefeng.roses.kernel.system.modular.user.service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
import cn.stylefeng.roses.kernel.rule.pojo.tree.DefaultTreeNode;
import cn.stylefeng.roses.kernel.rule.pojo.tree.UserSelectTreeNode;
import cn.stylefeng.roses.kernel.system.UserServiceApi;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser;
@ -180,6 +179,16 @@ public interface SysUserService extends IService<SysUser>, UserServiceApi {
*/
String getUserAvatarUrl(Long fileId);
/**
* url
*
* @param fileId id
* @param token token
* @author fengshuonan
* @date 2020/12/27 19:13
*/
String getUserAvatarUrl(Long fileId, String token);
/**
*
*

View File

@ -418,6 +418,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return fileInfoApi.getFileAuthUrl(fileId);
}
@Override
public String getUserAvatarUrl(Long fileId, String token) {
// 获取头像的访问地址
return fileInfoApi.getFileAuthUrl(fileId, token);
}
@Override
public UserLoginInfoDTO getUserLoginInfo(String account) {