6-17更新 新增又拍云存储

This commit is contained in:
Hellohao
2019-06-17 19:39:53 +08:00
parent 39e7375762
commit b0818c2080
30 changed files with 7418 additions and 286 deletions
+6
View File
@@ -64,6 +64,12 @@
<artifactId>java-sdk</artifactId>
<version>4.11.0</version>
</dependency>
<!-- 又拍云-->
<dependency>
<groupId>com.upyun</groupId>
<artifactId>java-sdk</artifactId>
<version>4.1.2</version>
</dependency>
<!-- 定时器依赖-->
<dependency>
@@ -4,7 +4,6 @@ import cn.hellohao.pojo.*;
import cn.hellohao.pojo.vo.PageResultBean;
import cn.hellohao.service.*;
import cn.hellohao.service.impl.ImgServiceImpl;
import cn.hellohao.utils.StringUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -14,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
@@ -35,31 +33,30 @@ public class AdminController {
private ImgreviewService imgreviewService;
@Autowired
private ConfigService configService;
@Autowired
private EmailConfigService emailConfigService;
@Autowired
private UploadConfigService updateConfigService;
@RequestMapping(value = "/goadmin")
public String goadmin1(HttpSession session, Model model, HttpServletRequest request) {
User user = (User) session.getAttribute("user");
if (user.getLevel() == 1) {
model.addAttribute("level", "普通用户");
} else if (user.getLevel() == 2) {
model.addAttribute("level", "管理员");
} else {
model.addAttribute("level", "未 知");
if(user!=null){
if (user.getLevel() == 1) {
model.addAttribute("level", "普通用户");
} else if (user.getLevel() == 2) {
model.addAttribute("level", "管理员");
} else {
model.addAttribute("level", "未 知");
}
model.addAttribute("levels", user.getLevel());
model.addAttribute("username", user.getUsername());
return "admin/index";
}else{
return "redirect:/";
}
model.addAttribute("levels", user.getLevel());
model.addAttribute("username", user.getUsername());
return "admin/index";
}
// 进入后台页面
@RequestMapping(value = "/admin")
public String goadmin(HttpSession session, Model model, HttpServletRequest request) {
public String goadmin(HttpSession session, Model model) {
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
Keys key = keysService.selectKeys(config.getSourcekey());
User u = (User) session.getAttribute("user");
@@ -70,25 +67,48 @@ public class AdminController {
// } else {
// //个人用户
// //model.addAttribute("counts", imgService.countimg(u.getId()));//这个是根据用户id查询他的图片数
//
// }
model.addAttribute("usercount", imgService.countimg(u.getId()));//这个是根据用户id查询他的图片数
model.addAttribute("counts", imgService.counts(null) );//总
model.addAttribute("getUserTotal", userService.getUserTotal() );
model.addAttribute("imgreviewcount", imgreview.getCount());
//model.addAttribute("usercount", imgService.countimg(u.getId()));//这个是根据用户id查询他的图片
//model.addAttribute("counts", imgService.counts(null) );//总数
//model.addAttribute("getusertotal", userService.getUserTotal() );
//model.addAttribute("imgreviewcount", imgreview.getCount());
model.addAttribute("username", u.getUsername());
model.addAttribute("level", u.getLevel());
model.addAttribute("email", u.getEmail());
model.addAttribute("loginid", 100);
Boolean b = StringUtils.doNull(key);//判断对象是否有空值
if(b){
model.addAttribute("source", key.getStorageType());
}else{
model.addAttribute("source", 456);
}
// if(b){
// model.addAttribute("source", key.getStorageType());
// }else{
// model.addAttribute("source", 456);
// }
return "admin/table";
}
//获取本站概况
@RequestMapping(value = "/getwebconfig")
@ResponseBody
public String getwebconfig(HttpSession session) {
JSONObject jsonObject = new JSONObject();
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
Keys key = keysService.selectKeys(config.getSourcekey());
User u = (User) session.getAttribute("user");
Imgreview imgreview = imgreviewService.selectByPrimaryKey(1);
jsonObject.put("usercount", imgService.countimg(u.getId()));//这个是根据用户id查询他的图片数
jsonObject.put("counts", imgService.counts(null) );//总数
jsonObject.put("getusertotal", userService.getUserTotal() );
jsonObject.put("imgreviewcount", imgreview.getCount());
Boolean b = StringUtils.doNull(key);//判断对象是否有空值
if(b){
jsonObject.put("source", key.getStorageType());
}else{
jsonObject.put("source", 456);
}
return jsonObject.toString();
}
@RequestMapping(value = "/selecttable")
@ResponseBody
public PageResultBean<Images> selectByFy(HttpSession session, Integer pageNum, Integer pageSize, Integer selecttype) {
@@ -130,11 +150,6 @@ public class AdminController {
}
}
//返回对象存储界面
@RequestMapping(value = "/root/touser")
public String touser() {
return "admin/user";
}
//获取用户信息列表
@RequestMapping(value = "/selectusertable2")
@@ -161,50 +176,6 @@ public class AdminController {
}
}
//返回对象存储界面
@RequestMapping(value = "/root/tostorage")
public String tostorage(HttpSession session, Model model, HttpServletRequest request) {
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
Keys key = keysService.selectKeys(config.getSourcekey());
Boolean b = StringUtils.doNull(key);//判断对象是否有空值
if(b){
//key信息
model.addAttribute("AccessKey", key.getAccessKey());
model.addAttribute("AccessSecret", key.getAccessSecret());
model.addAttribute("Endpoint", key.getEndpoint());
model.addAttribute("Bucketname", key.getBucketname());
model.addAttribute("RequestAddress", key.getRequestAddress());
model.addAttribute("StorageType", config.getSourcekey());
}
return "admin/storageconfig";
}
//根据下拉框选的存储源查询对应的key
@PostMapping("/root/getkey")
@ResponseBody
public String getkey(Integer storageType) {
JSONArray jsonArray = new JSONArray();
Keys key = keysService.selectKeys(storageType);
jsonArray.add(key);
return jsonArray.toString();
}
@PostMapping("/root/updatekey")
@ResponseBody
public String updatekey(Keys key) {
JSONArray jsonArray = new JSONArray();
Config config = new Config();
config.setSourcekey(key.getStorageType());
Integer val = configService.setSourceype(config);
if (val > 0) {
Integer ret = keysService.updateKey(key);
jsonArray.add(ret);
} else {
jsonArray.add(0);
}
return jsonArray.toString();
}
@PostMapping("/deleimg")
@ResponseBody
public String deleimg(HttpSession session, Integer id, Integer sourcekey) {
@@ -221,7 +192,7 @@ public class AdminController {
} else if (key.getStorageType() == 2) {
de.delectOSS(key, images.getImgname());
} else if (key.getStorageType() == 3) {
//初始化腾讯云
de.delectUSS(key, images.getImgname());
} else if (key.getStorageType() == 4) {
//初始化七牛云
} else {
@@ -240,7 +211,6 @@ public class AdminController {
}else{
jsonObject.put("val", 0);
}
return jsonObject.toString();
}
@@ -252,7 +222,6 @@ public class AdminController {
Integer v = 0;
ImgServiceImpl de = new ImgServiceImpl();
User u = (User) session.getAttribute("user");
for (int i = 0; i < ids.length; i++) {
Images images = imgService.selectByPrimaryKey(ids[i]);
Keys key = keysService.selectKeys(images.getSource());
@@ -263,7 +232,7 @@ public class AdminController {
} else if (key.getStorageType() == 2) {
de.delectOSS(key, images.getImgname());
} else if (key.getStorageType() == 3) {
//初始化腾讯云
de.delectUSS(key, images.getImgname());
} else if (key.getStorageType() == 4) {
//初始化七牛云
} else {
@@ -281,28 +250,16 @@ public class AdminController {
}
jsonObject.put("val", v);
jsonObject.put("usercount", imgService.countimg(u.getId()));
jsonObject.put("count", imgService.counts(null) + 1000);
jsonObject.put("count", imgService.counts(null));
return jsonObject.toString();
}
//刪除用戶
@PostMapping("/root/deleuser")
@ResponseBody
public String deleuser(HttpSession session, Integer id) {
JSONArray jsonArray = new JSONArray();
Integer ret = userService.deleuser(id);
jsonArray.add(ret);
return jsonArray.toString();
}
//进入修改密码页面
@RequestMapping(value = "/tosetuser")
public String tosetuser(HttpSession session, Model model, HttpServletRequest request) {
User u = (User) session.getAttribute("user");
//key信息
model.addAttribute("username", u.getUsername());
//
return "admin/setuser";
}
@@ -325,60 +282,6 @@ public class AdminController {
return jsonArray.toString();
}
//跳转邮箱配置页面
@RequestMapping(value = "/root/emailconfig")
public String emailconfig(Model model) {
EmailConfig emailConfig = emailConfigService.getemail();
model.addAttribute("emailConfig",emailConfig);
return "admin/emailconfig";
}
//修改邮箱验证
@PostMapping("/root/updateemail")
@ResponseBody
public Integer updateemail(HttpSession session,String emails, String emailkey, String emailurl, String port, String emailname, Integer using ) {
EmailConfig emailConfig = new EmailConfig();
emailConfig.setEmailname(emailname);
emailConfig.setEmails(emails);
emailConfig.setEmailkey(emailkey);
emailConfig.setEmailurl(emailurl);
emailConfig.setPort(port);
emailConfig.setUsing(using);
Integer ret = emailConfigService.updateemail(emailConfig);
return ret;
}
//跳转系统配置页面
@RequestMapping(value = "/root/towebconfig")
public String towebconfig(Model model) {
Config config = configService.getSourceype();
UploadConfig updateConfig = updateConfigService.getUpdateConfig();
model.addAttribute("config",config);
model.addAttribute("updateConfig",updateConfig);
return "admin/webconfig";
}
//修改站点配置
@PostMapping("/root/updateconfig")
@ResponseBody
public Integer updateconfig(String webname,String explain, String logos,
String footed, String links, String notice,String baidu,String domain ) {
Config config = new Config();
config.setWebname(webname);
config.setExplain(explain);
config.setLogos(logos);
config.setFooted(footed);
config.setLinks(links);
config.setNotice(notice);
config.setBaidu(baidu);
config.setDomain(domain);
Integer ret = configService.setSourceype(config);
return ret;
}
//修改上传配置
@PostMapping("/root/scconfig")
@ResponseBody
public Integer scconfig(UploadConfig updateConfig) {
Integer ret = updateConfigService.setUpdateConfig(updateConfig);
return ret;
}
@GetMapping(value = "/images/{id}")
@ResponseBody
@@ -0,0 +1,150 @@
package cn.hellohao.controller;
import cn.hellohao.pojo.Config;
import cn.hellohao.pojo.EmailConfig;
import cn.hellohao.pojo.Keys;
import cn.hellohao.pojo.UploadConfig;
import cn.hellohao.service.*;
import cn.hellohao.utils.StringUtils;
import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@Controller
@RequestMapping("/admin/root")
public class AdminRootController {
@Autowired
private ConfigService configService;
@Autowired
private KeysService keysService;
@Autowired
private UserService userService;
@Autowired
private EmailConfigService emailConfigService;
@Autowired
private UploadConfigService uploadConfigService;
//返回对象存储界面
@RequestMapping(value = "/touser")
public String touser() {
return "admin/user";
}
//返回对象存储界面
@RequestMapping(value = "tostorage")
public String tostorage(HttpSession session, Model model, HttpServletRequest request) {
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
Keys key = keysService.selectKeys(config.getSourcekey());
Boolean b = StringUtils.doNull(key);//判断对象是否有空值
if(b){
//key信息
model.addAttribute("AccessKey", key.getAccessKey());
model.addAttribute("AccessSecret", key.getAccessSecret());
model.addAttribute("Endpoint", key.getEndpoint());
model.addAttribute("Bucketname", key.getBucketname());
model.addAttribute("RequestAddress", key.getRequestAddress());
model.addAttribute("StorageType", config.getSourcekey());
}
return "admin/storageconfig";
}
//根据下拉框选的存储源查询对应的key
@PostMapping("/getkey")
@ResponseBody
public String getkey(Integer storageType) {
JSONArray jsonArray = new JSONArray();
Keys key = keysService.selectKeys(storageType);
jsonArray.add(key);
return jsonArray.toString();
}
@PostMapping("/updatekey")
@ResponseBody
public String updatekey(Keys key) {
JSONArray jsonArray = new JSONArray();
Config config = new Config();
config.setSourcekey(key.getStorageType());
Integer val = configService.setSourceype(config);
if (val > 0) {
Integer ret = keysService.updateKey(key);
jsonArray.add(ret);
} else {
jsonArray.add(0);
}
return jsonArray.toString();
}
//刪除用戶
@PostMapping("/deleuser")
@ResponseBody
public String deleuser(HttpSession session, Integer id) {
JSONArray jsonArray = new JSONArray();
Integer ret = userService.deleuser(id);
jsonArray.add(ret);
return jsonArray.toString();
}
//跳转邮箱配置页面
@RequestMapping(value = "/emailconfig")
public String emailconfig(Model model) {
EmailConfig emailConfig = emailConfigService.getemail();
model.addAttribute("emailConfig",emailConfig);
return "admin/emailconfig";
}
//修改邮箱验证
@PostMapping("/updateemail")
@ResponseBody
public Integer updateemail(HttpSession session,String emails, String emailkey, String emailurl, String port, String emailname, Integer using ) {
EmailConfig emailConfig = new EmailConfig();
emailConfig.setEmailname(emailname);
emailConfig.setEmails(emails);
emailConfig.setEmailkey(emailkey);
emailConfig.setEmailurl(emailurl);
emailConfig.setPort(port);
emailConfig.setUsing(using);
Integer ret = emailConfigService.updateemail(emailConfig);
return ret;
}
//跳转系统配置页面
@RequestMapping(value = "/towebconfig")
public String towebconfig(Model model) {
Config config = configService.getSourceype();
UploadConfig updateConfig = uploadConfigService.getUpdateConfig();
model.addAttribute("config",config);
model.addAttribute("updateConfig",updateConfig);
return "admin/webconfig";
}
//修改站点配置
@PostMapping("/updateconfig")
@ResponseBody
public Integer updateconfig(String webname,String explain, String logos,
String footed, String links, String notice,String baidu,String domain ) {
Config config = new Config();
config.setWebname(webname);
config.setExplain(explain);
config.setLogos(logos);
config.setFooted(footed);
config.setLinks(links);
config.setNotice(notice);
config.setBaidu(baidu);
config.setDomain(domain);
Integer ret = configService.setSourceype(config);
return ret;
}
//修改上传配置
@PostMapping("/scconfig")
@ResponseBody
public Integer scconfig(UploadConfig updateConfig) {
Integer ret = uploadConfigService.setUpdateConfig(updateConfig);
return ret;
}
}
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpSession;
import cn.hellohao.pojo.*;
import cn.hellohao.service.*;
import cn.hellohao.service.impl.OSSImageupload;
import cn.hellohao.service.impl.USSImageupload;
import cn.hellohao.utils.Sentence;
import cn.hellohao.utils.SetText;
import cn.hellohao.utils.StringUtils;
@@ -17,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSONArray;
import cn.hellohao.service.impl.NOSImageupload;
@Controller
@@ -29,18 +29,19 @@ public class UpdateImgController {
@Autowired
private KeysService keysService;
@Autowired
private NoticeService noticeService;
@Autowired
private OSSImageupload ossImageupload;
@Autowired
private ConfigService configService;
@Autowired
private UploadConfigService uploadConfigService;
@Autowired
private USSImageupload ussImageupload;
@RequestMapping({"/", "/index"})
public String indexImg(Model model, HttpSession httpSession) {
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
System.out.println("域名:"+config.getDomain());
UploadConfig uploadConfig = uploadConfigService.getUpdateConfig();
Integer filesizetourists = 0;
Integer filesizeuser = 0;
@@ -62,7 +63,9 @@ public class UpdateImgController {
OSSImageupload.Initialize(key);
System.out.println("OSS初始化成功。");
}else if(key.getStorageType()==3){
//初始化腾讯云
USSImageupload.Initialize(key);
System.out.println("USS初始化成功。");
//初始化又拍云
}else if(key.getStorageType()==4){
//初始化七牛云
}else{
@@ -91,7 +94,6 @@ public class UpdateImgController {
model.addAttribute("loginid", -2);
model.addAttribute("imgcount", imgcounttourists);
model.addAttribute("filesize", filesizetourists*1024*1024);
}
model.addAttribute("suffix", uploadConfig.getSuffix());
model.addAttribute("config", config);
@@ -115,7 +117,6 @@ public class UpdateImgController {
if (u != null) {
username = u.getUsername();
}
Map<String, MultipartFile> map = new HashMap<>();
for (MultipartFile multipartFile : file) {
// 获取ImageReader对象的迭代器
@@ -129,19 +130,18 @@ public class UpdateImgController {
}
}
Map<String, Integer> m = null;
if(key.getStorageType()==1){
m = nOSImageupload.Imageupload(map, username);
}else if (key.getStorageType()==2){
m = ossImageupload.ImageuploadOSS(map, username);
}else if(key.getStorageType()==3){
m = ussImageupload.ImageuploadUSS(map, username);
//初始化腾讯云
}else if(key.getStorageType()==4){
//初始化七牛云
}else{
System.err.println("未获取到对象存储参数,上传失败。");
}
Images img = new Images();
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
String times = df.format(new Date());
@@ -166,7 +166,6 @@ public class UpdateImgController {
}else{
jsonArray.add(-1);
}
//开辟新进程鉴黄。现在已经改成定时器
//查询鉴黄功能是否启动,1为启用
// Imgreview imgreview = imgreviewService.selectByPrimaryKey(1);
@@ -175,7 +174,6 @@ public class UpdateImgController {
// JianHuangThread thread = new JianHuangThread(imgreviewService, key, u, m);
// thread.start();
// }
System.err.println("上传后返回值:"+jsonArray.toString());
return jsonArray.toString();
}
@@ -189,6 +187,9 @@ public class UpdateImgController {
return jsonArray.toString();
}
@RequestMapping("/err")
public String err() {
return "err";
}
}
@@ -125,16 +125,20 @@ public class UserController {
//邮箱激活
@RequestMapping(value = "/activation.do", method = RequestMethod.GET)
public String activation(Model model, HttpServletRequest request, HttpSession session, String activation, String username) {
System.out.println("激活方法进去了");
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
System.out.println("域名:"+config.getDomain());
Integer ret = 0;
User user = userService.getUsersMail(activation);
model.addAttribute("config", config);
if (user != null && user.getIsok() == 0) {
Integer setisok = userService.uiduser(activation);
model.addAttribute("setisok", ret);
model.addAttribute("username", username);
return "isok";
} else {
return "redirect:/index.do";
//return "redirect:/index.do";
return "isok";
}
}
@@ -42,7 +42,7 @@ public class InterceptorConfig implements HandlerInterceptor {
//这个方法返回false表示忽略当前请求,如果一个用户调用了需要登陆才能使用的接口,如果他没有登陆这里会直接忽略掉
//当然你可以利用response给用户返回一些提示信息,告诉他没登陆
System.out.println("没有登录权限");
request.getRequestDispatcher("/index").forward(request, response);
request.getRequestDispatcher("/err").forward(request, response);
return false;
} else {
@@ -1,9 +1,12 @@
package cn.hellohao.service.impl;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.UpYun;
import com.aliyun.oss.OSSClient;
import com.upyun.UpException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -84,14 +87,23 @@ public class ImgServiceImpl implements ImgService {
String accessKeySecret = key.getAccessSecret();
String bucketName = key.getBucketname();
String objectName = fileName;
// 创建OSSClient实例。
OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
// 删除文件。
ossClient.deleteObject(bucketName, objectName);
// 关闭OSSClient。
ossClient.shutdown();
}
//删除USS对象存储的图片文件
public void delectUSS(Keys key, String fileName) {
UpYun upyun = new UpYun(key.getBucketname(), key.getAccessKey(), key.getAccessSecret());
try {
boolean result = upyun.deleteFile(fileName, null);
} catch (IOException e) {
e.printStackTrace();
} catch (UpException e) {
e.printStackTrace();
}
}
@@ -0,0 +1,73 @@
package cn.hellohao.service.impl;
import cn.hellohao.pojo.Keys;
import com.UpYun;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.model.ObjectMetadata;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@Service
public class USSImageupload {
static UpYun upyun;
static Keys key;
public Map<String, Integer> ImageuploadUSS(Map<String, MultipartFile> fileMap, String username) throws Exception {
// 要上传文件的路径
File file = null;
Map<String, Integer> ImgUrl = new HashMap<>();
//设置Header
ObjectMetadata meta = new ObjectMetadata();
meta.setHeader("Content-Disposition", "inline");
for (Map.Entry<String, MultipartFile> entry : fileMap.entrySet()) {
String uuid = UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0,5);//生成一个没有-的uuid,然后取前5位
java.text.DateFormat format1 = new java.text.SimpleDateFormat("MMddhhmmss");
String times = format1.format(new Date());
file = changeFile(entry.getValue());
// 上传文件流。
System.out.println("待上传的图片:"+username + "/" + uuid+times + "." + entry.getKey());
// 例2:采用数据流模式上传文件(节省内存),自动创建父级目录
upyun.setContentMD5(UpYun.md5(file));
boolean result = upyun.writeFile(username + "/" + uuid+times + "." + entry.getKey(), file, true);
if(result){
ImgUrl.put(key.getRequestAddress() + "/" + username + "/" + uuid+times + "." + entry.getKey(), (int) (entry.getValue().getSize()));
}else{
System.err.println("上传失败");
}
}
return ImgUrl;
}
// 转换文件方法
private File changeFile(MultipartFile multipartFile) throws Exception {
// 获取文件名
String fileName = multipartFile.getOriginalFilename();
// 获取文件后缀
String prefix = fileName.substring(fileName.lastIndexOf("."));
// todo 修改临时文件文件名
File file = File.createTempFile(fileName, prefix);
// MultipartFile to File
multipartFile.transferTo(file);
return file;
}
//初始化
public static void Initialize(Keys k) {
// 初始化
// 创建UpYun实例。
upyun = new UpYun(k.getBucketname(), k.getAccessKey(), k.getAccessSecret());
key = k;
}
}
+28
View File
@@ -0,0 +1,28 @@
package cn.hellohao.test;
import com.UpYun;
import java.io.File;
public class Uppai {
public static void chushihua() throws Exception{
UpYun upyun = new UpYun("hellohao1", "hellohao", "gXDQKvAHBvtYEirLoSjFThxrOHFaUsOz");
//设置超时时间
upyun.setTimeout(60);
String path = "/test1/1.png";
// 例2:采用数据流模式上传文件(节省内存),自动创建父级目录
// File file = new File("D:\\桌面\\资料\\TouXiang.png");
// upyun.setContentMD5(UpYun.md5(file));
// boolean result = upyun.writeFile(path, file, true);
// 删除目录
//boolean result = upyun.rmDir(path);
boolean result = upyun.deleteFile(path, null);
System.out.println(result);
}
public static void main(String[] args) throws Exception {
Uppai.chushihua();
}
}
@@ -14,6 +14,7 @@ public class StringUtils {
for (Field field : fields) {
//不检查 直接取值
field.setAccessible(true);
try {
if(StringUtils.isNull(field.get(objs))) {
//不为空
+321
View File
@@ -0,0 +1,321 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
* version: 1.13.1
* https://github.com/wenzhixin/bootstrap-table/
*/
.bootstrap-table .table {
margin-bottom: 0 !important;
border-bottom: 1px solid #dddddd;
border-collapse: collapse !important;
border-radius: 1px;
}
.bootstrap-table .table:not(.table-condensed),
.bootstrap-table .table:not(.table-condensed) > tbody > tr > th,
.bootstrap-table .table:not(.table-condensed) > tfoot > tr > th,
.bootstrap-table .table:not(.table-condensed) > thead > tr > td,
.bootstrap-table .table:not(.table-condensed) > tbody > tr > td,
.bootstrap-table .table:not(.table-condensed) > tfoot > tr > td {
padding: 8px;
}
.bootstrap-table .table.table-no-bordered > thead > tr > th,
.bootstrap-table .table.table-no-bordered > tbody > tr > td {
border-right: 2px solid transparent;
}
.bootstrap-table .table.table-no-bordered > tbody > tr > td:last-child {
border-right: none;
}
.fixed-table-container {
position: relative;
clear: both;
border: 1px solid #dddddd;
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.fixed-table-container.table-no-bordered {
border: 1px solid transparent;
}
.fixed-table-footer,
.fixed-table-header {
overflow: hidden;
}
.fixed-table-footer {
border-top: 1px solid #dddddd;
}
.fixed-table-body {
overflow-x: auto;
overflow-y: auto;
height: 100%;
}
.fixed-table-container table {
width: 100%;
}
.fixed-table-container thead th {
height: 0;
padding: 0;
margin: 0;
border-left: 1px solid #dddddd;
}
.fixed-table-container thead th:focus {
outline: 0 solid transparent;
}
.fixed-table-container thead th:first-child:not([data-not-first-th]) {
border-left: none;
border-top-left-radius: 4px;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
}
.fixed-table-container thead th .th-inner,
.fixed-table-container tbody td .th-inner {
padding: 8px;
line-height: 24px;
vertical-align: top;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fixed-table-container thead th .sortable {
cursor: pointer;
background-position: right;
background-repeat: no-repeat;
padding-right: 30px;
}
.fixed-table-container thead th .both {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC');
}
.fixed-table-container thead th .asc {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==');
}
.fixed-table-container thead th .desc {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ');
}
.fixed-table-container th.detail {
width: 30px;
}
.fixed-table-container tbody td {
border-left: 1px solid #dddddd;
}
.fixed-table-container tbody tr:first-child td {
border-top: none;
}
.fixed-table-container tbody td:first-child {
border-left: none;
}
/* the same color with .active */
.fixed-table-container tbody .selected td {
background-color: #f5f5f5;
}
.fixed-table-container .bs-checkbox {
text-align: center;
}
.fixed-table-container input[type="radio"],
.fixed-table-container input[type="checkbox"] {
margin: 0 auto !important;
}
.fixed-table-container .no-records-found {
text-align: center;
}
.fixed-table-pagination div.pagination,
.fixed-table-pagination .pagination-detail {
margin-top: 10px;
margin-bottom: 10px;
}
.fixed-table-pagination div.pagination .pagination {
margin: 0;
}
.fixed-table-pagination .pagination a {
padding: 6px 12px;
line-height: 1.428571429;
}
.fixed-table-pagination .pagination-info {
line-height: 34px;
margin-right: 5px;
}
.fixed-table-pagination .btn-group {
position: relative;
display: inline-block;
vertical-align: middle;
}
.fixed-table-pagination .dropup .dropdown-menu {
margin-bottom: 0;
}
.fixed-table-pagination .page-list {
display: inline-block;
}
.fixed-table-toolbar .columns-left {
margin-right: 5px;
}
.fixed-table-toolbar .columns-right {
margin-left: 5px;
}
.fixed-table-toolbar .columns label {
display: block;
padding: 3px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571429;
}
.fixed-table-toolbar .bs-bars,
.fixed-table-toolbar .search,
.fixed-table-toolbar .columns {
position: relative;
margin-top: 10px;
margin-bottom: 10px;
}
.fixed-table-pagination li.disabled a {
pointer-events: none;
cursor: default;
}
.fixed-table-loading {
display: none;
position: absolute;
top: 42px;
right: 0;
bottom: 0;
left: 0;
z-index: 99;
background-color: #fff;
text-align: center;
}
.fixed-table-body .card-view .title {
font-weight: bold;
display: inline-block;
min-width: 30%;
text-align: left !important;
}
/* support bootstrap 2 */
.fixed-table-body thead th .th-inner {
box-sizing: border-box;
}
.table th, .table td {
vertical-align: middle;
box-sizing: border-box;
}
.fixed-table-toolbar .dropdown-menu {
text-align: left;
max-height: 300px;
overflow: auto;
}
.fixed-table-toolbar .btn-group > .btn-group {
display: inline-block;
margin-left: -1px !important;
}
.fixed-table-toolbar .btn-group > .btn-group > .btn {
border-radius: 0;
}
.fixed-table-toolbar .btn-group > .btn-group:first-child > .btn {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.fixed-table-toolbar .btn-group > .btn-group:last-child > .btn {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.bootstrap-table .table > thead > tr > th {
vertical-align: bottom;
border-bottom: 1px solid #ddd;
}
.bootstrap-table .table > thead.thead-dark > tr > th {
border-bottom: 1px solid #212529;
}
/* support bootstrap 3 */
.bootstrap-table .table thead > tr > th {
padding: 0;
margin: 0;
}
.bootstrap-table .fixed-table-footer tbody > tr > td {
padding: 0 !important;
}
.bootstrap-table .fixed-table-footer .table {
border-bottom: none;
border-radius: 0;
padding: 0 !important;
}
.bootstrap-table .pull-right .dropdown-menu {
right: 0;
left: auto;
}
/* calculate scrollbar width */
p.fixed-table-scroll-inner {
width: 100%;
height: 200px;
}
div.fixed-table-scroll-outer {
top: 0;
left: 0;
visibility: hidden;
width: 200px;
height: 150px;
overflow: hidden;
}
/* for get correct heights */
.fixed-table-toolbar:after, .fixed-table-pagination:after {
content: "";
display: block;
clear: both;
}
.bootstrap-table.fullscreen {
position: fixed;
top: 0;
left: 0;
z-index: 1050;
width: 100%!important;
background: #FFF;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<title>邮箱配置</title>
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/layui/layui/layui.js}"></script>
</head>
<body>
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<title>图片审核配置</title>
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/layui/layui/layui.js}"></script>
</head>
<body>
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<title>密码修改</title>
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/layui/layui/layui.js}"></script>
</head>
<body>
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<title>储存源配置</title>
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/layui/layui/layui.js}"></script>
</head>
<body>
@@ -20,8 +20,8 @@
<select id="StorageType" name="city" lay-filter="business" lay-verify="required">
<option value="1">网易NOS</option>
<option value="2">阿里OSS</option>
<option >腾讯COS(未接入)</option>
<option >七牛云存储(未接入)</option>
<option value="3">又拍USS</option>
<option value="4">七牛云存储(未接入)</option>
</select>
</div>
</div>
@@ -29,41 +29,41 @@
<hr/>
<div class="layui-form-item">
<label class="layui-form-label">AccessKey</label>
<div class="layui-form-item" id="c1">
<label class="layui-form-label" id="keyusername">AccessKey</label>
<div class="layui-input-block">
<input id="AccessKey" type="text" name="title" autocomplete="off" placeholder="AccessKey"
<input id="AccessKey" type="text" name="title" autocomplete="off"
class="layui-input" th:value="${AccessKey}"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">AccessSecret</label>
<div class="layui-form-item" id="c2">
<label class="layui-form-label" id="keypass">AccessSecret</label>
<div class="layui-input-block">
<input id="AccessSecret" type="text" name="title" autocomplete="off" placeholder="AccessSecret"
<input id="AccessSecret" type="text" name="title" autocomplete="off"
class="layui-input" th:value="${AccessSecret}"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">Endpoint</label>
<div class="layui-form-item" id="c3">
<label class="layui-form-label" id="keyusername">Endpoint</label>
<div class="layui-input-block">
<input id="Endpoint" type="text" name="title" autocomplete="off" placeholder="Endpoint"
<input id="Endpoint" type="text" name="title" autocomplete="off"
class="layui-input" th:value="${Endpoint}"/>
<span style="color: #DAA5A6;">需带有http://或https://</span>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">Bucketname</label>
<div class="layui-form-item" id="c4">
<label class="layui-form-label">存储桶名称</label>
<div class="layui-input-block">
<input id="Bucketname" type="text" name="title" autocomplete="off" placeholder="Bucketname"
<input id="Bucketname" type="text" name="title" autocomplete="off"
class="layui-input" th:value="${Bucketname}"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">RequestAddress</label>
<div class="layui-form-item" id="c5">
<label class="layui-form-label" id="keyurlname">请求域名</label>
<div class="layui-input-block">
<input id="RequestAddress" type="text" name="title" autocomplete="off" placeholder="RequestAddress"
<input id="RequestAddress" type="text" name="title" autocomplete="off" placeholder="生成图片url的域名"
class="layui-input" th:value="${RequestAddress}"/>
<span style="color: #DAA5A6;">需带有http://或https://</span>
</div>
@@ -87,6 +87,22 @@
//select选中事件
form.on('select(business)', function(data){
//alert(data.value)//获取选中的值
$("#AccessKey").val('');
$("#AccessSecret").val('');
$("#Endpoint").val('');
$("#Bucketname").val('');
$("#RequestAddress").val('');
if(data.value==3){
$("#c3").css('display','none');
$("#keyusername").text('操作员名称');
$("#keypass").text('操作员密码');
}else{
$("#c3").css('display','block');
$("#keyusername").text('AccessKey');
$("#keypass").text('AccessSecret');
}
$.ajax({
type: "POST",
url: "/admin/root/getkey",
@@ -95,7 +111,6 @@
},
dataType: "json",
success: function (data) {
console.log(data)
$("#AccessKey").val(data[0].accessKey);
$("#AccessSecret").val(data[0].accessSecret);
$("#Endpoint").val(data[0].endpoint);
@@ -124,11 +139,13 @@
function issave() {
var AccessKey = $("#AccessKey").val();
var AccessSecret = $("#AccessSecret").val();
var Endpoint = $("#Endpoint").val();
var Endpoint = "";
var Bucketname = $("#Bucketname").val();
var RequestAddress = $("#RequestAddress").val();
var StorageType = $("#StorageType").val();
if(AccessKey!="" && AccessSecret!="" && Endpoint!="" && Bucketname!="" && RequestAddress!="" && StorageType!=""){
if(StorageType==3){Endpoint="0";}
else{Endpoint = $("#Endpoint").val();}
if(AccessKey!="" && AccessSecret!="" &&Endpoint!="" && Bucketname!="" && RequestAddress!="" && StorageType!=""){
$.ajax({
type: "POST",
url: "/admin/root/updatekey",
+60 -62
View File
@@ -7,43 +7,29 @@
<link rel="shortcut icon" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico" type="image/x-icon"/>
<link rel="icon" type="image/ico" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico"/>
<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
type="text/css"/>
<link th:href="@{/static/css/font-awesome.min.css}" rel="stylesheet" type="text/css"/>
<link th:href="@{/static/css/style.css}" rel="stylesheet" type="text/css"/>
<link th:href="@{/static/css/toastr.min.css}" media="all" rel="stylesheet" type="text/css"/>
<link th:href="@{/static/css/login-register.css}" media="all" rel="stylesheet" type="text/css"/>
<link href="https://cdn.staticfile.org/bootstrap-table/1.13.1/bootstrap-table.css" rel="stylesheet"/>
<link th:href="@{/static/css/bootstrap-table.css}" media="all" rel="stylesheet" type="text/css"/>
<link th:href="@{/static/css/sweetalert.min.css}" media="all" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
<link href="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.css" media="all" rel="stylesheet"
type="text/css"/>
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<script src="https://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script>
<script th:src="@{/static/js/toastr.min.js}" type="text/javascript"></script>
<script th:src="@{/static/js/login-register.js}"></script>
<script th:src="@{/static/bootstrap-3.3.4-dist/js/bootstrap-table-hellohao1.13.1.js}"></script>
<script src="https://cdn.staticfile.org/clipboard.js/2.0.4/clipboard.min.js"></script>
<script src="https://cdn.staticfile.org/jqBootstrapValidation/1.3.7/jqBootstrapValidation.min.js"></script>
<script src="https://cdn.staticfile.org/bootbox.js/4.4.0/bootbox.min.js"></script>
<script src="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.js" type="text/javascript"></script>
<script th:src="@{/static/js/clipboard.min.js}"></script>
<script th:src="@{/static/js/jqBootstrapValidation.min.js}"></script>
<script th:src="@{/static/js/bootbox.min.js}"></script>
<script th:src="@{/static/js/sweetalert.min.js}"></script>
<script th:src="@{/layui/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/static/js/mustache.min.js}"></script>
<!-- 样式 -->
<style type="text/css">
.kv-main {
padding: 13px;
}
#page-header {
width: 80%;
height: 50px;
padding: 10px;
margin-top: 5%;
margin: 0 auto;
}
pre {
color: #000;
line-height: 16px;
@@ -53,10 +39,6 @@
word-wrap: break-word;
}
#isadmin {
float: right;
}
</style>
</head>
<body>
@@ -70,7 +52,7 @@
<div class="sm-st clearfix">
<span class="sm-st-icon st-blue"><i class="fa fa-image"></i></span>
<div style="font-weight:500;font-family:黑体;" class="sm-st-info">
<span id="imgcount" th:utext="${counts}"></span>
<span id="counts" ></span>
本站图片总数
</div>
</div>
@@ -79,7 +61,7 @@
<div class="sm-st clearfix">
<span class="sm-st-icon st-violet"><i class="fa fa-user"></i></span>
<div style="font-weight:500;font-family:黑体;" class="sm-st-info">
<span th:utext="${getUserTotal}">0</span>
<span id="getusertotal" >0</span>
本站用户总数
</div>
</div>
@@ -88,7 +70,7 @@
<div class="sm-st clearfix">
<span class="sm-st-icon st-red"><i class="glyphicon glyphicon-ban-circle"></i></span>
<div style="font-weight:500;font-family:黑体;" class="sm-st-info">
<span th:utext="${imgreviewcount}">0</span>
<span id="imgreviewcount" >0</span>
本站拦截非法图片
</div>
</div>
@@ -105,12 +87,10 @@
</div>
</section>
<!-- <div ><input id="isadmin" onclick="openLoginModal();" class="btn btn-default" type="button" value="后台管理"></div>-->
<div id="isimgs">
<!--分页 -->
<div id="mytext" style="font-weight: bold;">我的图片:
<span id="usercount" class="label label-info" style="font-weight: bold;font-size: 18px;"
th:text="${usercount}">0</span>
<span id="usercount" class="label label-info" style="font-weight: bold;font-size: 18px;">0</span>
</div>
<table class="table table-bordered ft-table table-hover" id="table_server">
@@ -155,6 +135,13 @@
</body>
<script type="application/javascript">
var layer;
layui.use('layer', function () {
layer = layui.layer;
});
// function getimglist() {
// $("#isimgs").show();
// $("#isusers").hide();
@@ -163,22 +150,9 @@
$(function () {
$("#isimgs").show();
$("#isusers").hide();
var loginid = [[${loginid}]];
var source = [[${source}]];
var str = "";
if (source == 1) {
str = "网易NOS";
} else if (source == 2) {
str = "阿里OSS";
} else if (source == 2) {
str = "腾讯COS";
} else if (source == 2) {
str = '七牛KODO';
} else {
str = '未知';
}
$("#source").text(str);
//var source = [[${source}]];
// $("#source").text(str);
toastr.options.positionClass = 'toast-bottom-right';
toastr.options = {
closeButton: true,//是否显示关闭按钮
@@ -197,6 +171,40 @@
};
// 分页
fenye('/admin/selecttable', 1);//1代表查询所有人
$("#myselect").change(function () {
var opt = $("#myselect").val();
// 先销毁table中的数据
$("#table_server").bootstrapTable('destroy');
fenye('/admin/selecttable', opt);
});
//获取本站概况
$.ajax({
type: "POST",
url: "/admin/getwebconfig",
dataType: "json",
success: function (data) {
$("#counts").text(data.counts);
$("#getusertotal").text(data.getusertotal);
$("#imgreviewcount").text(data.imgreviewcount);
$("#usercount").text(data.usercount);
var str = "";
if (data.source == 1) {
str = "网易NOS";
} else if (data.source == 2) {
str = "阿里OSS";
} else if (data.source == 3) {
str = "又拍USS";
} else if (data.source == 4) {
str = '七牛KODO';
} else {
str = '未知';
}
$("#source").text(str);
}
});
});
function deleall() {
@@ -229,7 +237,6 @@
//return;
}
});
}
function deleallimg(ids) {
@@ -265,6 +272,9 @@
}
$("#imgcount").text(data.count);
$("#usercount").text(data.usercount);
$("#imgreviewcount").text(data.imgreviewcount);
}
});
}
@@ -359,18 +369,6 @@
}
var layer;
layui.use('layer', function () {
layer = layui.layer;
});
$("#myselect").change(function () {
var opt = $("#myselect").val();
// 先销毁table中的数据
$("#table_server").bootstrapTable('destroy');
fenye('/admin/selecttable', opt);
});
function fenye(url, selecttype) {
t = $("#table_server").bootstrapTable({
url: url,
@@ -450,7 +448,7 @@
} else if (rows.source == 2) {
source = '阿里OSS';
} else if (rows.source == 3) {
source = '腾讯COS';
source = '又拍USS';
} else if (rows.source == 4) {
source = '七牛KODO';
} else {
+10 -3
View File
@@ -12,7 +12,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>用户管理</title>
<link rel="stylesheet" href="https://cdn.90so.net/layui/2.4.5/css/layui.css">
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
</head>
<body>
@@ -26,8 +26,8 @@
<script src="https://cdn.90so.net/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.90so.net/layui/2.4.5/layui.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/layui/layui/layui.js}"></script>
<script type="text/javascript">
/**
@@ -58,6 +58,13 @@
return str;
}
}
,{field:'level',width:100, title: '状态',templet: function(d){
var str = '';
if(d.isok==1){str='可用';}
else {str='禁用';}
return str;
}
}
,{field:'level',width:100, title: '操作',templet: function(d){
return '<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>';
}
@@ -12,7 +12,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>系统配置</title>
<link rel="stylesheet" href="https://cdn.90so.net/layui/2.4.5/css/layui.css">
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
</head>
<body>
@@ -151,8 +151,8 @@
</div>
<script src="https://cdn.90so.net/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.90so.net/layui/2.4.5/layui.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/layui/layui/layui.js}"></script>
<script type="text/javascript">
/**
+17
View File
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>登录超时</title>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
</head>
<body>
<h2>登录已过期,请重新登录</h2>
<script>
$(function () {
top.location.href="/";
})
</script>
</body>
</html>
+4 -4
View File
@@ -9,8 +9,8 @@
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/bootbox.js/4.4.0/bootbox.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<link th:href="@{/static/css/login-register.css}" media="all" rel="stylesheet" type="text/css"/>
</head>
<body>
@@ -31,10 +31,10 @@
<ul class="nav navbar-nav">
<li class="hidden-sm hidden-md ">
<!-- <a onclick="guanyu();" target="_blank" style="cursor:pointer;">说明</a>-->
<!-- <a href="http://www.hellohao.cn" target="_blank">作者博客</a>-->
<a href="http://www.hellohao.cn" target="_blank">作者博客</a>
</li>
<li>
<!-- <a href="https://github.com/Hello-hao/Tbed" target="_blank">Github开源</a>-->
<a href="https://github.com/Hello-hao/Tbed" target="_blank">Github开源</a>
</li>
</ul>
<ul id="usersrc" class="nav navbar-nav navbar-right hidden-sm">
+10 -19
View File
@@ -13,31 +13,23 @@
<link rel="shortcut icon" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico" type="image/x-icon"/>
<link rel="icon" type="image/ico" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico">
<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
<!-- <link th:href="@{/static/css/fileinput.css}" media="all" rel="stylesheet" type="text/css"/>-->
<link th:href="@{/static/css/toastr.min.css}" media="all" rel="stylesheet" type="text/css"/>
<link th:href="@{/static/css/login-register.css}" media="all" rel="stylesheet" type="text/css"/>
<link href="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.css" media="all" rel="stylesheet"
type="text/css"/>
<link th:href="@{/static/css/sweetalert.min.css}" media="all" rel="stylesheet" type="text/css"/>
<link th:href="@{/webuploade/css/webuploader.css}" media="all" rel="stylesheet" type="text/css"/>
<link th:href="@{/webuploade/css/style.css}" media="all" rel="stylesheet" type="text/css"/>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<!-- <script th:src="@{/static/js/fileinput.js}" type="text/javascript"></script>-->
<!-- <script th:src="@{/static/js/fileinput_locale_zh.min.js}" type="text/javascript"></script>-->
<script th:src="@{/static/js/toastr.min.js}" type="text/javascript"></script>
<script th:src="@{/static/js/login-register.js}"></script>
<script src="https://cdn.staticfile.org/clipboard.js/2.0.4/clipboard.min.js"></script><!--2.0.4 -->
<script src="https://cdn.staticfile.org/bootbox.js/4.4.0/bootbox.min.js"></script>
<script th:src="@{/static/js/clipboard.min.js}"></script>
<script th:src="@{/static/js/bootbox.min.js}"></script>
<script th:src="@{/static/js/sweetalert.min.js}"></script>
<script th:src="@{/static/js/webuploader.js}"></script>
<script type="text/javascript" src="https://api.guoch.xyz/?code=js&charset=utf-8"></script>
<script src="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.js" type="text/javascript"></script>
<!-- <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>-->
<!-- <script th:src="@{/webuploade/js/jquery.js}" type="text/javascript"></script>-->
<!--<script th:src="@{/webuploade/js/webuploader.js}" type="text/javascript"></script>-->
<script th:src="@{/webuploade/js/upload.js}" type="text/javascript"></script>
<script src="https://cdn.bootcss.com/webuploader/0.1.1/webuploader.js"></script>
<!-- <script src="https://cdn.bootcss.com/webuploader/0.1.1/webuploader.js"></script>-->
<!-- 样式 -->
<style type="text/css">
@@ -243,6 +235,9 @@
//$("#page-header").fadeToggle("slow");
$(".jb").fadeToggle(4000);
});
if (window != top){top.location.href = location.href;}
$(function () {
//设置页面资料
var webname = [[${config.getWebname()}]];
@@ -286,13 +281,9 @@
var arr_markdown = "";
var arr_html = "";
//上传文件个数,默认单上传
//异步上传返回结果处理
$("#updatefile").on("fileuploaded", function (event, data, previewId, index) {
//console.log(data);
$("#address").css('display', 'block');
var response = data;
if(data.response==-1){
arr_url += '未配置存储源,请先后台配置存储源\r\n';
arr_markdown += '未配置存储源,请先后台配置存储源\r\n';
+12 -8
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
<script th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
</head>
<body>
@@ -15,7 +15,7 @@
<div style="margin-top: 10%; width: 800px;margin: auto;font-family:Helvetica, Tahoma, Arial, 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'Microsoft YaHei', STXihei, STHeiti, Heiti, SimSun, sans-serif;">
<div style="border-radius: 15px 15px 0 0;height: 47px;background-color: rgb(70, 150, 255);">
<div style="float: left;height: 47px;">
<p style="margin-top: 8px;margin-left: 10px;font-weight:bold;color:#FFFFFF;">Hellohao图床</p>
<p style="margin-top: 8px;margin-left: 10px;font-weight:bold;color:#FFFFFF;" th:text="${config.getWebname()}">Hellohao图床</p>
</div>
<div style="float: left;height: 47px;margin-left: 10px;">
<div style="margin-top: 6px;">
@@ -31,23 +31,24 @@
<p>您的账号已<span style="font-size: 22px;color: #5cb85c"> 成功激活 </span>啦,注册用户可上传更大图片和所有的上传历史记录。快去试试吧!</p>
<br/>
<br/>
<p><a href="http://tc.hellohao.cn" style="color: #5cb85c;text-decoration: none;"> 返回Hellohao图床</a></p>
<p><a href="#" id="urls" th:href="${config.getDomain()}" style="color: #5cb85c;text-decoration: none;" th:text="'返回'+${config.getWebname()}"> </a></p>
<!-- <p >Hellohao</p>-->
</div>
<div style="clear: both;"></div>
<div style="background-color: rgb(117, 181, 255);height: 140px;width: 800px;border-top: 1px #f4f4f4 dashed;">
<div style="float: left;width: 360px;height: 100px;padding: 20px;">
<div style="width: 100px;height: 100px;float: left;">
<img src="https://hellohao.nos-eastchina1.126.net/BlogImg/TouXiang.png" width="100" height="100"
<img src="https://hellohao.oss-cn-beijing.aliyuncs.com/Hellohao/294470617070820.png
" width="100" height="100"
style="-webkit-border-radius: 100px;-moz-border-radius: 100px;border-radius: 100px;"/>
</div>
<div style="width: 250px; height: 100px;margin-left:110px;padding-left: 10px;">
<div style="font-weight: 800;font-size: 24px;">Hellohao</div>
<div style="font-weight: 800;font-size: 24px;">嗨~朋友</div>
<div style="font-size: 12px;">
如果使用过程中如果遇到问题,欢迎与我反馈<br/>
QQ: 93103128<br/>
Blog:<a href="http://www.hellohao.cn" target="_blank"
style="color: #000;text-decoration: none;"> www.hellohao.cn</a>
<!-- QQ: 93103128<br/>-->
<!-- Blog:<a href="http://www.hellohao.cn" target="_blank"-->
<!-- style="color: #000;text-decoration: none;"> www.hellohao.cn</a>-->
</div>
</div>
</div>
@@ -59,6 +60,9 @@
Copyright &copy; 2019 Hellohao图床 By Hellohao All rights reserved.
</div>
</div>
<script>
</script>
</body>
</html>