mirror of https://gitee.com/stylefeng/roses
【file】更新用户头像预览
parent
88377c28d4
commit
831525b71f
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染被预览的文件到servlet的response流中
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
||||
/**
|
||||
* 用户选择树数据
|
||||
*
|
||||
|
|
|
@ -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) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue