mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8542ca2afc | ||
|
|
5feabe5bf3 | ||
|
|
10cafd8add | ||
|
|
e528b75c76 | ||
|
|
9d8827032e | ||
|
|
a190bc5077 | ||
|
|
6083ae97a3 |
@@ -24,16 +24,16 @@
|
||||
Core版:`本地`,`阿里OSS`,`又拍USS`,`七牛KODO`,`腾讯COS`,`网易NOS`,~~`U-File`~~,`FTP`,`Backblaze(B2)`,`百度云BOS`,`青云Qingstor`,`Ucloud US3`,`Minio`,`AWS S3`
|
||||
|
||||
|
||||
### 更新日志 `20220328`
|
||||
- **修复** 修复部分情况下开启图像查重后,出现上传失败的问题
|
||||
- **修复** 部分场景下操作图片时出现的异常错误
|
||||
- **优化** 多个页面显示
|
||||
### 更新日志 `20220407`
|
||||
- **修复** 修复了用户数据量较大时进行操作的一些异常表现
|
||||
- **提高** 系统稳定性
|
||||
- **优化** 页面显示
|
||||
|
||||
### 引导
|
||||
|
||||
程序宣传视频:[自制宣传视频](https://www.bilibili.com/video/BV11r4y1y7mH/)
|
||||
[官网](https://tbed.hellohao.cn) | [宣传视频](https://www.bilibili.com/video/BV11r4y1y7mH/) | [文档](http://doc.wwery.com) | [演示站](http://tc.wwery.com)
|
||||
|
||||
开源版编译包下载: [下载开源版程序包](https://github.com/Hello-hao/Tbed/releases/)
|
||||
[^_^]:程序宣传视频:[自制宣传视频](https://www.bilibili.com/video/BV11r4y1y7mH/)
|
||||
|
||||
[^_^]:官网(含Core版):[https://tbed.hellohao.cn](https://tbed.hellohao.cn)
|
||||
|
||||
@@ -45,15 +45,12 @@ Core版:`本地`,`阿里OSS`,`又拍USS`,`七牛KODO`,`腾讯COS`,`网易NOS`,
|
||||
|
||||
[^_^]:作者博客:[https://www.hellohao.cn](https://www.hellohao.cn)
|
||||
|
||||
域名`hellohao.cn`目前正在转移备案,请使用一下备用地址进行访问
|
||||
|
||||
--- **备用地址** ---
|
||||
[^_^]:官网(含Core版)(备用):[http://tbed.wwery.com](http://tbed.wwery.com)
|
||||
|
||||
官网(含Core版)(备用):[http://tbed.wwery.com](http://tbed.wwery.com)
|
||||
[^_^]:文档地址(备用):[http://doc.wwery.com](http://doc.wwery.com)
|
||||
|
||||
文档地址(备用):[http://doc.wwery.com](http://doc.wwery.com)
|
||||
|
||||
程序展示(备用):[http://tc.wwery.com](http://tc.wwery.com)
|
||||
[^_^]:程序展示(备用):[http://tc.wwery.com](http://tc.wwery.com)
|
||||
|
||||
[^_^]:作者博客(备用):[http://www.wwery.com](http://www.wwery.com)
|
||||
|
||||
@@ -62,41 +59,41 @@ Core版:`本地`,`阿里OSS`,`又拍USS`,`七牛KODO`,`腾讯COS`,`网易NOS`,
|
||||
|
||||
### 主要功能
|
||||
|
||||
- 前后端分离式架构设计,部署更方便
|
||||
- [x] 前后端分离式架构设计,部署更方便
|
||||
|
||||
- 个人相册浏览,图像详细资料展示卡片
|
||||
- [x] 个人相册浏览,图像详细资料展示卡片
|
||||
|
||||
- 支持 图片拖拽、截图直接(Ctrl+V)
|
||||
- [x] 支持 图片拖拽、截图直接(Ctrl+V)
|
||||
|
||||
- 支持URL地址批量上传
|
||||
- [x] 支持URL地址批量上传
|
||||
|
||||
- 一键复制嵌入式链接代码,也可以自定义嵌入式代码格式
|
||||
- [x] 一键复制嵌入式链接代码,也可以自定义嵌入式代码格式
|
||||
|
||||
- 对接邮箱服务,注册/找回密码等功能
|
||||
- [x] 对接邮箱服务,注册/找回密码等功能
|
||||
|
||||
- 违规图像实时多线程鉴别
|
||||
- [x] 违规图像实时多线程鉴别
|
||||
|
||||
- 图片定期暂存
|
||||
- [x] 图片定期暂存
|
||||
|
||||
- 支持多种图像格式如:`jfif`,`webp`,`ico`,`svg`等
|
||||
- [x] 支持多种图像格式如:`jfif`,`webp`,`ico`,`svg`等
|
||||
|
||||
- 支持画廊批量分享模式
|
||||
- [x] 支持画廊批量分享模式
|
||||
|
||||
- 账户图像查重上传
|
||||
- [x] 账户图像查重上传
|
||||
|
||||
- 配置IP黑名单操作
|
||||
- [x] 配置IP黑名单操作
|
||||
|
||||
- 站点上传可控API接口
|
||||
- [x] 站点上传可控API接口
|
||||
|
||||
- 设置用户可用容量
|
||||
- [x] 设置用户可用容量
|
||||
|
||||
- 账户扩容码批量生成
|
||||
- [x] 账户扩容码批量生成
|
||||
|
||||
- 细致的上传分发配置,分发群组功能
|
||||
- [x] 细致的上传分发配置,分发群组功能
|
||||
|
||||
- 游客、用户的上传管理
|
||||
- [x] 游客、用户的上传管理
|
||||
|
||||
- 图像直链二维码生成
|
||||
- [x] 图像直链二维码生成
|
||||
|
||||
|
||||
|
||||
@@ -151,13 +148,13 @@ Core版:`本地`,`阿里OSS`,`又拍USS`,`七牛KODO`,`腾讯COS`,`网易NOS`,
|
||||
> 2.自定义部署 前后端分离式部署:`Tbed.zip`(拓展性高适合有一定java前后端分离部署经验的人)
|
||||
> 需要注意:一键部署的端口为:服务器:`10088` 前端:`10089`
|
||||
|
||||
详细部署教程参考程序文档:[开源版部署教程](http://doc.hellohao.cn/#/opensource)
|
||||
详细部署教程参考程序[相关文档](http://doc.hellohao.cn)
|
||||
|
||||
### 启动项目
|
||||
|
||||
初始用户名:`admin`
|
||||
初始邮箱:`admin`
|
||||
初始密码`admin`
|
||||
初始密码:`admin`
|
||||
|
||||
### 微信小程序
|
||||
> 目前已有测试版,更多功能开发中,开发进度的快慢要根据作者的工作压力、心情状况等自身情况进行评估。
|
||||
@@ -175,8 +172,7 @@ Core版:`本地`,`阿里OSS`,`又拍USS`,`七牛KODO`,`腾讯COS`,`网易NOS`,
|
||||
|
||||
### 反馈交流
|
||||
|
||||
**如果你遇到BUG可以去我的博客反馈**
|
||||
Hellohao博客: [http://www.hellohao.cn/](http://www.hellohao.cn/)
|
||||
**如果你遇到BUG欢迎反馈**
|
||||
|
||||
欢迎加入Hellohao开发者交流群,群聊号码:**864800972**
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ public class AdminController {
|
||||
Keys key = keysService.selectKeys(keyid);
|
||||
|
||||
if(!subject.hasRole("admin")){
|
||||
if(image.getUserid()!=user.getId()){
|
||||
if(!image.getUserid().equals(user.getId())){
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -473,7 +473,7 @@ public class AdminController {
|
||||
try {
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(imgid);
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
imgAndAlbumService.deleteImgAndAlbum(image.getImgurl());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setInfo("图片记录删除失败,请重试");
|
||||
@@ -484,7 +484,7 @@ public class AdminController {
|
||||
}else{
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(imgid);
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
imgAndAlbumService.deleteImgAndAlbum(image.getImgurl());
|
||||
msg.setInfo("图片记录已删除,但是图片源删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,38 @@ public class AlbumController {
|
||||
|
||||
}
|
||||
|
||||
//后台列表要修改时的查询表单
|
||||
@PostMapping("/admin/getAlbumListForKey") //new
|
||||
@ResponseBody
|
||||
public Msg getAlbumListForKey(@RequestParam(value = "data", defaultValue = "") String data){
|
||||
Msg msg = new Msg();
|
||||
try{
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
String key = jsonObject.getString("key");
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User user = (User) subject.getPrincipal();
|
||||
Album album = new Album();
|
||||
album.setAlbumkey(key);
|
||||
if(subject.hasRole("admin")){
|
||||
album.setUserid(null);
|
||||
}else{
|
||||
album.setUserid(user.getId());
|
||||
}
|
||||
JSONObject jsonObj = new JSONObject();
|
||||
Album album1 = albumServiceImpl.selectAlbum(album);
|
||||
List<Images> imagesList = imgAndAlbumService.selectImgForAlbumkey(key);
|
||||
jsonObj.put("album",album1);
|
||||
jsonObj.put("imagesList",imagesList);
|
||||
msg.setData(jsonObj);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
msg.setCode("500");
|
||||
msg.setInfo("获取画廊数据错误");
|
||||
}
|
||||
return msg;
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/getAlbumImgList") //new
|
||||
@ResponseBody
|
||||
public Msg getAlbumImgList(@RequestParam("data") String data) {
|
||||
@@ -136,7 +168,7 @@ public class AlbumController {
|
||||
}
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User u = (User) subject.getPrincipal();
|
||||
String uuid = "TOALBUM"+ UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0,5)+"N";
|
||||
String uuid = "TOALBUM"+ UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0,7)+"N";
|
||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Album album = new Album();
|
||||
album.setAlbumtitle(albumtitle);
|
||||
@@ -173,6 +205,65 @@ public class AlbumController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/admin/UpdateForAlbum")//new
|
||||
@ResponseBody
|
||||
public Msg UpdateForAlbum(@RequestParam(value = "data", defaultValue = "") String data){
|
||||
data = StringEscapeUtils.unescapeHtml4(data);
|
||||
Msg msg = new Msg();
|
||||
try {
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
String albumkey = jsonObject.getString("albumkey");
|
||||
String albumtitle = jsonObject.getString("albumtitle");
|
||||
String password = jsonObject.getString("password");
|
||||
JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("albumlist"));
|
||||
if(null!=password){
|
||||
// String regex = "^[a-z0-9A-Z\u4e00-\u9fa5]+$";
|
||||
// return str.matches(regex);
|
||||
password = password.replace(" ", "");
|
||||
if(password.replace(" ", "").equals("") || password.length()<3){
|
||||
msg.setCode("110403");
|
||||
msg.setInfo("密码长度不得小于三位有效字符");
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
if(albumtitle==null || jsonArray.size()==0){
|
||||
msg.setCode("110404");
|
||||
msg.setInfo("标题和图片参数不能为空");
|
||||
return msg;
|
||||
}
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User u = (User) subject.getPrincipal();
|
||||
Album album = new Album();
|
||||
album.setAlbumtitle(albumtitle);
|
||||
album.setPassword(password);
|
||||
album.setAlbumkey(albumkey);
|
||||
|
||||
albumServiceImpl.updateAlbum(album);
|
||||
imgAndAlbumService.deleteImgAndAlbumForKey(albumkey);
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject img = jsonArray.getJSONObject(i);
|
||||
ImgAndAlbum imgAndAlbum = new ImgAndAlbum();
|
||||
imgAndAlbum.setImgname(img.getString("imgurl"));
|
||||
imgAndAlbum.setAlbumkey(albumkey);
|
||||
imgAndAlbum.setNotes(img.getString("notes"));
|
||||
albumServiceImpl.addAlbumForImgAndAlbumMapper(imgAndAlbum);
|
||||
}
|
||||
final JSONObject json = new JSONObject();
|
||||
json.put("url",albumkey);
|
||||
json.put("title",albumtitle);
|
||||
json.put("password",password);
|
||||
msg.setCode("200");
|
||||
msg.setInfo("画廊修改成功");
|
||||
msg.setData(json);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
msg.setCode("500");
|
||||
msg.setInfo("修改画廊失败");
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/checkPass")//new
|
||||
@ResponseBody
|
||||
public Msg checkPass(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
|
||||
@@ -267,7 +267,7 @@ public class IndexController {
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User user = (User) subject.getPrincipal();
|
||||
if(null!=user){
|
||||
if(user.getId()!=image.getUserid()){
|
||||
if(!user.getId().equals(image.getUserid())){
|
||||
msg.setInfo("删除失败,该图片不允许你执行操作");
|
||||
msg.setCode("100403");
|
||||
return msg;
|
||||
@@ -300,7 +300,7 @@ public class IndexController {
|
||||
//删除库
|
||||
if(isDele){
|
||||
try {
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
imgAndAlbumService.deleteImgAndAlbum(image.getImgurl());
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(image.getId());
|
||||
} catch (Exception e) {
|
||||
@@ -311,7 +311,7 @@ public class IndexController {
|
||||
}
|
||||
msg.setInfo("删除成功");
|
||||
}else{
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
imgAndAlbumService.deleteImgAndAlbum(image.getImgurl());
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(image.getId());
|
||||
msg.setInfo("图片记录已删除,但是图片源删除失败");
|
||||
|
||||
@@ -23,4 +23,6 @@ public interface AlbumMapper {
|
||||
List<Album> selectAlbumURLList(Album album);
|
||||
|
||||
Integer selectAlbumCount(@Param("userid") Integer userid);
|
||||
|
||||
Integer updateAlbum(Album album);
|
||||
}
|
||||
|
||||
@@ -26,4 +26,6 @@ public interface AlbumService {
|
||||
List<Album> selectAlbumURLList(Album album);
|
||||
|
||||
Integer selectAlbumCount(Integer userid);
|
||||
|
||||
Integer updateAlbum(Album album);
|
||||
}
|
||||
|
||||
@@ -84,6 +84,11 @@ public class AlbumServiceImpl implements AlbumService {
|
||||
return albumMapper.selectAlbumCount(userid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateAlbum(Album album) {
|
||||
return albumMapper.updateAlbum(album);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Integer delete(String albumkey) {
|
||||
Integer ret1 = albumMapper.deleteAlbum(albumkey);
|
||||
@@ -108,4 +113,6 @@ public class AlbumServiceImpl implements AlbumService {
|
||||
}
|
||||
return ret1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ public class GroupServiceImpl implements GroupService {
|
||||
if(group.getUsertype()!=0){
|
||||
Group groupFroUserType = groupMapper.getGroupFroUserType(group.getUsertype());
|
||||
if(groupFroUserType!=null){
|
||||
if(groupFroUserType.getUsertype()==group.getUsertype()){
|
||||
if(groupFroUserType.getId()==group.getId()){
|
||||
if(groupFroUserType.getUsertype().equals(group.getUsertype())){
|
||||
if(groupFroUserType.getId().equals(group.getId())){
|
||||
groupMapper.setgroup(group);
|
||||
msg.setInfo("修改成功");
|
||||
}else{
|
||||
|
||||
@@ -257,11 +257,11 @@ public class UploadServicel {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static Group group; //上传用户或游客的所属分组
|
||||
public static Long memory;//上传用户或者游客的分配容量 memory
|
||||
public static Long TotleMemory;//用户或者游客下可使用的总容量 //maxsize
|
||||
public static Long UsedTotleMemory;//用户或者游客已经用掉的总容量 //usermemory
|
||||
public static String updatePath="tourist";
|
||||
private static Group group; //上传用户或游客的所属分组
|
||||
private static Long memory;//上传用户或者游客的分配容量 memory
|
||||
private static Long TotleMemory;//用户或者游客下可使用的总容量 //maxsize
|
||||
private static Long UsedTotleMemory;//用户或者游客已经用掉的总容量 //usermemory
|
||||
private static String updatePath="tourist";
|
||||
|
||||
//判断用户 或 游客 当前上传图片的一系列校验
|
||||
private Msg updateImgCheck(User user, UploadConfig uploadConfig){
|
||||
@@ -276,6 +276,7 @@ public class UploadServicel {
|
||||
msg.setInfo("系统已禁用游客上传");
|
||||
return msg;
|
||||
}
|
||||
updatePath="tourist";
|
||||
group = GetCurrentSource.GetSource(null);
|
||||
memory = Long.valueOf(uploadConfig.getVisitormemory());//单位 B 游客设置总量
|
||||
TotleMemory = Long.valueOf(uploadConfig.getFilesizetourists());//单位 B 游客单文件大小
|
||||
|
||||
@@ -63,5 +63,18 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateAlbum" parameterType="cn.hellohao.pojo.Album">
|
||||
UPDATE `album`
|
||||
<set>
|
||||
<if test="albumtitle != null">
|
||||
albumtitle = #{albumtitle},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password},
|
||||
</if>
|
||||
</set>
|
||||
WHERE
|
||||
albumkey = #{albumkey}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user