mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
Hellohao图床6-12更新
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<artifactId>Tbed</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>Tbed</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<description>Hellohao Picture Bed for Spring Boot</description>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
|
||||
@@ -77,20 +77,9 @@ public class AdminController {
|
||||
model.addAttribute("level", u.getLevel());
|
||||
model.addAttribute("email", u.getEmail());
|
||||
model.addAttribute("loginid", 100);
|
||||
model.addAttribute("source", key.getStorageType());
|
||||
|
||||
//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", storageType);
|
||||
// if (u.getLevel() > 1) {
|
||||
//// model.addAttribute("htgl",
|
||||
//// "<a href=\"#home\" onclick=\"showRegisterForm();\" data-toggle=\"tab\">系统配置</a>");
|
||||
////
|
||||
//// }
|
||||
if(key!=null){
|
||||
model.addAttribute("source", key.getStorageType());
|
||||
}
|
||||
return "admin/table";
|
||||
}
|
||||
|
||||
@@ -171,13 +160,15 @@ public class AdminController {
|
||||
public String tostorage(HttpSession session, Model model, HttpServletRequest request) {
|
||||
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
|
||||
Keys key = keysService.selectKeys(config.getSourcekey());
|
||||
//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());
|
||||
if(key!=null){
|
||||
//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";
|
||||
}
|
||||
|
||||
@@ -214,43 +205,9 @@ public class AdminController {
|
||||
User u = (User) session.getAttribute("user");
|
||||
Images images = imgService.selectByPrimaryKey(id);
|
||||
Keys key = keysService.selectKeys(sourcekey);
|
||||
ImgServiceImpl de = new ImgServiceImpl();
|
||||
if(key!=null){
|
||||
ImgServiceImpl de = new ImgServiceImpl();
|
||||
|
||||
if (key.getStorageType() == 1) {
|
||||
de.delect(key, images.getImgname());
|
||||
} else if (key.getStorageType() == 2) {
|
||||
de.delectOSS(key, images.getImgname());
|
||||
} else if (key.getStorageType() == 3) {
|
||||
//初始化腾讯云
|
||||
} else if (key.getStorageType() == 4) {
|
||||
//初始化七牛云
|
||||
} else {
|
||||
System.err.println("未获取到对象存储参数,删除失败。");
|
||||
}
|
||||
Integer ret = imgService.deleimg(id);
|
||||
Integer count = 0;
|
||||
if (ret > 0) {
|
||||
jsonObject.put("usercount", imgService.countimg(u.getId()));
|
||||
jsonObject.put("count", imgService.counts(null) + 1000);
|
||||
count = 1;
|
||||
} else {
|
||||
count = 0;
|
||||
}
|
||||
jsonObject.put("val", count);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
//批量删除图片
|
||||
@PostMapping("/deleallimg")
|
||||
@ResponseBody
|
||||
public String deleallimg(HttpSession session, @RequestParam("ids[]") Integer[] ids) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
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());
|
||||
if (key.getStorageType() == 1) {
|
||||
de.delect(key, images.getImgname());
|
||||
} else if (key.getStorageType() == 2) {
|
||||
@@ -262,16 +219,61 @@ public class AdminController {
|
||||
} else {
|
||||
System.err.println("未获取到对象存储参数,删除失败。");
|
||||
}
|
||||
Integer ret = imgService.deleimg(ids[i]);
|
||||
if (ret < 1) {
|
||||
v = 0;
|
||||
Integer ret = imgService.deleimg(id);
|
||||
Integer count = 0;
|
||||
if (ret > 0) {
|
||||
jsonObject.put("usercount", imgService.countimg(u.getId()));
|
||||
jsonObject.put("count", imgService.counts(null) + 1000);
|
||||
count = 1;
|
||||
} else {
|
||||
v = 1;
|
||||
count = 0;
|
||||
}
|
||||
jsonObject.put("val", count);
|
||||
}else{
|
||||
jsonObject.put("val", 0);
|
||||
}
|
||||
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
//批量删除图片
|
||||
@PostMapping("/deleallimg")
|
||||
@ResponseBody
|
||||
public String deleallimg(HttpSession session, @RequestParam("ids[]") Integer[] ids) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
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());
|
||||
if(key!=null){
|
||||
if (key.getStorageType() == 1) {
|
||||
de.delect(key, images.getImgname());
|
||||
} else if (key.getStorageType() == 2) {
|
||||
de.delectOSS(key, images.getImgname());
|
||||
} else if (key.getStorageType() == 3) {
|
||||
//初始化腾讯云
|
||||
} else if (key.getStorageType() == 4) {
|
||||
//初始化七牛云
|
||||
} else {
|
||||
System.err.println("未获取到对象存储参数,删除失败。");
|
||||
}
|
||||
Integer ret = imgService.deleimg(ids[i]);
|
||||
if (ret < 1) {
|
||||
v = 0;
|
||||
} else {
|
||||
v = 1;
|
||||
}
|
||||
}else {
|
||||
v = 0;
|
||||
}
|
||||
}
|
||||
jsonObject.put("val", v);
|
||||
jsonObject.put("usercount", imgService.countimg(u.getId()));
|
||||
jsonObject.put("count", imgService.counts(null) + 1000);
|
||||
jsonObject.put("val", v);
|
||||
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
@@ -303,7 +305,6 @@ public class AdminController {
|
||||
User u = (User) session.getAttribute("user");
|
||||
user.setEmail(u.getEmail());
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
//if(count==0) {
|
||||
Integer ret = userService.change(user);
|
||||
jsonArray.add(ret);
|
||||
if (u.getEmail() != null && u.getPassword() != null) {
|
||||
@@ -311,9 +312,6 @@ public class AdminController {
|
||||
//刷新view
|
||||
session.invalidate();
|
||||
}
|
||||
//}else {
|
||||
// jsonArray.add("-1");
|
||||
//}
|
||||
// -1 用户名重复
|
||||
return jsonArray.toString();
|
||||
}
|
||||
@@ -350,8 +348,8 @@ public class AdminController {
|
||||
@PostMapping("/root/updateconfig")
|
||||
@ResponseBody
|
||||
public Integer updateconfig(HttpSession session, String webname,String explain, String logos,
|
||||
String footed, String links, String notice,String baidu ) {
|
||||
System.err.println(links);
|
||||
String footed, String links, String notice,String baidu,String domain ) {
|
||||
System.err.println("域名=="+domain);
|
||||
Config config = new Config();
|
||||
config.setWebname(webname);
|
||||
config.setExplain(explain);
|
||||
@@ -360,6 +358,7 @@ public class AdminController {
|
||||
config.setLinks(links);
|
||||
config.setNotice(notice);
|
||||
config.setBaidu(baidu);
|
||||
config.setDomain(domain);
|
||||
Integer ret = configService.setSourceype(config);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -41,18 +41,23 @@ public class UpdateImgController {
|
||||
public String indexImg(Model model, HttpServletRequest request, HttpSession httpSession) throws Exception {
|
||||
Config config = configService.getSourceype();//查询当前系统使用的存储源类型。
|
||||
Keys key = keysService.selectKeys(config.getSourcekey());//然后根据类型再查询key
|
||||
if(key.getStorageType()==1){
|
||||
nOSImageupload.Initialize(key);//实例化网易
|
||||
System.out.println("NOS初始化成功。");
|
||||
}else if (key.getStorageType()==2){
|
||||
OSSImageupload.Initialize(key);
|
||||
System.out.println("OSS初始化成功。");
|
||||
}else if(key.getStorageType()==3){
|
||||
//初始化腾讯云
|
||||
}else if(key.getStorageType()==4){
|
||||
//初始化七牛云
|
||||
}else{
|
||||
System.err.println("未获取到对象存储参数,初始化失败。");
|
||||
if(key!=null)
|
||||
{
|
||||
if(key.getStorageType()!=0 || key.getStorageType()!=null){
|
||||
if(key.getStorageType()==1){
|
||||
nOSImageupload.Initialize(key);//实例化网易
|
||||
System.out.println("NOS初始化成功。");
|
||||
}else if (key.getStorageType()==2){
|
||||
OSSImageupload.Initialize(key);
|
||||
System.out.println("OSS初始化成功。");
|
||||
}else if(key.getStorageType()==3){
|
||||
//初始化腾讯云
|
||||
}else if(key.getStorageType()==4){
|
||||
//初始化七牛云
|
||||
}else{
|
||||
System.err.println("未获取到对象存储参数,初始化失败。");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
User u = (User) httpSession.getAttribute("user");
|
||||
@@ -79,27 +84,6 @@ public class UpdateImgController {
|
||||
|
||||
}
|
||||
model.addAttribute("config", config);
|
||||
|
||||
// AipContentCensor client = ImageReview.Initialize();
|
||||
// String url = "https://hellohao.nos-eastchina1.126.net/Hellohao/huangse.png";
|
||||
// JSONObject res = client.antiPorn(url);
|
||||
// res = client.imageCensorUserDefined(url, EImgType.URL, null);
|
||||
// System.out.println(res.toString());
|
||||
|
||||
//
|
||||
// CronTrigger cron = (CronTrigger) scheduler.getTrigger(cronTrigger.getKey());
|
||||
// String currentCron = cron.getCronExpression();// 当前Trigger使用的
|
||||
// System.err.println("当前trigger使用的-"+currentCron);
|
||||
//
|
||||
// //修改每隔?秒执行任务
|
||||
// CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule("0 09 07 * * ?");
|
||||
//
|
||||
// // 按新的cronExpression表达式重新构建trigger
|
||||
// cron = cron.getTriggerBuilder().withIdentity(cronTrigger.getKey())
|
||||
// .withSchedule(scheduleBuilder).build();
|
||||
//
|
||||
// scheduler.rescheduleJob(cronTrigger.getKey(),cron);
|
||||
|
||||
return "index";
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ import javax.mail.internet.MimeMessage;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import cn.hellohao.pojo.Config;
|
||||
import cn.hellohao.pojo.EmailConfig;
|
||||
import cn.hellohao.service.ConfigService;
|
||||
import cn.hellohao.service.EmailConfigService;
|
||||
import cn.hellohao.utils.SendEmail;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -32,7 +34,8 @@ public class UserController {
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private EmailConfigService emailConfigService;
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
@RequestMapping("/register")
|
||||
@ResponseBody
|
||||
@@ -51,6 +54,7 @@ public class UserController {
|
||||
user.setBirthder(birthder);
|
||||
//查询是否启用了邮箱验证。
|
||||
EmailConfig emailConfig1 = emailConfigService.getemail();
|
||||
Config config = configService.getSourceype();
|
||||
Integer type = 0;
|
||||
if(emailConfig1.getUsing()==1){
|
||||
user.setIsok(0);
|
||||
@@ -59,7 +63,7 @@ public class UserController {
|
||||
//注册完发激活链接
|
||||
Thread thread = new Thread() {
|
||||
public void run() {
|
||||
Integer a = SendEmail.sendEmail(message, user.getUsername(), uid, user.getEmail(),emailConfig);
|
||||
Integer a = SendEmail.sendEmail(message, user.getUsername(), uid, user.getEmail(),emailConfig,config);
|
||||
}
|
||||
};
|
||||
thread.start();
|
||||
@@ -93,7 +97,6 @@ public class UserController {
|
||||
} else {
|
||||
jsonArray.add(-1);
|
||||
}
|
||||
//登录成功之后把账号密码存入session
|
||||
} else {
|
||||
jsonArray.add(0);
|
||||
}
|
||||
|
||||
@@ -11,11 +11,12 @@ public class Config {
|
||||
private String links;
|
||||
private String notice;
|
||||
private String baidu;
|
||||
private String domain;
|
||||
|
||||
public Config() {
|
||||
}
|
||||
|
||||
public Config(Integer id, Integer sourcekey, Integer emails, String webname, String explain, String logos, String footed, String links, String notice, String baidu) {
|
||||
public Config(Integer id, Integer sourcekey, Integer emails, String webname, String explain, String logos, String footed, String links, String notice, String baidu, String domain) {
|
||||
this.id = id;
|
||||
this.sourcekey = sourcekey;
|
||||
this.emails = emails;
|
||||
@@ -26,6 +27,7 @@ public class Config {
|
||||
this.links = links;
|
||||
this.notice = notice;
|
||||
this.baidu = baidu;
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -107,4 +109,12 @@ public class Config {
|
||||
public void setBaidu(String baidu) {
|
||||
this.baidu = baidu;
|
||||
}
|
||||
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,16 +16,10 @@ import java.util.Map;
|
||||
@Component
|
||||
public class ImageReview {
|
||||
|
||||
//设置APPID/AK/SK
|
||||
// private static final String APP_ID = "15434135";
|
||||
// private static final String API_KEY = "yDdHaeMf0FfFAxupXFkoxoPG";
|
||||
// private static final String SECRET_KEY = "QGRXTy8QNDMr0dWuWS6bj7rNcwtEddKe";
|
||||
private static AipContentCensor client;
|
||||
|
||||
private ImageReview() {
|
||||
}
|
||||
|
||||
|
||||
private static void Initializes(Imgreview imgreview) {
|
||||
client = new AipContentCensor(imgreview.getAppId(), imgreview.getApiKey(), imgreview.getSecretKey());
|
||||
client.setConnectionTimeoutInMillis(2000);
|
||||
@@ -74,21 +68,15 @@ public class ImageReview {
|
||||
}else{
|
||||
System.err.println("未获取到对象存储参数,上传失败。");
|
||||
}
|
||||
|
||||
if (ret == 1) {
|
||||
System.out.println("存在色情图片,删除成功。");
|
||||
} else {
|
||||
System.out.println("存在色情图片,删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -1,12 +1,9 @@
|
||||
package cn.hellohao;
|
||||
package cn.hellohao.utils;
|
||||
|
||||
import cn.hellohao.pojo.Imgreview;
|
||||
import cn.hellohao.pojo.Keys;
|
||||
import cn.hellohao.pojo.User;
|
||||
import cn.hellohao.service.ImgreviewService;
|
||||
import cn.hellohao.utils.ImageReview;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class JianHuangThread extends Thread {
|
||||
@@ -1,12 +1,8 @@
|
||||
package cn.hellohao.utils;
|
||||
|
||||
import cn.hellohao.pojo.Config;
|
||||
import cn.hellohao.pojo.EmailConfig;
|
||||
import cn.hellohao.service.EmailConfigService;
|
||||
import cn.hellohao.test.asdf;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.mail.*;
|
||||
import javax.mail.internet.AddressException;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -14,13 +10,6 @@ import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
public class SendEmail {
|
||||
// 发件人 账号和密码
|
||||
// private static String MY_EMAIL_NAME = "Hellohao图床";
|
||||
// private static String MY_EMAIL_ACCOUNT = "helloshihao@163.com";
|
||||
// private static String MY_EMAIL_PASSWORD = "hellohao950504";// 密码,是你自己的设置的授权码
|
||||
// // SMTP服务器(这里用的163 SMTP服务器)
|
||||
// public static String MEAIL_163_SMTP_HOST = "smtp.163.com";
|
||||
// public static String SMTP_163_PORT = "25";// 端口号,这个是163使用到的;QQ的应该是465或者875
|
||||
|
||||
public static MimeMessage Emails(EmailConfig emailConfig) {
|
||||
Properties p = new Properties();
|
||||
@@ -43,7 +32,9 @@ public class SendEmail {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static Integer sendEmail(MimeMessage message, String username, String Url, String email,EmailConfig emailConfig) {
|
||||
public static Integer sendEmail(MimeMessage message, String username, String Url, String email, EmailConfig emailConfig, Config config) {
|
||||
String webname=config.getWebname();
|
||||
String domain = config.getDomain();
|
||||
String body = "<!DOCTYPE html>\n" +
|
||||
"<html>\n" +
|
||||
" <head>\n" +
|
||||
@@ -64,8 +55,8 @@ public class SendEmail {
|
||||
" </div>\n" +
|
||||
" </header>\n" +
|
||||
" <div class=\"main-content\">\n" +
|
||||
" <h5><span>您正在注册Hellohao图床<i></i></span></h5>\n" +
|
||||
" <p>点击 <a href='http://tc.hellohao.cn/user/activation.do?activation=" + Url + "&username=" + username + "' ><u> 激活链接 </u></a> 进行账号激活</p>\n" +
|
||||
" <h5><span>您正在注册"+webname+"<i></i></span></h5>\n" +
|
||||
" <p>点击 <a href='"+domain+"/user/activation.do?activation=" + Url + "&username=" + username + "' ><u> 激活链接 </u></a> 进行账号激活</p>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
|
||||
@@ -5,12 +5,13 @@ mybatis.mapper-locations=classpath:mapper/*.xml
|
||||
logging.level.cn.hellohao.dao=debug
|
||||
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
spring.jackson.time-zone=GMT+8
|
||||
spring.datasource.username=picturebed
|
||||
spring.datasource.password=hellohao
|
||||
#spring.datasource.username=root
|
||||
#spring.datasource.password=root
|
||||
#spring.datasource.url=jdbc:mysql://localhost:3306/picturebed?useUnicode=true&characterEncoding=utf8
|
||||
spring.datasource.url=jdbc:mysql://hellohao.cn:3306/picturebed?useUnicode=true&characterEncoding=utf8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/picturebed?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
|
||||
|
||||
#spring.datasource.username=picturebed
|
||||
#spring.datasource.password=hellohao
|
||||
#spring.datasource.url=jdbc:mysql://hellohao.cn:3306/picturebed?useUnicode=true&characterEncoding=utf8
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||
spring.thymeleaf.cache=false
|
||||
|
||||
@@ -34,8 +34,12 @@
|
||||
`notice` = #{notice},
|
||||
</if>
|
||||
<if test="baidu != null">
|
||||
`baidu` = #{baidu}
|
||||
`baidu` = #{baidu},
|
||||
</if>
|
||||
<if test="domain != null">
|
||||
`domain` = #{domain}
|
||||
</if>
|
||||
|
||||
</set>
|
||||
where id=1
|
||||
</update>
|
||||
|
||||
@@ -5,26 +5,20 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<!-- 网页不会被缓存 -->
|
||||
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
|
||||
<title>后台管理 - Hellohao图床</title>
|
||||
<!-- - © 纯粹的图片驿站-->
|
||||
<title>图床后台管理</title>
|
||||
<link rel="shortcut icon" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico" type="image/x-icon"/>
|
||||
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<link rel="stylesheet" th:href="@{/layui/css/admin.css}">
|
||||
|
||||
</head>
|
||||
|
||||
<body class="layui-layout-body">
|
||||
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
|
||||
<div class="layui-header">
|
||||
<!-- logo 区域 -->
|
||||
<div class="layui-logo">
|
||||
<!-- <img src="images/security.png" alt="logo"/>-->
|
||||
<cite> Hellohao图床 </cite>
|
||||
<cite> 图床后台管理 </cite>
|
||||
</div>
|
||||
|
||||
<!-- 头部区域 -->
|
||||
<ul class="layui-nav layui-layout-left">
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
@@ -37,31 +31,21 @@
|
||||
<a><cite>首页</cite></a>
|
||||
</span>
|
||||
</ul>
|
||||
|
||||
<!-- 头像区域 -->
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
<li class="layui-nav-item">
|
||||
<a lay-event="clear" title="清理标签缓存"><img th:src="@{/layui/images/clear.png}" alt=""
|
||||
style="height: 18px;"/></a>
|
||||
</li>
|
||||
|
||||
<li class="layui-nav-item">
|
||||
<a>
|
||||
<img style="border-radius:20%; height: 25px;width: 25px;" th:src="@{/layui/images/avatar.png}"
|
||||
class="layui-nav-img" alt="头像">
|
||||
<!-- <i class="layui-icon layui-icon-friends" style="font-size: 26px; "></i>-->
|
||||
<span id="istime"></span>
|
||||
<cite th:text="'你好!'+${username}"></cite>
|
||||
<span class="layui-nav-more"></span>
|
||||
</a>
|
||||
<dl class="layui-nav-child layui-anim layui-anim-upbit">
|
||||
<!-- <dd lay-unselect>-->
|
||||
<!-- <a href="#">个人中心</a>-->
|
||||
<!-- </dd>-->
|
||||
<!-- <dd lay-unselect>-->
|
||||
<!-- <a href="javascript:void(0);" onclick="showRegisterForm()">修改密码</a>-->
|
||||
<!-- </dd>-->
|
||||
<!-- <hr>-->
|
||||
<dd lay-unselect>
|
||||
<a href="javascript:void(0);" onclick="exit()">退出</a>
|
||||
</dd>
|
||||
@@ -92,13 +76,6 @@
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- <dl class="layui-nav-child">-->
|
||||
<!-- <dd>-->
|
||||
<!-- <a href="#" lay-id="222" lay-url="/admin/tostorage">-->
|
||||
<!-- <cite>对象存储</cite>-->
|
||||
<!-- </a>-->
|
||||
<!-- </dd>-->
|
||||
<!-- </dl>-->
|
||||
</li>
|
||||
|
||||
<li class="layui-nav-item" th:if=" ${levels} gt '1'">
|
||||
@@ -144,14 +121,6 @@
|
||||
</dl>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<!-- <li class="layui-nav-item">-->
|
||||
<!-- <a lay-id="存储源配置" lay-url="https://www.baidu.com">-->
|
||||
<!-- <i class="layui-icon layui-icon-app"></i> <cite>一级菜单</cite>-->
|
||||
<!-- </a>-->
|
||||
<!-- </li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -198,19 +167,6 @@
|
||||
, layer = layui.layer
|
||||
|
||||
});
|
||||
// $(function () {
|
||||
// //parent.location.reload();//刷新父元素
|
||||
// now = new Date(),hour = now.getHours()
|
||||
// if(hour < 6){document.write("凌晨好!")}
|
||||
// else if (hour < 9){$("#istime").text("早上好!")}
|
||||
// else if (hour < 12){$("#istime").text("上午好!")}
|
||||
// else if (hour < 14){$("#istime").text("中午好!")}
|
||||
// else if (hour < 17){$("#istime").text("下午好!")}
|
||||
// else if (hour < 19){$("#istime").text("傍晚好!")}
|
||||
// else if (hour < 22){$("#istime").text("晚上好!")}
|
||||
// else {$("#istime").text("夜里好!")}
|
||||
// });
|
||||
|
||||
|
||||
function exit() {
|
||||
$.ajax({
|
||||
@@ -219,8 +175,6 @@
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
layer.msg('账号已退出');
|
||||
//toastr.success("账号已退出。");
|
||||
//window.location.reload();//刷新当前页面
|
||||
parent.location.reload();//刷新父元素
|
||||
|
||||
}
|
||||
|
||||
@@ -45,6 +45,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">站点域名</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="domain" type="text" name="title" autocomplete="off" placeholder="站点域名" class="layui-input"
|
||||
th:value="${config.getDomain()}"/><span style="color: #DAA5A6;">填写访问本站的域名或IP,否则开启邮箱激活不能正常使用。</span>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">站点说明</label>
|
||||
<div class="layui-input-block">
|
||||
@@ -116,19 +124,19 @@
|
||||
|
||||
});
|
||||
function updateconfig() {
|
||||
//修改百度图片鉴别
|
||||
var webname = $("#webname").val();
|
||||
var explain = $("#explain").val();
|
||||
var logos = $("#logos").val();
|
||||
var footed = $("#footed").val();
|
||||
var links = $("#links").val();
|
||||
var notice = $("#notice").val();
|
||||
if (webname != "") {
|
||||
var domain = $("#domain").val();
|
||||
if (webname != "" && domain!="" ) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updateconfig",
|
||||
dataType: "json",
|
||||
data: {webname: webname, explain: explain, logos: logos,footed:footed,links:links,notice:notice},
|
||||
data: {webname: webname, explain: explain, logos: logos,footed:footed,links:links,notice:notice,domain:domain},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
@@ -140,7 +148,7 @@
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg("网站名称内容均不能为空", {icon: 2});
|
||||
layer.msg("网站名称或站点域名均不能为空", {icon: 2});
|
||||
}
|
||||
}
|
||||
function updatebaidu() {
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<br/>
|
||||
<div class="rows footer-bottom" style="height: 50px;margin-top: 100px;">
|
||||
<center>
|
||||
<hr/>
|
||||
<!-- <p class="list-inline text-center" th:utext="${text_foot}"></p>-->
|
||||
<p class="list-inline text-center"><span><a href="http://www.hellohao.cn/" target="_blank"></a></span>©<span id="footeds"></span>
|
||||
</p>
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
<div class="navbar-collapse collapse" role="navigation">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="hidden-sm hidden-md ">
|
||||
<a onclick="guanyu();" target="_blank" style="cursor:pointer;">说明</a>
|
||||
<!-- <a onclick="guanyu();" target="_blank" style="cursor:pointer;">说明</a>-->
|
||||
</li>
|
||||
<li><a href="http://www.hellohao.cn" target="_blank">联系</a>
|
||||
<li>
|
||||
<!-- <a href="http://www.hellohao.cn" target="_blank">联系</a>-->
|
||||
</li>
|
||||
</ul>
|
||||
<ul id="usersrc" class="nav navbar-nav navbar-right hidden-sm">
|
||||
|
||||
@@ -14,20 +14,17 @@
|
||||
<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"/>
|
||||
|
||||
|
||||
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
|
||||
<link href="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.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/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>
|
||||
<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 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>
|
||||
@@ -37,6 +34,7 @@
|
||||
padding: 46px;
|
||||
/*margin-top: 5%;*/
|
||||
}
|
||||
|
||||
#page-header {
|
||||
width: 80%;
|
||||
height: 50px;
|
||||
@@ -44,6 +42,7 @@
|
||||
margin-top: 5%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
pre {
|
||||
color: #000;
|
||||
line-height: 16px;
|
||||
@@ -52,6 +51,7 @@
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#page-header {
|
||||
line-height: 2.5em;
|
||||
font-family: "Microsoft YaHei", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif;
|
||||
@@ -63,20 +63,21 @@
|
||||
</head>
|
||||
<body>
|
||||
<div th:include="header::header"></div>
|
||||
<div class="alert alert-success">
|
||||
<a href="#" class="close" data-dismiss="alert">
|
||||
×
|
||||
</a>
|
||||
<strong>警告!</strong>您的网络连接有问题。
|
||||
</div>
|
||||
|
||||
<div class="container" th:if=" ${config.getNotice()} != ''">
|
||||
<div class="alert alert-info alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert"
|
||||
aria-hidden="true">
|
||||
<div class="alert alert-success">
|
||||
<a href="#" class="close" data-dismiss="alert">
|
||||
×
|
||||
</button>
|
||||
<li class="glyphicon glyphicon-exclamation-sign"> </li><span th:text="${config.getNotice()}"></span>
|
||||
</a>
|
||||
<strong>警告!</strong>您的网络连接有问题。
|
||||
</div>
|
||||
|
||||
<div class="container" th:if=" ${config.getNotice()} != ''">
|
||||
<div class="alert alert-info alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert"
|
||||
aria-hidden="true">
|
||||
×
|
||||
</button>
|
||||
<li class="glyphicon glyphicon-exclamation-sign"> </li>
|
||||
<span th:text="${config.getNotice()}"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="page-header" class="container kv-main jb">
|
||||
@@ -105,17 +106,16 @@
|
||||
<div class="container" id="address" style="display: none;">
|
||||
<div class="form-group">
|
||||
<label>URL外链地址:</label>
|
||||
<a style="display: block;width: 50px;float: right;" onclick="copy(1)" class="btn btn-info btn-xs">复制</a>
|
||||
<a style="display: block;width: 50px;float: right;" onclick="copy(1)" class="btn btn-info btn-xs">复制</a>
|
||||
<pre id="urls"></pre>
|
||||
<label>Markdown外链地址:</label>
|
||||
<a style="display: block;width: 50px;float: right;" onclick="copy(2)" class="btn btn-info btn-xs">复制</a>
|
||||
<a style="display: block;width: 50px;float: right;" onclick="copy(2)" class="btn btn-info btn-xs">复制</a>
|
||||
<pre id="markdowns"></pre>
|
||||
<label>HTML外链地址:</label>
|
||||
<a style="display: block;width: 50px;float: right;" onclick="copy(3)" class="btn btn-info btn-xs">复制</a>
|
||||
<a style="display: block;width: 50px;float: right;" onclick="copy(3)" class="btn btn-info btn-xs">复制</a>
|
||||
<pre id="htmls"></pre>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<!-- 登录注册框 -->
|
||||
<div class="modal fade login" id="loginModal">
|
||||
<div class="modal-dialog login animated">
|
||||
@@ -160,7 +160,8 @@
|
||||
●邮箱激活链接如果没有请在【垃圾箱】查找</span>
|
||||
</div>
|
||||
<hr/>
|
||||
<input id="registerusername" class="form-control" type="text" placeholder="用户名(数字/字母不得超过10位)"
|
||||
<input id="registerusername" class="form-control" type="text"
|
||||
placeholder="用户名(数字/字母不得超过10位)"
|
||||
name="username">
|
||||
<input id="registeremail" class="form-control" type="text" placeholder="邮箱"
|
||||
name="email">
|
||||
@@ -210,7 +211,7 @@
|
||||
$("#explain").text(explain);
|
||||
$("#footeds").text(footeds);
|
||||
$("#links").html(links);
|
||||
$("#logos").attr('src',logos);
|
||||
$("#logos").attr('src', logos);
|
||||
var loginid = [[${loginid}]];
|
||||
toastr.options.positionClass = 'toast-bottom-right';
|
||||
toastr.options = {
|
||||
@@ -232,24 +233,11 @@
|
||||
if (loginid == 100) {
|
||||
var username = [[${username}]];
|
||||
var isvip = [[${level}]];
|
||||
var h = '<li><a target="_blank" id="usernames" >' +times()+ username + ' <img style=" margin-top:-6px;width:22px; height:22px;max-width:90%;max-height:90%;" src="/static/img/vip/Vip' + isvip + '.png" /></a></li>';
|
||||
var h = '<li><a target="_blank" id="usernames" >' + times() + username + ' <img style=" margin-top:-6px;width:22px; height:22px;max-width:90%;max-height:90%;" src="/static/img/vip/Vip' + isvip + '.png" /></a></li>';
|
||||
var h1 = '<li><a style="font-weight: bold;" target="_blank" href="/admin/goadmin" id="usernames" >控制面板 </a></li>';
|
||||
var h2 = '<li><a href="javascript:exit();" title="666" onclick="">退出</a></li>';
|
||||
$("#usersrc").html(h + h1 + h2);
|
||||
}
|
||||
|
||||
//一言
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/sentence",
|
||||
// dataType: "json",
|
||||
// success: function(data){
|
||||
// var json = eval('(' + data[0] + ')');
|
||||
// console.log(json.hitokoto)
|
||||
// $("#yiyan").text(json.hitokoto);
|
||||
// }
|
||||
// });
|
||||
|
||||
});
|
||||
var arr_url = "";
|
||||
var arr_markdown = "";
|
||||
@@ -294,7 +282,7 @@
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.ret > 0) {
|
||||
if(data.zctype==1){
|
||||
if (data.zctype == 1) {
|
||||
swal({
|
||||
title: "注册成功",
|
||||
text: "请前往邮箱激活你的账号,注意!激活邮件如果迟迟未收到,有可能在您的【垃圾箱】中。",
|
||||
@@ -306,14 +294,12 @@
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: false
|
||||
},
|
||||
function(isConfirm){
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
//swal("我知道了!", "你已经点确认了。","success");
|
||||
openLoginModal();
|
||||
} else {//swal("取消!", "你的虚拟文件是安全的:)","error");
|
||||
}
|
||||
} else{}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
swal({
|
||||
title: "注册成功",
|
||||
text: "赶快登录去体验吧。",
|
||||
@@ -321,16 +307,13 @@
|
||||
showCancelButton: false,//true显示两个按钮
|
||||
confirmButtonColor: "#A5DC86",
|
||||
confirmButtonText: "知道了",
|
||||
//cancelButtonText: "取消删除!",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: false
|
||||
},
|
||||
function(isConfirm){
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
//swal("我知道了!", "你已经点确认了。","success");
|
||||
openLoginModal();
|
||||
} else {//swal("取消!", "你的虚拟文件是安全的:)","error");
|
||||
}
|
||||
} else {}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -341,8 +324,6 @@
|
||||
toastr.error('注册失败,请重试。');
|
||||
}
|
||||
setTimeout(function () {
|
||||
//这里写时间到后执行的代码
|
||||
//window.location.reload();
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
@@ -363,7 +344,6 @@
|
||||
if (data == 1) {
|
||||
toastr.success("登录成功。");
|
||||
setTimeout(function () {
|
||||
//这里写时间到后执行的代码
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
} else {
|
||||
@@ -373,7 +353,6 @@
|
||||
toastr.error('登录失败,请重试。');
|
||||
}
|
||||
setTimeout(function () {
|
||||
//这里写时间到后执行的代码
|
||||
openLoginModal();
|
||||
}, 2000);
|
||||
}
|
||||
@@ -392,30 +371,46 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function guanyu() {
|
||||
bootbox.alert("本站为图床站,用户可以免费使用本站,本站仅有Hellohao一人开发维护,对接(网易、阿里、腾讯、七牛)等多家对象存储,添加图片鉴黄功能,慢慢增加更多功能。但是服务器资源宝贵,切勿恶意上传非法/黄色/暴力等违反国家法律规定图片,一旦发现,严查必究!");
|
||||
}
|
||||
|
||||
function times() {
|
||||
now = new Date(),hour = now.getHours()
|
||||
if(hour < 6){return("凌晨好!")}
|
||||
else if (hour < 9){return("早上好!")}
|
||||
else if (hour < 12){return("上午好!")}
|
||||
else if (hour < 14){return("中午好!")}
|
||||
else if (hour < 17){return("下午好!")}
|
||||
else if (hour < 19){return("傍晚好!")}
|
||||
else if (hour < 22){return("晚上好!")}
|
||||
else {return("夜里好!")}
|
||||
now = new Date(), hour = now.getHours()
|
||||
if (hour < 6) {
|
||||
return ("凌晨好!")
|
||||
} else if (hour < 9) {
|
||||
return ("早上好!")
|
||||
} else if (hour < 12) {
|
||||
return ("上午好!")
|
||||
} else if (hour < 14) {
|
||||
return ("中午好!")
|
||||
} else if (hour < 17) {
|
||||
return ("下午好!")
|
||||
} else if (hour < 19) {
|
||||
return ("傍晚好!")
|
||||
} else if (hour < 22) {
|
||||
return ("晚上好!")
|
||||
} else {
|
||||
return ("夜里好!")
|
||||
}
|
||||
}
|
||||
|
||||
function copy(val) {
|
||||
var data =null;
|
||||
if(val==1){data = $('#urls').text();}
|
||||
else if(val==2){data = $('#markdowns').text();}
|
||||
else if(val==3){data = $('#htmls').text();}
|
||||
else{return;}
|
||||
var data = null;
|
||||
if (val == 1) {
|
||||
data = $('#urls').text();
|
||||
} else if (val == 2) {
|
||||
data = $('#markdowns').text();
|
||||
} else if (val == 3) {
|
||||
data = $('#htmls').text();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var copy = new ClipboardJS('.btn', {
|
||||
text: function (trigger) {
|
||||
return data;
|
||||
return data;
|
||||
}
|
||||
});
|
||||
copy.on('success', function (e) {
|
||||
@@ -427,25 +422,20 @@
|
||||
copy.off("error");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function loadScriptString(code) {
|
||||
var script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
try{
|
||||
try {
|
||||
// firefox、safari、chrome和Opera
|
||||
script.appendChild(document.createTextNode(code));
|
||||
}catch(ex) {
|
||||
} catch (ex) {
|
||||
// IE早期的浏览器 ,需要使用script的text属性来指定javascript代码。
|
||||
script.text = code;
|
||||
}
|
||||
document.getElementsByTagName("head")[0].appendChild(script);
|
||||
}
|
||||
|
||||
//var text = 'var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="https://hm.baidu.com/hm.js?16c326e608c984c9bae6a63eda861888";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s)})();';
|
||||
var baidu =[[${config.getBaidu()}]];
|
||||
loadScriptString(baidu);
|
||||
|
||||
var baidu = [[${config.getBaidu()}]];
|
||||
loadScriptString(baidu);
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user