mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
重构版功能实现
This commit is contained in:
@@ -50,7 +50,6 @@ public class SubjectFilter extends BasicHttpAuthenticationFilter {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//验证Token
|
||||
String token = httpServletRequest.getHeader("Authorization");
|
||||
JSONObject jsonObject = JWTUtil.checkToken(token);
|
||||
if(!jsonObject.getBoolean("check")){
|
||||
@@ -63,20 +62,14 @@ public class SubjectFilter extends BasicHttpAuthenticationFilter {
|
||||
}else{
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User user = (User) subject.getPrincipal();
|
||||
//判断shiro里是否存有用户信息,如果没有,就再存进去。
|
||||
if(user==null){
|
||||
// System.out.println("Token没过期,但是Shiro里的用户信息空了,重新执行登录");
|
||||
//封装用户的登录数据(shiro认证的时候使用)
|
||||
UsernamePasswordToken tokenOBJ = new UsernamePasswordToken(jsonObject.getString("email"),jsonObject.getString("password"));
|
||||
//设置记住我
|
||||
tokenOBJ.setRememberMe(true);
|
||||
try {
|
||||
//执行登录方法,如果没有异常,说明登录成功
|
||||
subject.login(tokenOBJ);
|
||||
SecurityUtils.getSubject().getSession().setTimeout(3600000);//一小时
|
||||
} catch (Exception e) {
|
||||
System.err.println("拦截器,登录失败,false");
|
||||
//e.printStackTrace();
|
||||
// System.err.println("拦截器,登录失败,false");
|
||||
this.CODE = "403";
|
||||
return false;
|
||||
}
|
||||
@@ -103,9 +96,7 @@ public class SubjectFilter extends BasicHttpAuthenticationFilter {
|
||||
protected boolean onAccessDenied(ServletRequest request, ServletResponse response, Object mappedValue) {
|
||||
String info = "未知错误";
|
||||
try {
|
||||
if(this.CODE.equals("405")){
|
||||
info = "当前请求域名认证失败";
|
||||
}else if(this.CODE.equals("406")){
|
||||
if(this.CODE.equals("406")){
|
||||
info = "前端域名配置不正确";
|
||||
}else if(this.CODE.equals("403")){
|
||||
info = "当前用户无权访问该请求";
|
||||
|
||||
@@ -20,30 +20,14 @@ import java.util.Map;
|
||||
@Configuration
|
||||
public class ShiroConfig {
|
||||
|
||||
|
||||
//shiro过滤对象
|
||||
@Bean//(name = "shiroFilterFactoryBean")
|
||||
@Bean
|
||||
public ShiroFilterFactoryBean shiroFilterFactoryBean(@Qualifier("defaultWebSecurityManager") DefaultWebSecurityManager defaultWebSecurityManager){
|
||||
ShiroFilterFactoryBean bean = new ShiroFilterFactoryBean();
|
||||
//设置安全管理器
|
||||
bean.setSecurityManager(defaultWebSecurityManager);
|
||||
Map<String, Filter> filters = bean.getFilters();
|
||||
// Map<String,Filter> filter = new HashMap<>();
|
||||
filters.put("JWT",new SubjectFilter());
|
||||
bean.setFilters(filters);
|
||||
|
||||
//添加shiro内置过滤器
|
||||
/*
|
||||
* anon: 无需认证就可以访问
|
||||
* authc: 必须认证了才可以访问
|
||||
* user: 必须拥有 记住我 功能才能访问
|
||||
* perms: 拥有对某个资源的权限才能访问
|
||||
* roles: 拥有某个角色的权限才能访问
|
||||
* */
|
||||
|
||||
Map<String,String> filterMap = new LinkedHashMap<>();
|
||||
|
||||
//放行页面
|
||||
filterMap.put("/verifyCode","anon");
|
||||
filterMap.put("/verifyCodeForRegister","anon");
|
||||
filterMap.put("/verifyCodeForRetrieve","anon");
|
||||
@@ -52,17 +36,13 @@ public class ShiroConfig {
|
||||
filterMap.put("/ota/**","anon");
|
||||
filterMap.put("/admin/root/**","roles[admin]");
|
||||
filterMap.put("/**","JWT");
|
||||
|
||||
//认证失败的返回页面
|
||||
bean.setLoginUrl("/jurisError");
|
||||
//未授权页面
|
||||
bean.setUnauthorizedUrl("/authError");
|
||||
bean.setFilterChainDefinitionMap(filterMap);
|
||||
return bean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//安全对象
|
||||
@Bean
|
||||
public DefaultWebSecurityManager defaultWebSecurityManager(@Qualifier("userRealm") UserRealm userRealm){
|
||||
@@ -80,12 +60,5 @@ public class ShiroConfig {
|
||||
}
|
||||
|
||||
|
||||
//配置禁用session
|
||||
// @Bean
|
||||
// public StatelessDefaultSubjectFactory statelessDefaultSubjectFactory(){
|
||||
// StatelessDefaultSubjectFactory statelessDefaultSubjectFactory = new StatelessDefaultSubjectFactory();
|
||||
// return statelessDefaultSubjectFactory;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package cn.hellohao.auth.shiro;
|
||||
|
||||
/**
|
||||
* @author Hellohao
|
||||
* @version 1.0
|
||||
* @date 2021/6/15 17:30
|
||||
*/
|
||||
//public class StatelessDefaultSubjectFactory extends DefaultWebSecurityManager {
|
||||
// //不创建Session
|
||||
// public Subject createSubject(SubjectContext context){
|
||||
// context.setSessionCreationEnabled(false);
|
||||
// return super.createSubject(context);
|
||||
// }
|
||||
//}
|
||||
@@ -28,38 +28,28 @@ public class UserRealm extends AuthorizingRealm {
|
||||
//授权
|
||||
@Override
|
||||
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
|
||||
// System.out.println("..///执行了授权方法");
|
||||
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
|
||||
//拿到当前登录的对象
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User user = (User) subject.getPrincipal();
|
||||
ArrayList<String> roleList = new ArrayList();
|
||||
if(user.getLevel()==2){
|
||||
//赋予管理员权限
|
||||
// info.addRole("admin");
|
||||
roleList.add("admin");
|
||||
roleList.add("user");
|
||||
// info.addStringPermission("user:one");
|
||||
}else{
|
||||
// info.addRole("user");
|
||||
roleList.add("user");
|
||||
}
|
||||
info.addRoles(roleList);
|
||||
return info;
|
||||
}
|
||||
|
||||
//认证(登录)
|
||||
@Override
|
||||
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken tokenOBJ) throws AuthenticationException {
|
||||
// System.out.println("执行了认证方法");
|
||||
UsernamePasswordToken userToken = null;
|
||||
userToken = (UsernamePasswordToken)tokenOBJ;
|
||||
User user = new User();
|
||||
user.setEmail(userToken.getUsername());
|
||||
User u = userService.getUsers(user);
|
||||
//用户名认证
|
||||
if(u==null){
|
||||
//返回null 就是异常:UnknownAccountException
|
||||
return null;
|
||||
}
|
||||
//密码认证(防止泄露,不需要我们做)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.hellohao.config;
|
||||
|
||||
/**
|
||||
* @author Tiansh
|
||||
* @author Hellohao
|
||||
* @version 1.0
|
||||
* @date 2020/5/15 9:20
|
||||
*/
|
||||
|
||||
@@ -13,10 +13,6 @@ public class WebImgConfigurer implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
String filePath = File.separator + "HellohaoData" + File.separator;
|
||||
//和页面有关的静态目录都放在项目的static目录下
|
||||
//registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
|
||||
//上传的图片在D盘下的OTA目录下,访问路径如:http://localhost:8081/OTA/d3cf0281-bb7f-40e0-ab77-406db95ccf2c.jpg
|
||||
//其中OTA表示访问的前缀。"file:D:/OTA/"是文件真实的存储路径
|
||||
registry.addResourceHandler("/ota/**").addResourceLocations("file:"+filePath);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ import cn.hellohao.config.SysName;
|
||||
import cn.hellohao.pojo.*;
|
||||
import cn.hellohao.pojo.vo.PageResultBean;
|
||||
import cn.hellohao.service.*;
|
||||
import cn.hellohao.service.impl.AlbumServiceImpl;
|
||||
import cn.hellohao.service.impl.UserServiceImpl;
|
||||
import cn.hellohao.service.impl.*;
|
||||
import cn.hellohao.utils.*;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -43,7 +42,7 @@ public class AdminController {
|
||||
@Autowired
|
||||
private ImgreviewService imgreviewService;
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
private ImgTempService imgTempService;
|
||||
@Autowired
|
||||
private UploadConfigService uploadConfigService;
|
||||
@Autowired
|
||||
@@ -55,6 +54,22 @@ public class AdminController {
|
||||
@Autowired
|
||||
AlbumServiceImpl albumServiceI;
|
||||
|
||||
@Autowired
|
||||
private NOSImageupload nosImageupload;
|
||||
@Autowired
|
||||
private OSSImageupload ossImageupload;
|
||||
@Autowired
|
||||
private COSImageupload cosImageupload;
|
||||
@Autowired
|
||||
private KODOImageupload kodoImageupload;
|
||||
@Autowired
|
||||
private USSImageupload ussImageupload;
|
||||
@Autowired
|
||||
private UFileImageupload uFileImageupload;
|
||||
@Autowired
|
||||
private FTPImageupload ftpImageupload;
|
||||
|
||||
|
||||
@PostMapping(value = "/overviewData") //new
|
||||
@ResponseBody
|
||||
public Msg overviewData(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
@@ -122,7 +137,7 @@ public class AdminController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/SpaceExpansion")//new kuorong
|
||||
@PostMapping(value = "/SpaceExpansion")//new
|
||||
@ResponseBody
|
||||
public Msg SpaceExpansion(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
final Msg msg = new Msg();
|
||||
@@ -159,67 +174,6 @@ public class AdminController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/tosurvey")
|
||||
public String admin2(HttpSession session, Model model) {
|
||||
User u = (User) session.getAttribute("user");
|
||||
String sysetmname = System.getProperty("os.name");
|
||||
String isarch = System.getProperty("os.arch");
|
||||
String jdk = System.getProperty("java.version");
|
||||
model.addAttribute("username", u.getUsername());
|
||||
model.addAttribute("levels", u.getLevel());
|
||||
model.addAttribute("sysetmname",sysetmname);
|
||||
model.addAttribute("isarch", isarch);
|
||||
model.addAttribute("jdk", jdk);
|
||||
//空间大小
|
||||
UploadConfig uploadConfig = uploadConfigService.getUpdateConfig();
|
||||
Long usermemory = imgService.getusermemory(u.getId());
|
||||
if(usermemory==null){usermemory=0L;}
|
||||
User user = userService.getUsers(u);
|
||||
if(u!=null){
|
||||
if (u.getLevel() == 1) {
|
||||
model.addAttribute("level", "普通用户");
|
||||
} else if (u.getLevel() == 2) {
|
||||
model.addAttribute("level", "管理员");
|
||||
} else {
|
||||
model.addAttribute("level", "未 知");
|
||||
}
|
||||
model.addAttribute("levels", u.getLevel());
|
||||
model.addAttribute("username", u.getUsername());
|
||||
model.addAttribute("api", uploadConfig.getApi());
|
||||
|
||||
model.addAttribute("memory",user.getMemory());//单位M
|
||||
if(usermemory==null){
|
||||
model.addAttribute("usermemory", 0);//单位M
|
||||
}else{
|
||||
float d = (float) (Math.round((usermemory/1024.0F) * 100.0) / 100.0);
|
||||
model.addAttribute("usermemory", d);//单位M
|
||||
}
|
||||
}
|
||||
return "admin/survey";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getwebconfig")
|
||||
@ResponseBody
|
||||
public String getwebconfig(HttpSession session) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
UploadConfig uploadConfig = uploadConfigService.getUpdateConfig();
|
||||
User u = (User) session.getAttribute("user");
|
||||
Imgreview imgreview = imgreviewService.selectByPrimaryKey(1);
|
||||
jsonObject.put("usercount", imgService.countimg(u.getId()));
|
||||
jsonObject.put("counts", imgService.counts(null) );
|
||||
jsonObject.put("getusertotal", userService.getUserTotal());
|
||||
jsonObject.put("imgreviewcount", imgreview.getCount());
|
||||
if(uploadConfig.getIsupdate()!=1){
|
||||
jsonObject.put("VisitorUpload", 0);//是否禁用了游客上传
|
||||
}else{
|
||||
Long temp = imgService.getusermemory(0);
|
||||
jsonObject.put("VisitorUpload", uploadConfig.getIsupdate());//是否禁用了游客上传
|
||||
jsonObject.put("UsedSize", (temp == null ? 0 : temp/1024));//访客已用大小
|
||||
jsonObject.put("VisitorMemory", uploadConfig.getVisitormemory());//访客共大小
|
||||
}
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
@PostMapping("/getRecently")//new 获取榜单和最近上传
|
||||
@ResponseBody
|
||||
public Msg getRecently(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
@@ -303,7 +257,7 @@ public class AdminController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@PostMapping("/getStorage")//new 获取当前一共有多少种存储源 这是种类
|
||||
@PostMapping("/getStorage")//new
|
||||
@ResponseBody
|
||||
public Msg getStorage() {
|
||||
Msg msg = new Msg();
|
||||
@@ -312,7 +266,7 @@ public class AdminController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@PostMapping("/getStorageName")//new 获取当前一共有多少个存储源 这是总个数
|
||||
@PostMapping("/getStorageName")//new
|
||||
@ResponseBody
|
||||
public Msg getStorageName() {
|
||||
Msg msg = new Msg();
|
||||
@@ -358,7 +312,6 @@ public class AdminController {
|
||||
}
|
||||
Images img = new Images();
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
// img.setUseridlist(user.getId().toString());
|
||||
if(violation){
|
||||
img.setViolation("true");
|
||||
}
|
||||
@@ -431,7 +384,6 @@ public class AdminController {
|
||||
msg.setInfo("用户名不得超过20位字符");
|
||||
return msg;
|
||||
}
|
||||
|
||||
if(subject.hasRole("admin")){
|
||||
final User userOld = new User();
|
||||
userOld.setId(u.getId());
|
||||
@@ -475,9 +427,87 @@ public class AdminController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/deleImages") //new
|
||||
@ResponseBody
|
||||
public Msg deleImages(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
Msg msg = new Msg();
|
||||
JSONObject jsonObj = JSONObject.parseObject(data);
|
||||
JSONArray images = jsonObj.getJSONArray("images");
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User user = (User) subject.getPrincipal();
|
||||
|
||||
if(null == user){
|
||||
msg.setCode("500");
|
||||
msg.setInfo("当前用户信息不存在");
|
||||
return msg;
|
||||
}
|
||||
if(images.size()==0){
|
||||
msg.setCode("404");
|
||||
msg.setInfo("为获取到图像信息");
|
||||
return msg;
|
||||
}
|
||||
for (int i = 0; i < images.size(); i++) {
|
||||
Integer imgid = images.getInteger(i);
|
||||
Images image = imgService.selectByPrimaryKey(imgid);
|
||||
Integer keyid = image.getSource();
|
||||
String imgname = image.getImgname();
|
||||
Keys key = keysService.selectKeys(keyid);
|
||||
|
||||
if(!subject.hasRole("admin")){
|
||||
if(image.getUserid()!=user.getId()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
//删除图片
|
||||
boolean isDele = false;
|
||||
try{
|
||||
if (key.getStorageType() == 1) {
|
||||
isDele = nosImageupload.delNOS(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 2) {
|
||||
isDele = ossImageupload.delOSS(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 3) {
|
||||
isDele = ussImageupload.delUSS(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 4) {
|
||||
isDele = kodoImageupload.delKODO(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 5) {
|
||||
isDele = LocUpdateImg.deleteLOCImg(imgname);
|
||||
}else if (key.getStorageType() == 6) {
|
||||
isDele = cosImageupload.delCOS(key.getId(), imgname);
|
||||
}else if (key.getStorageType() == 7) {
|
||||
isDele = ftpImageupload.delFTP(key.getId(), imgname);
|
||||
}else if (key.getStorageType() == 8) {
|
||||
isDele = uFileImageupload.delUFile(key.getId(), imgname);
|
||||
}else {
|
||||
System.err.println("未获取到对象存储参数,删除失败。");
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//删除库
|
||||
if(isDele){
|
||||
try {
|
||||
//删除图像表之前先删除临时数据表,图像表也会删除
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(imgid);
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setInfo("图片记录删除失败,请重试");
|
||||
msg.setCode("500");
|
||||
return msg;
|
||||
}
|
||||
msg.setInfo("删除成功");
|
||||
}else{
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(imgid);
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
msg.setInfo("图片记录已删除,但是图片源删除失败");
|
||||
}
|
||||
}
|
||||
System.out.println("返回的值:"+msg.toString());
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
//工具函数
|
||||
|
||||
@@ -3,10 +3,7 @@ package cn.hellohao.controller;
|
||||
import cn.hellohao.pojo.*;
|
||||
import cn.hellohao.service.*;
|
||||
import cn.hellohao.service.impl.*;
|
||||
import cn.hellohao.utils.GetCurrentSource;
|
||||
import cn.hellohao.utils.Print;
|
||||
import cn.hellohao.utils.SetFiles;
|
||||
import cn.hellohao.utils.StringUtils;
|
||||
import cn.hellohao.utils.*;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -53,10 +50,11 @@ public class AdminRootController {
|
||||
private GroupService groupService;
|
||||
@Autowired
|
||||
private ImgService imgService;
|
||||
@Autowired
|
||||
private ImgreviewService imgreviewService;
|
||||
|
||||
|
||||
@PostMapping(value = "/getUserList")//new selectusertable
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/getUserList")//new
|
||||
public Map<String, Object> getUserList(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
JSONObject jsonObj = JSONObject.parseObject(data);
|
||||
Integer pageNum = jsonObj.getInteger("pageNum");
|
||||
@@ -181,8 +179,6 @@ public class AdminRootController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
//获取当前所有的存储策略信息
|
||||
@PostMapping("/LoadInfo")//new
|
||||
@ResponseBody
|
||||
public Msg LoadInfo(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
@@ -190,7 +186,6 @@ public class AdminRootController {
|
||||
try {
|
||||
JSONObject jsonData = JSONObject.parseObject(data);
|
||||
Integer keyId = jsonData.getInteger("keyId");
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("id",keyId);
|
||||
Keys key = keysService.selectKeys(keyId);
|
||||
@@ -210,7 +205,6 @@ public class AdminRootController {
|
||||
}else if(key.getStorageType()==8){
|
||||
ret = UFileImageupload.Initialize(key);
|
||||
}
|
||||
|
||||
Long l = imgService.getsourcememory(keyId);
|
||||
jsonObject.put("isok",ret);
|
||||
jsonObject.put("storagetype",key.getStorageType());
|
||||
@@ -265,7 +259,7 @@ public class AdminRootController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getSettingConfig") //new upload配置表的相关设置
|
||||
@PostMapping("/getSettingConfig") //new
|
||||
@ResponseBody
|
||||
public Msg getSettingConfig(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
final Msg msg = new Msg();
|
||||
@@ -276,9 +270,6 @@ public class AdminRootController {
|
||||
UploadConfig uploadConfig = uploadConfigService.getUpdateConfig();
|
||||
Config config = configService.getSourceype();
|
||||
SysConfig sysConfig = sysConfigService.getstate();
|
||||
//把字节换算一下,页面上显示M
|
||||
// filesizetourists = (filesizetourists*1024*1024) ,filesizeuser=(filesizeuser*1024*1024)
|
||||
// visitormemory=(visitormemory*1024*1024),usermemory=(usermemory*1024*1024)
|
||||
uploadConfig.setUsermemory(Long.toString(Long.valueOf(uploadConfig.getUsermemory())/1024/1024));
|
||||
uploadConfig.setVisitormemory(Long.toString(Long.valueOf(uploadConfig.getVisitormemory())/1024/1024));
|
||||
uploadConfig.setFilesizetourists(Long.toString(Long.valueOf(uploadConfig.getFilesizetourists())/1024/1024));
|
||||
@@ -321,11 +312,9 @@ public class AdminRootController {
|
||||
uploadConfig.setFilesizetourists(Long.toString(Long.valueOf(uploadConfig.getFilesizetourists())*1024*1024));
|
||||
uploadConfig.setUsermemory(Long.toString(Long.valueOf(uploadConfig.getUsermemory())*1024*1024));
|
||||
uploadConfig.setFilesizeuser(Long.toString(Long.valueOf(uploadConfig.getFilesizeuser())*1024*1024));
|
||||
|
||||
uploadConfigService.setUpdateConfig(uploadConfig);
|
||||
configService.setSourceype(config);
|
||||
sysConfigService.setstate(sysConfig);
|
||||
|
||||
msg.setInfo("配置保存成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
@@ -336,5 +325,70 @@ public class AdminRootController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/getOrderConfig")//new
|
||||
@ResponseBody
|
||||
public Msg emailconfig() {
|
||||
final Msg msg = new Msg();
|
||||
EmailConfig emailConfig = null;
|
||||
Imgreview imgreview = null;
|
||||
try {
|
||||
final JSONObject jsonObject = new JSONObject();
|
||||
emailConfig = emailConfigService.getemail();
|
||||
imgreview = imgreviewService.selectByPrimaryKey(1);
|
||||
jsonObject.put("emailConfig",emailConfig);
|
||||
jsonObject.put("imgreview",imgreview);
|
||||
msg.setData(jsonObject);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setCode("110500");
|
||||
msg.setInfo("获取相关配置信息失败");
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/updateEmailConfig") //new
|
||||
@ResponseBody
|
||||
public Msg updateemail(@RequestParam(value = "data", defaultValue = "") String data ) {
|
||||
final Msg msg = new Msg();
|
||||
try {
|
||||
JSONObject jsonObj = JSONObject.parseObject(data);
|
||||
EmailConfig emailConfig = JSON.toJavaObject(jsonObj,EmailConfig.class);
|
||||
if(null==emailConfig.getId() || null==emailConfig.getEmailname() || null==emailConfig.getEmailurl() || null==emailConfig.getEmails()
|
||||
|| null==emailConfig.getEmailkey() || null==emailConfig.getPort() || null==emailConfig.getUsing()
|
||||
|| emailConfig.getEmailname().equals("") || emailConfig.getEmailurl().equals("") || emailConfig.getEmails().equals("")
|
||||
|| emailConfig.getEmailkey().equals("") || emailConfig.getPort().equals("")){
|
||||
msg.setCode("110400");
|
||||
msg.setInfo("各参数不能为空");
|
||||
return msg;
|
||||
}
|
||||
emailConfigService.updateemail(emailConfig);
|
||||
msg.setInfo("保存成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setCode("110500");
|
||||
msg.setInfo("保存过程出现错误");
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
@PostMapping("/mailTest") //new
|
||||
@ResponseBody
|
||||
public Msg mailTest(@RequestParam(value = "data", defaultValue = "") String data ) {
|
||||
Msg msg = new Msg();
|
||||
JSONObject jsonObj = JSONObject.parseObject(data);
|
||||
String tomail = jsonObj.getString("tomail");
|
||||
EmailConfig emailConfig = JSON.toJavaObject(jsonObj,EmailConfig.class);
|
||||
if(null==emailConfig.getEmails() || null==emailConfig.getEmailkey() || null==emailConfig.getEmailurl()
|
||||
|| null==emailConfig.getPort() || null==emailConfig.getEmailname() || null==tomail){
|
||||
// if(jsonObj.size()==0){
|
||||
msg.setCode("110400");
|
||||
msg.setInfo("邮箱配置参数不能为空");
|
||||
}else{
|
||||
msg = NewSendEmail.sendTestEmail(emailConfig, tomail);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package cn.hellohao.controller;
|
||||
|
||||
import cn.hellohao.pojo.*;
|
||||
import cn.hellohao.pojo.vo.PageResultBean;
|
||||
import cn.hellohao.service.*;
|
||||
import cn.hellohao.service.impl.AlbumServiceImpl;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -39,7 +40,7 @@ public class AlbumController {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@PostMapping("/admin/getGalleryList") //new 获取画廊地址
|
||||
@PostMapping("/admin/getGalleryList") //new
|
||||
@ResponseBody
|
||||
public Map<String, Object> getGalleryList (@RequestParam(value = "data", defaultValue = "") String data){
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
@@ -177,8 +178,82 @@ public class AlbumController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/checkPass")//new
|
||||
@ResponseBody
|
||||
public Msg checkPass(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
Msg msg = new Msg();
|
||||
JSONObject json = new JSONObject();
|
||||
JSONObject jsonObject = null;
|
||||
try {
|
||||
jsonObject = JSONObject.parseObject(data);
|
||||
String key = jsonObject.getString("key");
|
||||
Album album = new Album();
|
||||
album.setAlbumkey(key);
|
||||
Album a = albumServiceImpl.selectAlbum(album);
|
||||
if(a!=null){
|
||||
json.put("album",a);
|
||||
json.put("exist",true);
|
||||
if(a.getPassword()!=null && !a.getPassword().equals("")){
|
||||
json.put("passType",true);
|
||||
}else{
|
||||
json.put("passType",false);
|
||||
}
|
||||
msg.setData(json);
|
||||
}else{
|
||||
json.put("exist",false);
|
||||
msg.setData(json);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setCode("110500");
|
||||
msg.setInfo("操作失败");
|
||||
msg.setData(json);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getAlbumList") //new
|
||||
@ResponseBody
|
||||
public Msg getAlbumList(@RequestParam(value = "data", defaultValue = "") String data){
|
||||
Msg msg = new Msg();
|
||||
JSONObject json = new JSONObject();
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
Integer pageNum = jsonObject.getInteger("pageNum");
|
||||
Integer pageSize = jsonObject.getInteger("pageSize");
|
||||
String albumkey = jsonObject.getString("albumkey");
|
||||
String password = jsonObject.getString("password");
|
||||
if(null!=password){
|
||||
password = password.replace(" ", "");
|
||||
}
|
||||
Album album = new Album();
|
||||
album.setAlbumkey(albumkey);
|
||||
Album a = albumServiceImpl.selectAlbum(album);
|
||||
if(a==null){
|
||||
msg.setCode("110404");
|
||||
msg.setInfo("画廊地址不存在");
|
||||
}else{
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
if(a.getPassword()==null || (a.getPassword().replace(" ", "")).equals("")){
|
||||
List<Images> imagesList = imgAndAlbumService.selectImgForAlbumkey(albumkey);
|
||||
PageInfo<Images> rolePageInfo = new PageInfo<>(imagesList);
|
||||
PageResultBean<Images> pageResultBean = new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList());
|
||||
json.put("imagesList",pageResultBean);
|
||||
}else{
|
||||
if(a.getPassword().equals(password)){
|
||||
List<Images> imagesList = imgAndAlbumService.selectImgForAlbumkey(albumkey);
|
||||
PageInfo<Images> rolePageInfo = new PageInfo<>(imagesList);
|
||||
PageResultBean<Images> pageResultBean = new PageResultBean<>(rolePageInfo.getTotal(), rolePageInfo.getList());
|
||||
json.put("imagesList",pageResultBean);
|
||||
}else{
|
||||
msg.setCode("110403");
|
||||
msg.setInfo("画廊密码错误");
|
||||
}
|
||||
}
|
||||
json.put("titlename",a.getAlbumtitle());
|
||||
msg.setData(json);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -29,35 +29,17 @@ import java.util.*;
|
||||
*/
|
||||
@RestController
|
||||
public class ClientController {
|
||||
@Autowired
|
||||
private NOSImageupload nOSImageupload;
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private KeysService keysService;
|
||||
@Autowired
|
||||
private OSSImageupload ossImageupload;
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
@Autowired
|
||||
private USSImageupload ussImageupload;
|
||||
@Autowired
|
||||
private KODOImageupload kodoImageupload;
|
||||
@Autowired
|
||||
private UploadConfigService uploadConfigService;
|
||||
@Autowired
|
||||
private NoticeService noticeService;
|
||||
@Autowired
|
||||
private COSImageupload cosImageupload;
|
||||
@Autowired
|
||||
private FTPImageupload ftpImageupload;
|
||||
@Autowired
|
||||
private UFileImageupload uFileImageupload;
|
||||
@Autowired
|
||||
private ImgService imgService;
|
||||
|
||||
@Value("${systemupdate}")
|
||||
private String systemupdate;
|
||||
@Autowired
|
||||
private ClientService clientService;
|
||||
|
||||
|
||||
@PostMapping(value = "/uploadbymail")
|
||||
@ResponseBody
|
||||
public Msg uploadbymail(HttpServletRequest request, @RequestParam("file") MultipartFile file, String mail, String pass) {
|
||||
Msg resultBean = clientService.uploadImg(request, file, mail, pass);
|
||||
return resultBean;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
package cn.hellohao.controller;
|
||||
|
||||
import cn.hellohao.pojo.Code;
|
||||
import cn.hellohao.pojo.Config;
|
||||
import cn.hellohao.pojo.Msg;
|
||||
import cn.hellohao.pojo.User;
|
||||
import cn.hellohao.service.CodeService;
|
||||
import cn.hellohao.service.KeysService;
|
||||
import cn.hellohao.service.UserService;
|
||||
import cn.hellohao.service.impl.ImgServiceImpl;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -18,8 +13,6 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package cn.hellohao.controller;
|
||||
|
||||
import cn.hellohao.pojo.Msg;
|
||||
import org.springframework.boot.web.servlet.error.ErrorController;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 错误页面拦截
|
||||
* */
|
||||
|
||||
@Controller
|
||||
class MainsiteErrorController implements ErrorController {
|
||||
|
||||
@RequestMapping("/error")
|
||||
public String handleError(HttpServletRequest request){
|
||||
//获取statusCode:401,404,500
|
||||
Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
|
||||
if(statusCode == 401){
|
||||
return "401";
|
||||
}else if(statusCode == 404){
|
||||
return "404";
|
||||
}else if(statusCode == 403){
|
||||
return "403";
|
||||
}else{
|
||||
return "500";
|
||||
}
|
||||
|
||||
}
|
||||
//认证失败
|
||||
@RequestMapping("/jurisError")
|
||||
@ResponseBody
|
||||
public Msg jurisError(HttpServletRequest request){
|
||||
Msg msg = new Msg();
|
||||
msg.setCode("4031");
|
||||
msg.setInfo("Authentication request failed");
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -67,20 +67,5 @@ public class ExceptionHandling {
|
||||
|
||||
|
||||
|
||||
// @ExceptionHandler
|
||||
// public String methodArgumentNotValid(BindException e) {
|
||||
// List<ObjectError> allErrors = e.getBindingResult().getAllErrors();
|
||||
// StringBuilder errorMessage = new StringBuilder();
|
||||
// for (int i = 0; i < allErrors.size(); i++) {
|
||||
// ObjectError error = allErrors.get(i);
|
||||
// errorMessage.append(error.getDefaultMessage());
|
||||
// if (i != allErrors.size() - 1) {
|
||||
// errorMessage.append(", ");
|
||||
// }
|
||||
// }
|
||||
// // do something
|
||||
// System.out.println(errorMessage.toString());// 这里面是错误信息
|
||||
// return errorMessage.toString();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
package cn.hellohao.controller;
|
||||
|
||||
import cn.hellohao.pojo.Group;
|
||||
import cn.hellohao.pojo.Keys;
|
||||
import cn.hellohao.pojo.Msg;
|
||||
import cn.hellohao.pojo.User;
|
||||
import cn.hellohao.service.GroupService;
|
||||
import cn.hellohao.service.KeysService;
|
||||
import cn.hellohao.service.UserService;
|
||||
import cn.hellohao.utils.StringUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -52,8 +45,6 @@ public class GroupController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
//获取code列表
|
||||
@PostMapping(value = "/getGroupList")//new
|
||||
@ResponseBody
|
||||
public Map<String, Object> getgrouplist(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
@@ -78,7 +69,6 @@ public class GroupController {
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/addGroup")//new
|
||||
@ResponseBody
|
||||
public Msg addisgroup(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
@@ -95,7 +85,6 @@ public class GroupController {
|
||||
@PostMapping("/updateGroup")//new
|
||||
@ResponseBody
|
||||
public Msg updategroup(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
Group group = new Group();
|
||||
group.setId(jsonObject.getInteger("id"));
|
||||
|
||||
@@ -1,43 +1,61 @@
|
||||
package cn.hellohao.controller;
|
||||
|
||||
import cn.hellohao.pojo.Imgreview;
|
||||
import cn.hellohao.pojo.Msg;
|
||||
import cn.hellohao.service.ImgreviewService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/admin")
|
||||
@RequestMapping("/admin/root")
|
||||
public class ImageReviewController {
|
||||
|
||||
@Autowired
|
||||
private ImgreviewService imgreviewService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/root/ImageReview")
|
||||
public String ForwardImageReview(Model model) {
|
||||
Imgreview imgreview = imgreviewService.selectByPrimaryKey(1);
|
||||
model.addAttribute("appid", imgreview.getAppId());
|
||||
model.addAttribute("apikey", imgreview.getApiKey());
|
||||
model.addAttribute("secretkey", imgreview.getSecretKey());
|
||||
model.addAttribute("using", imgreview.getUsing());
|
||||
return "admin/imageIdentify";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/root/ImgreviewSwitch")
|
||||
@PostMapping("/updateimgReviewConfig") //new
|
||||
@ResponseBody
|
||||
public String ImgreviewSwitch(String appId, String apiKey, String secretKey, Integer using) {
|
||||
Imgreview imgreview = new Imgreview();
|
||||
imgreview.setId(1);//目前就一种鉴黄功能所以设死了
|
||||
imgreview.setUsing(using);
|
||||
imgreview.setAppId(appId);
|
||||
imgreview.setApiKey(apiKey);
|
||||
imgreview.setSecretKey(secretKey);
|
||||
Integer ret = imgreviewService.updateByPrimaryKeySelective(imgreview);
|
||||
|
||||
return ret.toString();
|
||||
public Msg updateimgReviewConfig(@RequestParam(value = "data", defaultValue = "") String data ) {
|
||||
final Msg msg = new Msg();
|
||||
try {
|
||||
JSONObject jsonObj = JSONObject.parseObject(data);
|
||||
Imgreview imgreview = JSON.toJavaObject(jsonObj,Imgreview.class);
|
||||
if(imgreview.getId()==1){
|
||||
if(null==imgreview.getId() || null==imgreview.getApiKey() || null==imgreview.getUsing() || null==imgreview.getSecretKey()
|
||||
|| null==imgreview.getAppId() || imgreview.getApiKey().equals("")
|
||||
|| imgreview.getSecretKey().equals("") || imgreview.getAppId().equals("")){
|
||||
msg.setCode("110400");
|
||||
msg.setInfo("各参数不能为空");
|
||||
return msg;
|
||||
}
|
||||
}else{
|
||||
if(null==imgreview.getId() || null==imgreview.getApiKey() || null==imgreview.getUsing()
|
||||
|| imgreview.getApiKey().equals("")
|
||||
){
|
||||
msg.setCode("110400");
|
||||
msg.setInfo("各参数不能为空");
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
if(null == imgreviewService.selectByPrimaryKey(imgreview.getId())){
|
||||
imgreviewService.insert(imgreview);
|
||||
}else{
|
||||
imgreviewService.updateByPrimaryKeySelective(imgreview);
|
||||
}
|
||||
msg.setInfo("保存成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setCode("110500");
|
||||
msg.setInfo("保存过程出现错误");
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,62 +14,55 @@ import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
public class IndexController {
|
||||
@Autowired
|
||||
private ImgService imgService;
|
||||
@Autowired
|
||||
private SysConfigService sysConfigService;
|
||||
@Autowired
|
||||
IRedisService iRedisService;
|
||||
@Autowired
|
||||
private NOSImageupload nOSImageupload;
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private KeysService keysService;
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
@Autowired
|
||||
private UploadConfigService uploadConfigService;
|
||||
@Autowired
|
||||
private USSImageupload ussImageupload;
|
||||
private UploadServicel uploadServicel;
|
||||
@Autowired
|
||||
private KODOImageupload kodoImageupload;
|
||||
private NOSImageupload nosImageupload;
|
||||
@Autowired
|
||||
private OSSImageupload ossImageupload;
|
||||
@Autowired
|
||||
private COSImageupload cosImageupload;
|
||||
@Autowired
|
||||
private KODOImageupload kodoImageupload;
|
||||
@Autowired
|
||||
private USSImageupload ussImageupload;
|
||||
@Autowired
|
||||
private UFileImageupload uFileImageupload;
|
||||
@Autowired
|
||||
private FTPImageupload ftpImageupload;
|
||||
@Autowired
|
||||
private ImgService imgService;
|
||||
AlbumServiceImpl albumService;
|
||||
@Autowired
|
||||
private UploadServicel uploadServicel;
|
||||
|
||||
private String[] iparr;
|
||||
|
||||
public static String vu;
|
||||
private KeysService keysService;
|
||||
@Autowired
|
||||
private ImgTempService imgTempService;
|
||||
@Autowired
|
||||
private ImgAndAlbumService imgAndAlbumService;
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/webInfo")//upimg new
|
||||
@RequestMapping(value = "/webInfo")
|
||||
@ResponseBody
|
||||
public Msg webInfo(HttpSession httpSession) {
|
||||
public Msg webInfo() {
|
||||
final Msg msg = new Msg();
|
||||
Config config = configService.getSourceype();
|
||||
UploadConfig updateConfig = uploadConfigService.getUpdateConfig();
|
||||
@@ -86,8 +79,6 @@ public class IndexController {
|
||||
jsonObject.put("aboutinfo",config.getAboutinfo());
|
||||
jsonObject.put("logo",config.getLogo());
|
||||
jsonObject.put("api",updateConfig.getApi());
|
||||
// jsonObject.put("watermark",updateConfig.getWatermark());
|
||||
// jsonObject.put("guidepage",sysConfig.getGuidepage());
|
||||
jsonObject.put("register",sysConfig.getRegister());
|
||||
msg.setData(jsonObject);
|
||||
return msg;
|
||||
@@ -109,11 +100,6 @@ public class IndexController {
|
||||
return uploadServicel.uploadForLoc(request,multipartFile,day,null,jsonArray);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = "/getUploadInfo")//new
|
||||
@ResponseBody
|
||||
public Msg getUploadInfo() {
|
||||
@@ -148,19 +134,13 @@ public class IndexController {
|
||||
String token = request.getHeader("Authorization");
|
||||
if(token != null) {
|
||||
JSONObject tokenJson = JWTUtil.checkToken(token);
|
||||
// boolean check = (boolean) result.get("check");
|
||||
// String password = (String) result.get("password");
|
||||
if(tokenJson.getBoolean("check")){
|
||||
//获取当前用户
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
//封装用户的登录数据(shiro认证的时候使用)
|
||||
UsernamePasswordToken tokenOBJ = new UsernamePasswordToken(tokenJson.getString("email"),tokenJson.getString("password"));
|
||||
//设置记住我
|
||||
tokenOBJ.setRememberMe(true);
|
||||
try {
|
||||
//执行登录方法,如果没有异常,说明登录成功
|
||||
subject.login(tokenOBJ);
|
||||
SecurityUtils.getSubject().getSession().setTimeout(3600000);//一小时
|
||||
SecurityUtils.getSubject().getSession().setTimeout(3600000);
|
||||
User u = (User) subject.getPrincipal();
|
||||
final JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("RoleLevel",u.getLevel()==2?"admin":"user");
|
||||
@@ -168,7 +148,6 @@ public class IndexController {
|
||||
msg.setCode("200");
|
||||
msg.setData(jsonObject);
|
||||
} catch (Exception e) {
|
||||
//此异常说明用户名不存在
|
||||
msg.setCode("40041");
|
||||
msg.setInfo("登录失效,请重新登录");
|
||||
System.err.println("登录失效,请重新登录");
|
||||
@@ -246,8 +225,92 @@ public class IndexController {
|
||||
}
|
||||
}
|
||||
|
||||
//删除图像
|
||||
@PostMapping("/deleImagesByUid") //new
|
||||
@ResponseBody
|
||||
public Msg deleImagesByUid(@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
Msg msg = new Msg();
|
||||
JSONObject jsonObj = JSONObject.parseObject(data);
|
||||
String imguid = jsonObj.getString("imguid");
|
||||
Images image = imgService.selectImgUrlByImgUID(imguid);
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User user = (User) subject.getPrincipal();
|
||||
if(null!=user){
|
||||
if(user.getId()!=image.getUserid()){
|
||||
msg.setInfo("删除失败,该图片不允许你执行操作");
|
||||
msg.setCode("100403");
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
Integer keyid = image.getSource();
|
||||
String imgname = image.getImgname();
|
||||
Keys key = keysService.selectKeys(keyid);
|
||||
//删除图片
|
||||
boolean isDele = false;
|
||||
if (key.getStorageType() == 1) {
|
||||
isDele = nosImageupload.delNOS(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 2) {
|
||||
isDele = ossImageupload.delOSS(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 3) {
|
||||
isDele = ussImageupload.delUSS(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 4) {
|
||||
isDele = kodoImageupload.delKODO(key.getId(), imgname);
|
||||
} else if (key.getStorageType() == 5) {
|
||||
isDele = LocUpdateImg.deleteLOCImg(imgname);
|
||||
}else if (key.getStorageType() == 6) {
|
||||
isDele = cosImageupload.delCOS(key.getId(), imgname);
|
||||
}else if (key.getStorageType() == 7) {
|
||||
isDele = ftpImageupload.delFTP(key.getId(), imgname);
|
||||
}else if (key.getStorageType() == 8) {
|
||||
isDele = uFileImageupload.delUFile(key.getId(), imgname);
|
||||
}else {
|
||||
System.err.println("未获取到对象存储参数,删除失败。");
|
||||
}
|
||||
//删除库
|
||||
if(isDele){
|
||||
try {
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(image.getId());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setInfo("图片记录时发生错误");
|
||||
msg.setCode("500");
|
||||
return msg;
|
||||
}
|
||||
msg.setInfo("删除成功");
|
||||
}else{
|
||||
imgAndAlbumService.deleteImgAndAlbum(imgname);
|
||||
imgTempService.delImgAndExp(image.getImguid());
|
||||
imgService.deleimg(image.getId());
|
||||
msg.setInfo("图片记录已删除,但是图片源删除失败");
|
||||
msg.setCode("500");
|
||||
}
|
||||
System.out.println("返回的值:"+msg.toString());
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
//没有权限
|
||||
@RequestMapping("/authError")
|
||||
@ResponseBody
|
||||
public Msg authError(HttpServletRequest request){
|
||||
Msg msg = new Msg();
|
||||
msg.setCode("4031");
|
||||
msg.setInfo("You don't have authority");
|
||||
return msg;
|
||||
}
|
||||
|
||||
//认证失败
|
||||
@RequestMapping("/jurisError")
|
||||
@ResponseBody
|
||||
public Msg jurisError(HttpServletRequest request){
|
||||
Msg msg = new Msg();
|
||||
msg.setCode("4031");
|
||||
msg.setInfo("Authentication request failed");
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import cn.hellohao.config.SysName;
|
||||
import cn.hellohao.pojo.*;
|
||||
import cn.hellohao.service.*;
|
||||
import cn.hellohao.utils.*;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.IncorrectCredentialsException;
|
||||
import org.apache.shiro.authc.UnknownAccountException;
|
||||
@@ -54,16 +55,13 @@ public class UserController {
|
||||
String userIP = GetIPS.getIpAddr(request);
|
||||
String verifyCodeForRegister = jsonObj.getString("verifyCode");
|
||||
Object redis_verifyCodeForRegister = iRedisService.getValue(userIP+"_hellohao_verifyCodeForRegister");
|
||||
|
||||
if(!SetText.checkEmail(email)){
|
||||
//邮箱格式不正确
|
||||
msg.setCode("110403");
|
||||
msg.setInfo("邮箱格式不正确");
|
||||
return msg;
|
||||
}
|
||||
String regex = "^\\w+$";
|
||||
if(username.length()>20 || !username.matches (regex)){
|
||||
//用户名格式不正确
|
||||
msg.setCode("110403");
|
||||
msg.setInfo("用户名不得超过20位字符");
|
||||
return msg;
|
||||
@@ -135,7 +133,6 @@ public class UserController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
//shiro登录认证
|
||||
@PostMapping("/login")//new
|
||||
@ResponseBody
|
||||
public Msg login(HttpServletRequest request,@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
@@ -156,15 +153,10 @@ public class UserController {
|
||||
return msg;
|
||||
}
|
||||
if((redis_VerifyCode.toString().toLowerCase()).compareTo((verifyCode.toLowerCase()))==0){
|
||||
// if(true){
|
||||
//获取当前用户
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
//封装用户的登录数据(shiro认证的时候使用)
|
||||
UsernamePasswordToken tokenOBJ = new UsernamePasswordToken(email,password);
|
||||
//设置记住我
|
||||
tokenOBJ.setRememberMe(true);
|
||||
try {
|
||||
//执行登录方法,如果没有异常,说明登录成功
|
||||
subject.login(tokenOBJ);
|
||||
SecurityUtils.getSubject().getSession().setTimeout(3600000);//一小时
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -179,7 +171,6 @@ public class UserController {
|
||||
msg.setCode("110403");
|
||||
return msg;
|
||||
}
|
||||
// String token = TokenUtil.sign(user);
|
||||
String token = JWTUtil.createToken(user);
|
||||
Subject su = SecurityUtils.getSubject();
|
||||
System.out.println("当前用户角色:admin:"+su.hasRole("admin"));
|
||||
@@ -216,8 +207,33 @@ public class UserController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//邮箱激活
|
||||
@RequestMapping(value = "/activation", method = RequestMethod.GET)
|
||||
public String activation(Model model, HttpServletRequest request, HttpSession session, String activation, String username) {
|
||||
Config config = configService.getSourceype();
|
||||
Integer ret = 0;
|
||||
User u2 = new User();
|
||||
u2.setUid(activation);
|
||||
User user = userService.getUsers(u2);
|
||||
model.addAttribute("webhost",SubjectFilter.WEBHOST);
|
||||
if (user != null && user.getIsok() == 0) {
|
||||
userService.uiduser(activation);
|
||||
model.addAttribute("title","激活成功");
|
||||
model.addAttribute("name","Hi~"+username);
|
||||
model.addAttribute("note","您的账号已成功激活看");
|
||||
return "msg";
|
||||
} else {
|
||||
model.addAttribute("title","操作无效");
|
||||
model.addAttribute("name","该页面为无效页面");
|
||||
model.addAttribute("note","请返回首页");
|
||||
return "msg";
|
||||
}
|
||||
}
|
||||
|
||||
//退出
|
||||
@PostMapping(value = "/logout")
|
||||
@PostMapping(value = "/logout")//new
|
||||
@ResponseBody
|
||||
public Msg exit(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
|
||||
Msg msg = new Msg();
|
||||
@@ -228,7 +244,8 @@ public class UserController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@PostMapping("/retrievePass")
|
||||
//retrievepass
|
||||
@PostMapping("/retrievePass") //new
|
||||
@ResponseBody
|
||||
public Msg retrievePass(HttpServletRequest request, @RequestParam(value = "data", defaultValue = "") String data) {
|
||||
Msg msg = new Msg();
|
||||
@@ -238,6 +255,7 @@ public class UserController {
|
||||
String retrieveCode = jsonObj.getString("retrieveCode");
|
||||
String userIP = GetIPS.getIpAddr(request);
|
||||
Object redis_verifyCodeForEmailRetrieve = iRedisService.getValue(userIP+"_hellohao_verifyCodeForEmailRetrieve");
|
||||
|
||||
EmailConfig emailConfig = emailConfigService.getemail();
|
||||
if(null==redis_verifyCodeForEmailRetrieve){
|
||||
msg.setCode("4035");
|
||||
@@ -290,47 +308,43 @@ public class UserController {
|
||||
}
|
||||
|
||||
//邮箱激活
|
||||
@RequestMapping(value = "/activation", method = RequestMethod.GET)
|
||||
public String activation(Model model, HttpServletRequest request, HttpSession session, String activation, String username) {
|
||||
Config config = configService.getSourceype();
|
||||
@RequestMapping(value = "/retrieve", method = RequestMethod.GET) //new
|
||||
public String retrieve(Model model, String activation,String cip) {
|
||||
Integer ret = 0;
|
||||
User u2 = new User();
|
||||
u2.setUid(activation);
|
||||
User user = userService.getUsers(u2);
|
||||
try {
|
||||
User u2 = new User();
|
||||
u2.setUid(activation);
|
||||
User user = userService.getUsers(u2);
|
||||
user.setIsok(1);
|
||||
String new_pass = HexUtil.decodeHexStr(cip);//解密密码
|
||||
user.setPassword(Base64Encryption.encryptBASE64(new_pass.getBytes()));
|
||||
String uid = UUID.randomUUID().toString().replace("-", "").toLowerCase();
|
||||
user.setUid(uid);
|
||||
if (user != null) {
|
||||
Integer r = userService.changeUser(user);
|
||||
model.addAttribute("title","成功");
|
||||
model.addAttribute("name","新密码:"+new_pass);//
|
||||
model.addAttribute("note","密码已被系统重置,请即使登录修改你的新密码");
|
||||
} else {
|
||||
model.addAttribute("title","抱歉");
|
||||
model.addAttribute("name","为获取到用户信息");
|
||||
model.addAttribute("note","操作失败");
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
model.addAttribute("title","抱歉");
|
||||
model.addAttribute("name","系统操作过程中发生错误");
|
||||
model.addAttribute("note","操作失败");
|
||||
}
|
||||
model.addAttribute("webhost", SubjectFilter.WEBHOST);
|
||||
if (user != null && user.getIsok() == 0) {
|
||||
userService.uiduser(activation);
|
||||
model.addAttribute("title","激活成功");
|
||||
model.addAttribute("name","Hi~"+username);
|
||||
model.addAttribute("note","您的账号已成功激活看");
|
||||
return "msg";
|
||||
} else {
|
||||
model.addAttribute("title","操作无效");
|
||||
model.addAttribute("name","该页面为无效页面");
|
||||
model.addAttribute("note","请返回首页");
|
||||
return "msg";
|
||||
}
|
||||
return "msg";
|
||||
}
|
||||
|
||||
}
|
||||
@PostMapping(value = "/verification")
|
||||
@ResponseBody
|
||||
public Integer verification(HttpSession session,Integer tmp,Integer type) {
|
||||
Random random = new Random();
|
||||
if(type==1){
|
||||
number1 = random.nextInt(100);
|
||||
istmp1 = tmp;
|
||||
Print.Normal(tmp-number1);
|
||||
}
|
||||
if(type==2){
|
||||
number2 = random.nextInt(100);
|
||||
istmp2 = tmp;
|
||||
Print.Normal(tmp-number2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private Integer number1;
|
||||
private Integer istmp1;
|
||||
private Integer number2;
|
||||
private Integer istmp2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface ImgMapper {
|
||||
|
||||
Long getsourcememory(@Param("source") Integer source);
|
||||
|
||||
Integer md5Count(@Param("md5key") String md5key);
|
||||
Integer md5Count(Images images);
|
||||
|
||||
Images selectImgUrlByMD5(@Param("md5key") String md5key);
|
||||
|
||||
@@ -46,5 +46,6 @@ public interface ImgMapper {
|
||||
|
||||
List<Images> countByM(Images images);
|
||||
|
||||
Images selectImgUrlByImgUID(@Param("imguid") String imguid);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ public class Images {
|
||||
private String notes;
|
||||
private String useridlist;
|
||||
private String imguid;
|
||||
private String shortlink;
|
||||
private String format;
|
||||
private String about;
|
||||
private Integer great;
|
||||
@@ -41,7 +40,7 @@ public class Images {
|
||||
super();
|
||||
}
|
||||
|
||||
public Images(String imgurl, String sizes, String abnormal, String updatetime, String username, String md5key, String imguid,String shortlink) {
|
||||
public Images(String imgurl, String sizes, String abnormal, String updatetime, String username, String md5key, String imguid) {
|
||||
this.imgurl = imgurl;
|
||||
this.sizes = sizes;
|
||||
this.abnormal = abnormal;
|
||||
@@ -54,7 +53,7 @@ public class Images {
|
||||
public Images(Integer id, String imgname, String imgurl, Integer userid, String sizes, String abnormal, Integer source,
|
||||
Integer imgtype, String updatetime, String username, Integer storageType, String starttime, String stoptime,
|
||||
String explains, String md5key, String notes, String useridlist, String imguid, String albumtitle,
|
||||
String password, Integer selecttype,Long countNum,Integer monthNum,String yyyy,String shortlink,
|
||||
String password, Integer selecttype,Long countNum,Integer monthNum,String yyyy,
|
||||
String format,String about,Integer great,String[] classifuidlist,String classificationuid,String violation) {
|
||||
this.id = id;
|
||||
this.imgname = imgname;
|
||||
@@ -74,7 +73,6 @@ public class Images {
|
||||
this.notes = notes;
|
||||
this.useridlist = useridlist;
|
||||
this.imguid = imguid;
|
||||
this.shortlink = shortlink;
|
||||
this.albumtitle = albumtitle;
|
||||
this.password = password;
|
||||
this.selecttype = selecttype;
|
||||
@@ -234,13 +232,6 @@ public class Images {
|
||||
this.imguid = imguid;
|
||||
}
|
||||
|
||||
public String getShortlink() {
|
||||
return shortlink;
|
||||
}
|
||||
|
||||
public void setShortlink(String shortlink) {
|
||||
this.shortlink = shortlink;
|
||||
}
|
||||
|
||||
public String getAlbumtitle() {
|
||||
return albumtitle;
|
||||
|
||||
@@ -8,13 +8,15 @@ package cn.hellohao.pojo;
|
||||
public class SysConfig {
|
||||
private Integer id;
|
||||
private Integer register;
|
||||
private String checkduplicate;
|
||||
|
||||
public SysConfig() {
|
||||
}
|
||||
|
||||
public SysConfig(Integer id, Integer register) {
|
||||
public SysConfig(Integer id, Integer register, String checkduplicate) {
|
||||
this.id = id;
|
||||
this.register = register;
|
||||
this.checkduplicate = checkduplicate;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -32,4 +34,14 @@ public class SysConfig {
|
||||
public void setRegister(Integer register) {
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public String getCheckduplicate() {
|
||||
return checkduplicate;
|
||||
}
|
||||
|
||||
public void setCheckduplicate(String checkduplicate) {
|
||||
this.checkduplicate = checkduplicate;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface ImgService {
|
||||
|
||||
Long getsourcememory(Integer source);
|
||||
|
||||
Integer md5Count(String md5key);
|
||||
Integer md5Count(Images images);
|
||||
|
||||
Images selectImgUrlByMD5(String md5key);
|
||||
|
||||
@@ -47,4 +47,6 @@ public interface ImgService {
|
||||
|
||||
List<Images> countByM(Images images);
|
||||
|
||||
Images selectImgUrlByImgUID( String imguid);
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public class COSImageupload {
|
||||
String userkey =username + "/" + ShortUID + "." + entry.getKey();
|
||||
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, userkey, file);
|
||||
PutObjectResult putObjectResult = cosClient.putObject(putObjectRequest);
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(userkey);
|
||||
returnImage.setImgurl(key.getRequestAddress() + "/" + userkey);
|
||||
returnImage.setImgSize(entry.getValue().length());
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
package cn.hellohao.service.impl;
|
||||
|
||||
import cn.hellohao.dao.*;
|
||||
import cn.hellohao.pojo.*;
|
||||
import cn.hellohao.pojo.vo.PageResultBean;
|
||||
import cn.hellohao.service.ImgAndAlbumService;
|
||||
import cn.hellohao.service.SysConfigService;
|
||||
import cn.hellohao.utils.*;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baidu.aip.contentcensor.AipContentCensor;
|
||||
import com.baidu.aip.contentcensor.EImgType;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import net.coobird.thumbnailator.filters.Watermark;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Hellohao
|
||||
* @version 1.0
|
||||
* @date 2021/10/28 16:38
|
||||
*/
|
||||
@Service
|
||||
public class ClientService {
|
||||
|
||||
@Autowired
|
||||
private ImgAndAlbumService imgAndAlbumService;
|
||||
@Autowired
|
||||
private NOSImageupload nOSImageupload;
|
||||
@Autowired
|
||||
private OSSImageupload ossImageupload;
|
||||
@Autowired
|
||||
private USSImageupload ussImageupload;
|
||||
@Autowired
|
||||
private KODOImageupload kodoImageupload;
|
||||
@Autowired
|
||||
private COSImageupload cosImageupload;
|
||||
@Autowired
|
||||
private SysConfigService sysConfigService;
|
||||
@Autowired
|
||||
private FTPImageupload ftpImageupload;
|
||||
@Autowired
|
||||
private UFileImageupload uFileImageupload;
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
@Autowired
|
||||
private KeysMapper keysMapper;
|
||||
@Autowired
|
||||
private ConfigMapper configMapper;
|
||||
@Autowired
|
||||
private UploadConfigMapper uploadConfigMapper;
|
||||
@Autowired
|
||||
private NoticeMapper noticeMapper;
|
||||
@Autowired
|
||||
private ImgMapper imgMapper;
|
||||
@Autowired
|
||||
ImgreviewMapper imgreviewMapper;
|
||||
|
||||
|
||||
public Msg uploadImg(HttpServletRequest request, MultipartFile multipartFile, String email, String pass ){
|
||||
Msg msg = new Msg();
|
||||
try {
|
||||
Integer sourceKeyId = 0;
|
||||
FileInputStream fis = null;
|
||||
String md5key = null;
|
||||
Integer setday = 0;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Config config = configMapper.getSourceype();
|
||||
String userip = GetIPS.getIpAddr(request);
|
||||
UploadConfig uploadConfig = uploadConfigMapper.getUpdateConfig();
|
||||
if (uploadConfig.getApi() != 1) {
|
||||
msg.setCode("4003");
|
||||
msg.setInfo("管理员关闭了API接口");
|
||||
return msg;
|
||||
}
|
||||
File file = SetFiles.changeFile_new(multipartFile);
|
||||
User u2 = new User();
|
||||
if (!file.exists() || email == null || pass == null) {
|
||||
msg.setCode("4005");
|
||||
msg.setInfo("必要参数不能为空");
|
||||
return msg;
|
||||
}
|
||||
u2.setEmail(email);
|
||||
u2.setPassword(Base64Encryption.encryptBASE64(pass.getBytes()));
|
||||
User u = userMapper.getUsers(u2);
|
||||
//判断用户的账号密码是否存在(正确)
|
||||
if (null == u || u.getIsok() != 1) {
|
||||
msg.setCode("4006");
|
||||
msg.setInfo("用户信息不正确,账号异常");
|
||||
return msg;
|
||||
}
|
||||
String imguid = UUID.randomUUID().toString().replace("-", "");
|
||||
//判断上传前的一些用户限制信息
|
||||
Msg msg1 = updateImgCheck(u, uploadConfig);
|
||||
if (!msg1.getCode().equals("300")) {
|
||||
return msg1;
|
||||
}
|
||||
sourceKeyId = group.getKeyid();
|
||||
Keys key = keysMapper.selectKeys(sourceKeyId);
|
||||
Long tmp = (memory == -1 ? -2 : UsedTotleMemory);
|
||||
if (tmp >= memory) {
|
||||
msg.setCode("4007");
|
||||
msg.setInfo(u == null ? "游客空间已用尽" : "您的可用空间不足");
|
||||
return msg;
|
||||
}
|
||||
if (file.length() > TotleMemory) {
|
||||
System.err.println("文件大小:" + file.length());
|
||||
System.err.println("最大限制:" + TotleMemory);
|
||||
msg.setCode("4008");
|
||||
msg.setInfo("图像超出系统限制大小");
|
||||
return msg;
|
||||
}
|
||||
try {
|
||||
fis = new FileInputStream(file);
|
||||
md5key = DigestUtils.md5Hex(fis);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("未获取到图片的MD5,成成UUID");
|
||||
}
|
||||
Msg fileMiME = TypeDict.FileMiME(file, uploadConfig.getSuffix());
|
||||
if (!fileMiME.getCode().equals("200")) {
|
||||
//非图像文本
|
||||
msg.setCode("4009");
|
||||
msg.setInfo(fileMiME.getInfo());
|
||||
return msg;
|
||||
}
|
||||
if (md5key == null || md5key.equals("")) {
|
||||
md5key = UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
String prefix = file.getName().substring(file.getName().lastIndexOf(".") + 1);
|
||||
if (uploadConfig.getBlacklist() != null) {
|
||||
String[] iparr = uploadConfig.getBlacklist().split(";");
|
||||
for (String s : iparr) {
|
||||
if (s.equals(userip)) {
|
||||
msg.setCode("4010");
|
||||
msg.setInfo("你暂时不能上传");
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
//判断图片是否存在
|
||||
if(Integer.valueOf(sysConfigService.getstate().getCheckduplicate())==1) {
|
||||
Images imaOBJ = new Images();
|
||||
imaOBJ.setMd5key(md5key);
|
||||
imaOBJ.setUserid(u.getId());
|
||||
if (imgMapper.md5Count(imaOBJ) > 0) {
|
||||
Images images = imgMapper.selectImgUrlByMD5(md5key);
|
||||
jsonObject.put("url", images.getImgurl());
|
||||
jsonObject.put("name", file.getName());
|
||||
jsonObject.put("size", images.getSizes());
|
||||
msg.setData(jsonObject);
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
Map<String, File> map = new HashMap<>();
|
||||
String fileName = file.getName();
|
||||
if (file.exists()) {
|
||||
map.put(prefix, file);
|
||||
}
|
||||
long stime = System.currentTimeMillis();
|
||||
Map<ReturnImage, Integer> m = null;
|
||||
ReturnImage returnImage = GetSource.storageSource(key.getStorageType(), map, updatePath, key.getId());
|
||||
Images img = new Images();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if (returnImage.getCode().equals("200")) {
|
||||
String imgurl = returnImage.getImgurl();
|
||||
Long imgsize = returnImage.getImgSize();
|
||||
String imgname = returnImage.getImgname();
|
||||
img.setImgurl(imgurl);
|
||||
img.setUpdatetime(df.format(new Date()));
|
||||
img.setSource(key.getId());
|
||||
img.setUserid(u == null ? 0 : u.getId());
|
||||
img.setSizes(imgsize.toString());
|
||||
if (uploadConfig.getUrltype() == 2) {
|
||||
img.setImgname(imgname);
|
||||
} else {
|
||||
img.setImgname(SetText.getSubString(imgname, key.getRequestAddress() + "/", ""));
|
||||
}
|
||||
img.setImgtype(setday > 0 ? 1 : 0);
|
||||
img.setAbnormal(userip);
|
||||
img.setMd5key(md5key);
|
||||
img.setImguid(imguid);
|
||||
img.setFormat(fileMiME.getData().toString());
|
||||
userMapper.insertimg(img);
|
||||
long etime = System.currentTimeMillis();
|
||||
Print.Normal("上传图片所用总时长:" + String.valueOf(etime - stime) + "ms");
|
||||
jsonObject.put("url", img.getImgurl());
|
||||
jsonObject.put("name", imgname);
|
||||
jsonObject.put("size", img.getSizes());
|
||||
//启动鉴黄线程
|
||||
new Thread(() -> {
|
||||
LegalImageCheck(img);
|
||||
}).start();
|
||||
} else {
|
||||
msg.setCode("5001");
|
||||
msg.setInfo("上传服务内部错误");
|
||||
return msg;
|
||||
}
|
||||
file.delete();
|
||||
msg.setData(jsonObject);
|
||||
// 新代码结束=========
|
||||
return msg;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
msg.setCode("5001");
|
||||
msg.setInfo("Error for server:500");
|
||||
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 Msg updateImgCheck(User user, UploadConfig uploadConfig){
|
||||
final Msg msg = new Msg();
|
||||
java.text.DateFormat dateFormat = null;
|
||||
try {
|
||||
dateFormat = new SimpleDateFormat("yyyy/MM/dd");
|
||||
if (user == null) {
|
||||
//用户没有登陆,值判断游客能不能上传即可
|
||||
if(uploadConfig.getIsupdate()!=1){
|
||||
msg.setCode("1000");
|
||||
msg.setInfo("系统已禁用游客上传");
|
||||
return msg;
|
||||
}
|
||||
group = GetCurrentSource.GetSource(null);
|
||||
memory = Long.valueOf(uploadConfig.getVisitormemory());//单位 B 游客设置总量
|
||||
TotleMemory = Long.valueOf(uploadConfig.getFilesizetourists());//单位 B 游客单文件大小
|
||||
UsedTotleMemory = imgMapper.getusermemory(0)==null?0L : imgMapper.getusermemory(0);//单位 B
|
||||
} else {
|
||||
//判断用户能不能上传
|
||||
if(uploadConfig.getUserclose()!=1){
|
||||
msg.setCode("1001");
|
||||
msg.setInfo("系统已禁用上传功能");
|
||||
return msg;
|
||||
}
|
||||
updatePath = user.getUsername();
|
||||
group= GetCurrentSource.GetSource(user.getId());
|
||||
memory = Long.valueOf(user.getMemory())*1024*1024;//单位 B
|
||||
TotleMemory = Long.valueOf(uploadConfig.getFilesizeuser());//单位 B
|
||||
UsedTotleMemory = imgMapper.getusermemory(user.getId())==null?0L:imgMapper.getusermemory(user.getId());//单位 B
|
||||
}
|
||||
//判断上传的图片目录结构类型
|
||||
if (uploadConfig.getUrltype() == 2) {
|
||||
updatePath = dateFormat.format(new Date());
|
||||
}
|
||||
msg.setCode("300");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg.setCode("500");
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
//图片鉴黄
|
||||
|
||||
private synchronized void LegalImageCheck(Images images){
|
||||
System.out.println("非法图像鉴别进程启动");
|
||||
Imgreview imgreview = null;
|
||||
try {
|
||||
imgreview = imgreviewMapper.selectByusing(1);
|
||||
} catch (Exception e) {
|
||||
Print.warning("获取鉴别程序的时候发生错误");
|
||||
e.printStackTrace();
|
||||
}
|
||||
LegalImageCheckForBaiDu(imgreview,images);
|
||||
}
|
||||
|
||||
private void LegalImageCheckForBaiDu(Imgreview imgreview,Images images){
|
||||
if(imgreview.getUsing()==1){
|
||||
try {
|
||||
AipContentCensor client = new AipContentCensor(imgreview.getAppId(), imgreview.getApiKey(), imgreview.getSecretKey());
|
||||
client.setConnectionTimeoutInMillis(5000);
|
||||
client.setSocketTimeoutInMillis(30000);
|
||||
org.json.JSONObject res = client.antiPorn(images.getImgurl());
|
||||
res = client.imageCensorUserDefined(images.getImgurl(), EImgType.URL, null);
|
||||
com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray("[" + res.toString() + "]");
|
||||
for (Object o : jsonArray) {
|
||||
JSONObject jsonObject = (JSONObject) o;
|
||||
com.alibaba.fastjson.JSONArray data = jsonObject.getJSONArray("data");
|
||||
Integer conclusionType = jsonObject.getInteger("conclusionType");
|
||||
if(conclusionType!=null){
|
||||
if (conclusionType == 2) {
|
||||
for (Object datum : data) {
|
||||
JSONObject imgdata = (JSONObject) datum;
|
||||
if (imgdata.getInteger("type") == 1) {
|
||||
Images img = new Images();
|
||||
img.setImgname(images.getImgname());
|
||||
img.setViolation("1[1]");//数字是鉴别平台的主键ID,括号是非法的类型,参考上面的注释
|
||||
imgMapper.setImg(img);
|
||||
Imgreview imgv = new Imgreview();
|
||||
imgv.setId(1);
|
||||
Integer count = imgreview.getCount();
|
||||
System.out.println("违法图片总数:" + count);
|
||||
imgv.setCount(count + 1);
|
||||
imgreviewMapper.updateByPrimaryKeySelective(imgv);
|
||||
System.err.println("存在非法图片,进行处理操作");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
System.out.println("图像鉴黄线程执行过程中出现异常");
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -39,7 +39,6 @@ public class FTPImageupload {
|
||||
if (flag) {
|
||||
boolean isUpload = ftps.upload(file, "/" + userkey, "");
|
||||
if(isUpload){
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(userkey);
|
||||
returnImage.setImgurl(key.getRequestAddress() + "/"+ userkey);
|
||||
returnImage.setImgSize(entry.getValue().length());
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Tiansh
|
||||
* @author Hellohao
|
||||
* @version 1.0
|
||||
* @date 2019/12/19 15:40
|
||||
*/
|
||||
|
||||
@@ -211,8 +211,8 @@ public class ImgServiceImpl implements ImgService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer md5Count(String md5key) {
|
||||
return imgMapper.md5Count(md5key);
|
||||
public Integer md5Count(Images images) {
|
||||
return imgMapper.md5Count(images);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -244,4 +244,9 @@ public class ImgServiceImpl implements ImgService {
|
||||
return imgMapper.countByM(images);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Images selectImgUrlByImgUID(String imguid) {
|
||||
return imgMapper.selectImgUrlByImgUID(imguid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ public class KODOImageupload {
|
||||
try {
|
||||
Response response = uploadManager.put(file,username + "/" + ShortUID + "." + entry.getKey(),upToken);
|
||||
DefaultPutRet putRet = new Gson().fromJson(response.bodyString(), DefaultPutRet.class);
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgurl(key.getRequestAddress() + "/" + username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgSize(entry.getValue().length());
|
||||
|
||||
@@ -35,7 +35,6 @@ public class NOSImageupload {
|
||||
String ShortUID = SetText.getShortUuid();
|
||||
file = entry.getValue();
|
||||
nosClient.putObject(key.getBucketname(), username + "/" + ShortUID+ "." + entry.getKey(), file);
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(username + "/" + ShortUID+ "." + entry.getKey());
|
||||
returnImage.setImgurl(key.getRequestAddress() + "/" + username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgSize(entry.getValue().length());
|
||||
|
||||
@@ -30,7 +30,6 @@ public class OSSImageupload {
|
||||
file = entry.getValue();
|
||||
System.out.println("待上传的图片:"+username + "/" + ShortUID + "." + entry.getKey());
|
||||
ossClient.putObject(key.getBucketname(), username + "/" + ShortUID + "." + entry.getKey(),file);
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(username + "/" + ShortUID + "." + entry.getKey());//entry.getValue().getOriginalFilename()
|
||||
returnImage.setImgurl(key.getRequestAddress() + "/" + username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgSize(file.length());
|
||||
|
||||
@@ -29,7 +29,6 @@ public class UFileImageupload {
|
||||
uFile.setContentMD5(UpYun.md5(file));
|
||||
boolean result = uFile.writeFile(username + "/" + ShortUID + "." + entry.getKey(), file, true);
|
||||
if(result){
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgurl(key.getRequestAddress() + "/" +username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgSize(entry.getValue().length());
|
||||
|
||||
@@ -32,7 +32,6 @@ public class USSImageupload {
|
||||
upyun.setContentMD5(UpYun.md5(file));
|
||||
boolean result = upyun.writeFile(username + "/" + ShortUID + "." + entry.getKey(), file, true);
|
||||
if(result){
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgurl(key.getRequestAddress() + "/" +username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgSize(entry.getValue().length());
|
||||
|
||||
@@ -120,6 +120,24 @@ public class UploadServicel {
|
||||
if(md5key==null || md5key.equals("")){
|
||||
md5key = UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
|
||||
//判断图片是否存在
|
||||
if(Integer.valueOf(sysConfigService.getstate().getCheckduplicate())==1){
|
||||
Images imaOBJ = new Images();
|
||||
imaOBJ.setMd5key(md5key);
|
||||
imaOBJ.setUserid(u==null?0:u.getId());
|
||||
if(imgMapper.md5Count(imaOBJ)>0){
|
||||
Images images = imgMapper.selectImgUrlByMD5(md5key);
|
||||
jsonObject.put("url", images.getImgurl());
|
||||
jsonObject.put("name",file.getName());
|
||||
jsonObject.put("imguid",images.getImguid());
|
||||
// jsonObject.put("shortLink",images.getShortlink());
|
||||
msg.setData(jsonObject);
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String prefix = file.getName().substring(file.getName().lastIndexOf(".")+1);
|
||||
//判断黑名单
|
||||
if (uploadConfig.getBlacklist() != null) {
|
||||
@@ -170,17 +188,14 @@ public class UploadServicel {
|
||||
img.setMd5key(md5key);
|
||||
img.setImguid(imguid);
|
||||
img.setFormat(fileMiME.getData().toString());
|
||||
img.setShortlink(returnImage.getUid());
|
||||
userMapper.insertimg(img);
|
||||
long etime = System.currentTimeMillis();
|
||||
Print.Normal("上传图片所用总时长:" + String.valueOf(etime - stime) + "ms");
|
||||
jsonObject.put("url", img.getImgurl());
|
||||
jsonObject.put("name", imgname);
|
||||
jsonObject.put("imguid",img.getImguid());
|
||||
jsonObject.put("shortLink", img.getShortlink());
|
||||
//启动鉴黄线程
|
||||
// jsonObject.put("shortLink", img.getShortlink());
|
||||
new Thread(()->{LegalImageCheck(img);}).start();
|
||||
|
||||
}else{
|
||||
msg.setCode("5001");
|
||||
msg.setInfo("上传服务内部错误");
|
||||
@@ -266,13 +281,18 @@ public class UploadServicel {
|
||||
TotleMemory = Long.valueOf(uploadConfig.getFilesizetourists());//单位 B 游客单文件大小
|
||||
UsedTotleMemory = imgMapper.getusermemory(0)==null?0L : imgMapper.getusermemory(0);//单位 B
|
||||
} else {
|
||||
//判断用户能不能上传
|
||||
if(uploadConfig.getUserclose()!=1){
|
||||
msg.setCode("1001");
|
||||
msg.setInfo("系统已禁用上传功能");
|
||||
return msg;
|
||||
}
|
||||
updatePath = user.getUsername();
|
||||
group= GetCurrentSource.GetSource(user.getId());
|
||||
memory = Long.valueOf(user.getMemory())*1024*1024;//单位 B
|
||||
TotleMemory = Long.valueOf(uploadConfig.getFilesizeuser());//单位 B
|
||||
UsedTotleMemory = imgMapper.getusermemory(user.getId())==null?0L:imgMapper.getusermemory(user.getId());//单位 B
|
||||
}
|
||||
//判断上传的图片目录结构类型
|
||||
if (uploadConfig.getUrltype() == 2) {
|
||||
updatePath = dateFormat.format(new Date());
|
||||
}
|
||||
@@ -293,7 +313,6 @@ public class UploadServicel {
|
||||
Print.warning("获取鉴别程序的时候发生错误");
|
||||
e.printStackTrace();
|
||||
}
|
||||
//判断哪个鉴别平台
|
||||
if(null != imgreview){
|
||||
LegalImageCheckForBaiDu(imgreview,images);
|
||||
}
|
||||
@@ -302,7 +321,6 @@ public class UploadServicel {
|
||||
|
||||
private void LegalImageCheckForBaiDu(Imgreview imgreview,Images images){
|
||||
System.out.println("非法图像鉴别进程启动-BaiDu");
|
||||
// Imgreview imgreview = imgreviewService.selectByPrimaryKey(1);
|
||||
if(imgreview.getUsing()==1){
|
||||
try {
|
||||
AipContentCensor client = new AipContentCensor(imgreview.getAppId(), imgreview.getApiKey(), imgreview.getSecretKey());
|
||||
@@ -312,24 +330,19 @@ public class UploadServicel {
|
||||
res = client.imageCensorUserDefined(images.getImgurl(), EImgType.URL, null);
|
||||
System.err.println("返回的鉴黄json:"+res.toString());
|
||||
com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray("[" + res.toString() + "]");
|
||||
|
||||
for (Object o : jsonArray) {
|
||||
com.alibaba.fastjson.JSONObject jsonObject = (com.alibaba.fastjson.JSONObject) o;
|
||||
com.alibaba.fastjson.JSONArray data = jsonObject.getJSONArray("data");
|
||||
Integer conclusionType = jsonObject.getInteger("conclusionType");
|
||||
if(conclusionType!=null){
|
||||
if (conclusionType == 2) {
|
||||
//1:合规,2:不合规,3:疑似,4:审核失败
|
||||
for (Object datum : data) {
|
||||
com.alibaba.fastjson.JSONObject imgdata = (com.alibaba.fastjson.JSONObject) datum;
|
||||
if (imgdata.getInteger("type") == 1) {
|
||||
//type参数 0:百度官方违禁图库、1:色情识别、2:暴恐识别、3:恶心图识别、4:广告检测、5:政治敏感识别、6:图像质量检测、7:用户图像黑名单、8:用户图像白名单、10:用户头像审核、11:百度官方违禁词库、12:图文审核、13:自定义文本黑名单、14:自定义文本白名单、15:EasyDL自定义模型、16:敏感旗帜标志识别、21:不良场景识别、24:直播场景审核
|
||||
//存在非法图片,进行处理操作
|
||||
Images img = new Images();
|
||||
img.setImgname(images.getImgname());
|
||||
img.setViolation("1[1]");//数字是鉴别平台的主键ID,括号是非法的类型,参考上面的注释
|
||||
img.setViolation("1[1]");
|
||||
imgMapper.setImg(img);
|
||||
//计入总数
|
||||
Imgreview imgv = new Imgreview();
|
||||
imgv.setId(1);
|
||||
Integer count = imgreview.getCount();
|
||||
|
||||
@@ -50,7 +50,6 @@ public class LocUpdateImg {
|
||||
}
|
||||
bos.flush();
|
||||
bos.close();
|
||||
returnImage.setUid(ShortUID);
|
||||
returnImage.setImgname(username + "/" +ShortUID + "." + entry.getKey());//entry.getValue().getOriginalFilename()
|
||||
returnImage.setImgurl(key.getRequestAddress() +"/ota/"+username + "/" + ShortUID + "." + entry.getKey());
|
||||
returnImage.setImgSize(entry.getValue().length());
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.mitchellbosecke.pebble.PebbleEngine;
|
||||
import com.mitchellbosecke.pebble.template.PebbleTemplate;
|
||||
import io.github.biezhi.ome.OhMyEmail;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.HashMap;
|
||||
@@ -19,16 +18,6 @@ import java.util.UUID;
|
||||
|
||||
public class NewSendEmail {
|
||||
|
||||
public static void initialEmail(EmailConfig emailConfig) {
|
||||
// Properties p = new Properties();
|
||||
// p.setProperty("mail.smtp.auth", "true");
|
||||
// p.setProperty("mail.smtp.host", emailConfig.getEmailurl());
|
||||
// p.setProperty("mail.smtp.port", emailConfig.getPort());
|
||||
// p.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static Integer sendEmail(EmailConfig emailConfig, String username, String uid, String toEmail, Config config) {
|
||||
|
||||
Properties props = new Properties();
|
||||
@@ -114,7 +103,6 @@ public class NewSendEmail {
|
||||
// 配置一次即可,可以配置为静态方法
|
||||
// OhMyEmail.config(OhMyEmail.SMTP_QQ(false), "xxxx@qq.com", "your@password");
|
||||
OhMyEmail.config(props, emailConfig.getEmails(), emailConfig.getEmailkey());
|
||||
|
||||
String webname=config.getWebname();
|
||||
String domain = config.getDomain();
|
||||
String new_pass = UUID.randomUUID().toString().replace("-", "").toLowerCase().substring(0,10);
|
||||
@@ -144,28 +132,5 @@ public class NewSendEmail {
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args)throws Exception {
|
||||
|
||||
Properties props = new Properties();
|
||||
props.put("mail.smtp.auth", "true");
|
||||
props.put("mail.smtp.ssl.enable", "true");
|
||||
props.put("mail.debug", "false");
|
||||
props.put("mail.transport.protocol", "smtp");
|
||||
props.put("mail.debug", "false");
|
||||
props.put("mail.smtp.timeout", "20000");
|
||||
props.put("mail.smtp.port", "25");//465 25
|
||||
props.put("mail.smtp.host", "smtpdm.aliyun.com");
|
||||
|
||||
// 配置一次即可,可以配置为静态方法
|
||||
// OhMyEmail.config(OhMyEmail.SMTP_QQ(false), "xxxx@qq.com", "your@password");
|
||||
OhMyEmail.config(props, "hellohao@wwery.com", "TianShiHao1995");
|
||||
OhMyEmail.subject("账号激活邮件测试")
|
||||
.from("hahhaha")
|
||||
.to("923453645@qq.com")
|
||||
.html("<a href='http://www.hellohao.cn'>hellohao</a>")
|
||||
.send();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,10 +40,12 @@
|
||||
</delete>
|
||||
|
||||
<select id="selectImgForAlbumkey" parameterType="string" resultType="cn.hellohao.pojo.Images">
|
||||
|
||||
select * from imgdata a
|
||||
LEFT JOIN imgandalbum b on a.imgname = b.imgname
|
||||
LEFT JOIN imgandalbum b on a.imgurl = b.imgname
|
||||
LEFT JOIN album c on b.albumkey = c.albumkey
|
||||
where b.albumkey = #{albumkey}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -17,7 +17,6 @@
|
||||
a.explains,
|
||||
a.md5key,
|
||||
a.imguid,
|
||||
a.shortlink,
|
||||
a.format,
|
||||
a.about,
|
||||
a.great,
|
||||
@@ -115,14 +114,7 @@
|
||||
</select>
|
||||
|
||||
<select id="md5Count" resultType="integer">
|
||||
select count(*) from imgdata
|
||||
<where>
|
||||
1=1
|
||||
<if test="md5key != null">
|
||||
and md5key=#{md5key}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
select count(id) from imgdata where md5key=#{md5key} and userid = #{userid}
|
||||
</select>
|
||||
|
||||
<select id="selectImgUrlByMD5" parameterType="string" resultType="cn.hellohao.pojo.Images">
|
||||
@@ -173,4 +165,9 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectImgUrlByImgUID" parameterType="string" resultType="cn.hellohao.pojo.Images">
|
||||
select * from imgdata where imguid = #{imguid}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -40,9 +40,6 @@
|
||||
<delete id="delImgAndExp" parameterType="string">
|
||||
DELETE imgtemp,imgdata FROM imgtemp LEFT JOIN imgdata ON imgtemp.imguid = imgdata.imguid
|
||||
WHERE imgdata.imguid =#{imguid}
|
||||
<!-- <foreach collection="list" item="imguid" index="index" open="(" close=")" separator=",">-->
|
||||
<!-- #{imguid}-->
|
||||
<!-- </foreach>-->
|
||||
</delete>
|
||||
|
||||
<insert id="insertImgExp" parameterType="cn.hellohao.pojo.ImgTemp" >
|
||||
|
||||
@@ -10,8 +10,12 @@
|
||||
UPDATE sysconfig
|
||||
<set>
|
||||
<if test="register != null">
|
||||
`register` = #{register}
|
||||
`register` = #{register},
|
||||
</if>
|
||||
<if test="checkduplicate != null">
|
||||
`checkduplicate` = #{checkduplicate},
|
||||
</if>
|
||||
|
||||
</set>
|
||||
where id=1
|
||||
</update>
|
||||
|
||||
@@ -105,8 +105,8 @@
|
||||
|
||||
<!-- 插入图片信息 -->
|
||||
<insert id="insertimg" parameterType="cn.hellohao.pojo.Images">
|
||||
INSERT INTO imgdata (id, imgname, imgurl, userid, updatetime,sizes,abnormal,source,imgtype,md5key,imguid,shortlink,format,about,great,violation)
|
||||
VALUES (NULL, #{imgname}, #{imgurl}, #{userid}, #{updatetime},#{sizes},#{abnormal},#{source},#{imgtype},#{md5key},#{imguid},#{shortlink},#{format},#{about},"0",null)
|
||||
INSERT INTO imgdata (id, imgname, imgurl, userid, updatetime,sizes,abnormal,source,imgtype,md5key,imguid,format,about,great,violation)
|
||||
VALUES (NULL, #{imgname}, #{imgurl}, #{userid}, #{updatetime},#{sizes},#{abnormal},#{source},#{imgtype},#{md5key},#{imguid},#{format},#{about},"0",null)
|
||||
</insert>
|
||||
|
||||
<!-- 修改资料 -->
|
||||
@@ -183,8 +183,7 @@
|
||||
isok,
|
||||
ceil((memory/1024/1024)) as memory,
|
||||
groupid,
|
||||
(select groupname from `group` where id = groupid) as groupname,
|
||||
token
|
||||
(select groupname from `group` where id = groupid) as groupname
|
||||
FROM
|
||||
user
|
||||
where
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>关于系统</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<style>
|
||||
body{
|
||||
font-family: 等线;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main" style="width: 50%;margin-top: 50px;">
|
||||
<h3>
|
||||
<img th:src="@{/img/baner.jpg}"
|
||||
style="border-radius :5px;max-width: 80%;-moz-box-shadow: 2px 2px 10px #909090;-webkit-box-shadow: 2px 2px 10px #909090;box-shadow:2px 2px 10px #909090;" />
|
||||
</h3>
|
||||
<br/>
|
||||
<h3><i class="layui-icon layui-icon-friends"> </i>开发者:Hellohao</h3>
|
||||
<hr />
|
||||
<h3><i class="layui-icon layui-icon-find-fill"> </i>技术博客:<a href="http://www.hellohao.cn" target="_blank">http://www.hellohao.cn</a></h3>
|
||||
<hr />
|
||||
<h3><i class="layui-icon layui-icon-star"> </i>Guthub开源:<a href="https://github.com/Hello-hao/Tbed" target="_blank">https://github.com/Hello-hao/Tbed</a></h3>
|
||||
<hr />
|
||||
<h3><i class="layui-icon layui-icon-login-qq"> </i>开发者交流群:864800972</h3>
|
||||
<hr />
|
||||
<!-- th:text="${systemupdate}"-->
|
||||
<h3><i class="layui-icon layui-icon-auz"> </i><span id="dates" >2020-09-24</span> <a onclick="sysupdate();" class="layui-btn layui-btn-normal layui-btn-sm">检查更新</a></h3>
|
||||
<hr />
|
||||
<h3 style="font-weight: bold;"><i class="layui-icon layui-icon-rmb"> </i>捐赠开发者:<a onclick="jz()" style="cursor:pointer;">展开</a></h3>
|
||||
<br />
|
||||
<h3>
|
||||
<img id="jzm" th:src="@{/img/ds.jpg}" style=" display:none;border-radius :5px;max-width: 60%;-moz-box-shadow: 2px 2px 10px #909090;-webkit-box-shadow: 2px 2px 10px #909090;box-shadow:2px 2px 10px #909090;" />
|
||||
</h3>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var level = [[${level!=null?level:0}]];
|
||||
layui.use(['form', 'layedit', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
|
||||
$(function () {
|
||||
|
||||
})
|
||||
});
|
||||
function sysupdate(v) {
|
||||
var dates = $("#dates").html();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/sysupdate",
|
||||
data: {dates: dates},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
layer.confirm('有新版本,是否去下载最新编译包?', {
|
||||
btn: ['去更新','不必了'] //按钮
|
||||
}, function(){
|
||||
window.open("https://github.com/Hello-hao/Tbed/releases");
|
||||
}, function(){
|
||||
layer.msg('已取消更新');
|
||||
});
|
||||
}else{
|
||||
layer.msg("已是最新版本,无需更新。", {icon: 1});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function jz() {
|
||||
var display =$('#jzm').css('display');
|
||||
if(display == 'none'){
|
||||
$('#jzm').show();
|
||||
}else{
|
||||
$('#jzm').hide();
|
||||
}
|
||||
$('body,html').animate({
|
||||
scrollTop:$("#jzm").offset().top
|
||||
},800);
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,103 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
|
||||
<meta name="renderer" content="webkit">
|
||||
<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" th:href="@{/layui/layui/css/layui.css}">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<br />
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">群组名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input id="groupname" style="width: 250px;" type="tel" name="groupname" lay-verify="required|phone" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<form class="layui-form">
|
||||
<label class="layui-form-label">所属存储源</label>
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<select id="keyid" name="quiz1" style="max-height: 360px;">
|
||||
<option value="5"> 本地存储</option>
|
||||
<option value="1"> 网易NOS</option>
|
||||
<option value="2"> 阿里OSS</option>
|
||||
<option value="3"> 又拍USS</option>
|
||||
<option value="4"> 七牛云KODO</option>
|
||||
<option value="6"> 腾讯COS</option>
|
||||
<option value="7"> FTP存储</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<br/><br/><button type="button" style="float: right;margin-right: 65px;" class="layui-btn layui-btn-radius layui-btn-normal" onclick="addgroup()">保 存</button>
|
||||
</div>
|
||||
|
||||
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script>
|
||||
layui.use(['form','table','layer'], function(){
|
||||
table = layui.table;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
|
||||
|
||||
});
|
||||
function delectcode(code) {
|
||||
var index= layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/deletecode",
|
||||
data: {code:code},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
}else{
|
||||
layer.msg('部分数据可能未删除成功', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
}
|
||||
|
||||
|
||||
function addgroup() {
|
||||
layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
var groupname = $('#groupname').val();
|
||||
var keyid = $('#keyid').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/addisgroup",
|
||||
data: {groupname:groupname,keyid:keyid},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('添加成功', {icon: 1});
|
||||
}else if(data==-1){
|
||||
layer.msg('该存储源配置不完整,请先将存储源配置填写完整再操作', {icon: 2});
|
||||
}else{
|
||||
layer.msg('添加失败', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.closeAll();
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,166 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<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" th:href="@{/layui/layui/css/layui.css}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main">
|
||||
<div class="demoTable" style="margin-top: 15px;">
|
||||
查询画廊:
|
||||
<div class="layui-inline">
|
||||
<input class="layui-input" name="id" id="demoReload" placeholder="请输入用户名" autocomplete="off">
|
||||
</div>
|
||||
<button class="layui-btn" data-type="reload" onclick="query()">查询</button>
|
||||
</div>
|
||||
<br />
|
||||
<table id="dates" lay-filter="test"></table>
|
||||
</div>
|
||||
<input type="hidden" id="domain" th:value="${config.getDomain()}" />
|
||||
<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">
|
||||
var tableIns = null;
|
||||
var domain = '';
|
||||
$.ajaxSetup({
|
||||
cache: false
|
||||
});
|
||||
var table = null;
|
||||
layui.use(['form','table','layer'], function(){
|
||||
table = layui.table;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
domain = $('#domain').val();
|
||||
tableIns = table.render({
|
||||
elem: '#dates'
|
||||
,cache: false//关闭本地磁盘缓存,
|
||||
,toolbar: '<div class="layui-btn-group">\n' +
|
||||
' <button type="button" lay-event="delall" class="layui-btn layui-btn-sm">\n' +
|
||||
' <i class="layui-icon"></i>删除选中\n' +
|
||||
' </button>\n' +
|
||||
'</div>' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
,defaultToolbar:['filter', 'print']
|
||||
,method:'post'
|
||||
,url:'/admin/getAlbumURLList'
|
||||
,limit:10 //默认为10
|
||||
,cols: [ [
|
||||
{type:'checkbox',width:40,}
|
||||
,{field:'albumtitle',width:300, title: '画廊标题'}
|
||||
,{field:'albumkey', width:300, title: '画廊地址', templet: function(d){return domain+'/'+d.albumkey;}}
|
||||
,{field:'username', title: '创建用户',templet: function(d){
|
||||
var str = d.username;
|
||||
if(d.username=='' || d.username==null){str='游客';}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
,{field:'createdate', title: '创建时间',sort: true}
|
||||
,{field:'password', title: '访问密码',templet: function(d){
|
||||
var str = d.password;
|
||||
if(d.password=='' || d.password==null){str='无';}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
,{field:'level',width:70, title: '操作',templet: function(d){
|
||||
return '<div class="layui-btn-group">\n' +
|
||||
' <button type="button" class="layui-btn layui-btn-sm" lay-event="del">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
] ]
|
||||
,page: true
|
||||
,done:function(res, curr, count){
|
||||
//数据的回调用,可不写
|
||||
}
|
||||
});
|
||||
// 行点击事件
|
||||
table.on('tool', function (obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if (event === 'del') {
|
||||
var index = layer.confirm('确定删除这个画廊吗?', {
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/delAlbum",
|
||||
async:false,
|
||||
data: {albumkey: data.albumkey},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('dates');//重新获取表数据
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
}, function(){
|
||||
});
|
||||
}else{
|
||||
layer.msg('参数异常', {icon: 2});
|
||||
}
|
||||
});
|
||||
|
||||
//头工具栏事件
|
||||
table.on('toolbar(test)', function(obj){
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
switch(obj.event){
|
||||
case 'delall':
|
||||
var index = layer.confirm('确定删除选中画廊?', {
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
var data = checkStatus.data;
|
||||
var arr = new Array();
|
||||
for(var i = 0;i<data.length;i++){
|
||||
arr.push(data[i].albumkey)
|
||||
}
|
||||
delall(arr);
|
||||
layer.close(index);
|
||||
table.reload('dates');//重新获取表数据
|
||||
}, function(){
|
||||
});
|
||||
//layer.alert(JSON.stringify(data));
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function query(){
|
||||
var data = $('#demoReload').val();
|
||||
//这里以搜索为例
|
||||
tableIns.reload({
|
||||
where: { //设定异步数据接口的额外参数,任意设
|
||||
username: data
|
||||
}
|
||||
,page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delall(arr) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/delAlbumAll",
|
||||
data: {albumkeyArr: arr},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
table.reload('dates');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,141 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>API接口</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<style>
|
||||
body{
|
||||
font-family: 等线;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main" style="width: 50%;margin-top: 50px;">
|
||||
<h3>请求地址:</h3>
|
||||
<table class="layui-table">
|
||||
<colgroup>
|
||||
<!-- <col width="150">-->
|
||||
<!-- <col width="200">-->
|
||||
<!-- <col>-->
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>功 能</th>
|
||||
<th>接 口</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>请求方式</td>
|
||||
<td>POST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>请求地址</td>
|
||||
<td th:text="${domain}+'/clientupimg/'"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<h3>请求参数:</h3>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>参数名</th>
|
||||
<th>参数类型</th>
|
||||
<th>必 填</th>
|
||||
<th>参数说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>file</td>
|
||||
<td>file </td>
|
||||
<td>是</td>
|
||||
<td>图像文件</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>email</td>
|
||||
<td>String</td>
|
||||
<td>是</td>
|
||||
<td>用户邮箱</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pass</td>
|
||||
<td>String</td>
|
||||
<td>是</td>
|
||||
<td>用户密码</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>返回参数:</h3>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>参数名称</th>
|
||||
<th>参数类型</th>
|
||||
<th>参数说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>code</td>
|
||||
<td>Number</td>
|
||||
<td>状态码,成功返回200,失败返回负数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>msg</td>
|
||||
<td>String</td>
|
||||
<td>提示信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>data</td>
|
||||
<td>Array|Object</td>
|
||||
<td>图片上传后的信息</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>参数实例:</h3>
|
||||
<h3>
|
||||
<pre class="layui-code">
|
||||
//成功实例:
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "success",
|
||||
"data": [
|
||||
{
|
||||
"Imgname": "bloglogo.png",
|
||||
"Imgurl": "https://cdn.wwery.com/user/5dbfa0807100052.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
</pre>
|
||||
<pre class="layui-code">
|
||||
//失败实例:
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "success",
|
||||
"data": [
|
||||
{
|
||||
"Imgname": "Tbed.zip",
|
||||
"Imgurl": "文件超出系统设定大小,不得超过"
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
</h3>
|
||||
|
||||
<p style="color:#de4848;font-weight: bold;">上传头需要是Content-Type: multipart/form-data;</p>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,205 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
|
||||
<meta name="renderer" content="webkit">
|
||||
<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" th:href="@{/layui/layui/css/layui.css}">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main">
|
||||
<div class="demoTable" style="margin-top: 15px;">
|
||||
查询用户:
|
||||
<div class="layui-inline">
|
||||
<input class="layui-input" name="id" id="demoReload" placeholder="请输入用户名或邮箱" autocomplete="off">
|
||||
</div>
|
||||
<button class="layui-btn" data-type="reload" onclick="query()">查询</button>
|
||||
</div>
|
||||
<br />
|
||||
<table id="datas" lay-filter="codes" lay-data="datas"></table>
|
||||
</div>
|
||||
|
||||
<!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>-->
|
||||
<!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
|
||||
|
||||
|
||||
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script>
|
||||
var tableIns = null;
|
||||
var table = null;
|
||||
layui.use(['form','table','layer'], function(){
|
||||
table = layui.table;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
|
||||
tableIns = table.render({
|
||||
elem: '#datas'
|
||||
,cache: false//关闭本地磁盘缓存,
|
||||
,toolbar: '<div class="layui-btn-group">\n' +
|
||||
' <button type="button" lay-event="add" class="layui-btn layui-btn-sm">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
' <button type="button" lay-event="delete" class="layui-btn layui-btn-sm">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
'</div>' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
,defaultToolbar:['filter', 'print']
|
||||
,url:'/admin/root/selectcodelist'
|
||||
//,limit:20 //默认为10
|
||||
,cols: [ [
|
||||
{type: 'checkbox', fixed: 'left' ,width:50}
|
||||
,{field:'id', width:70, title: '编号', sort: true}, //sort:true页面可进行排序操作
|
||||
{field:'value',width:170, title: '扩容值(M)'}
|
||||
,{field:'code', title: '扩容码'}
|
||||
,{field:'level',width:110, title: '操作',templet: function(d){
|
||||
//return '<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>';
|
||||
return '<div class="layui-btn-group">\n' +
|
||||
' <button type="button" lay-filter="delete" class="layui-btn layui-btn-sm" lay-event="del">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
//, {title: '操作', fixed: 'right',width:250, align: 'center', toolbar: '#column-toolbar'}
|
||||
] ]
|
||||
,username:'sousuo'
|
||||
,page: true
|
||||
,done:function(res, curr, count){
|
||||
//数据的回调用,可不写
|
||||
}
|
||||
});
|
||||
|
||||
table.on('tool(codes)', function(obj){
|
||||
var event = obj.event;
|
||||
var data = obj.data;
|
||||
if(event === 'del'){
|
||||
layer.confirm('确认删除该条扩容码?', function(index){
|
||||
//obj.del(); //删除对应行(tr)的DOM结构
|
||||
delectcode(data.code)
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//监听头工具栏事件
|
||||
table.on('toolbar(codes)', function(obj){
|
||||
// var tc = table.checkStatus('tableid');//通过指定的table初始化id获取选中的数据
|
||||
var checkStatus = table.checkStatus(obj.config.id)
|
||||
,data = checkStatus.data; //获取选中的数据
|
||||
switch(obj.event){
|
||||
case 'add':
|
||||
layer.open({
|
||||
type: 1,
|
||||
title:'用户容量',
|
||||
skin: 'layui-layer-rim', //加上边框
|
||||
area: ['420px', '340px'], //宽高
|
||||
content: '<div style="width: 360px;"><br /><br /><div class="layui-form-item">\n' +
|
||||
' <label class="layui-form-label">容量(M)</label>\n' +
|
||||
' <div class="layui-input-block">\n' +
|
||||
' <input type="text" name="title" id="sizeval" value="1024" required lay-verify="required" placeholder="请输入正整数" autocomplete="off" class="layui-input"> ' +
|
||||
' </div>\n<br />' +
|
||||
' <label class="layui-form-label">生成个数</label>\n' +
|
||||
' <div class="layui-input-block">\n' +
|
||||
' <input type="text" name="title" id="counts" value="10" required lay-verify="required" placeholder="请输入正整数" autocomplete="off" class="layui-input"> ' +
|
||||
'<span style="color: #DAA5A6;">输入“-1”则为无限制,请输入整数</span><br/><br/><button type="button" class="layui-btn layui-btn-radius layui-btn-normal" onclick="generate()">保 存</button>'+
|
||||
' </div>\n' +
|
||||
'</div></div>'
|
||||
|
||||
});
|
||||
|
||||
|
||||
break;
|
||||
case 'delete':
|
||||
|
||||
layer.confirm('确认删除选中的扩容码?', function(index){
|
||||
if(data.length === 0){
|
||||
layer.msg('至少选择一个', {icon: 2});
|
||||
} else {
|
||||
var index= layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
var arr=[];
|
||||
$.each(data,function (index,val) {
|
||||
arr.push(val.code);
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/deletecodes",
|
||||
data: {arr:arr},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data ==1) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
}else if(data>1){
|
||||
layer.msg('当你看到这个提示时,请向作者反馈。', {icon: 2});
|
||||
}else{
|
||||
layer.msg('部分数据可能未删除成功', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
//layer.msg('删除');
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
function delectcode(code) {
|
||||
var index= layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/deletecode",
|
||||
data: {code:code},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
}else{
|
||||
layer.msg('部分数据可能未删除成功', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
}
|
||||
function generate(code) {
|
||||
layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
var sizeval = $('#sizeval').val();
|
||||
var counts = $('#counts').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/addcode",
|
||||
data: {value:sizeval,counts:counts},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('添加成功', {icon: 1});
|
||||
}else{
|
||||
layer.msg('添加失败', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.closeAll();
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,165 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>邮箱配置</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<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>
|
||||
<div class="layui-main" style="width: 50%;margin-top: 50px;">
|
||||
<h2>邮箱配置(SMTP)</h2>
|
||||
<br/>
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">启用验证</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="open" type="checkbox" name="close" lay-skin="switch" lay-filter="switchTest"
|
||||
lay-text="ON|OFF">
|
||||
<!-- <input type="checkbox" name="open" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">-->
|
||||
<span style="color: #DAA5A6;">开启前保证下方信息填写正确,并已保存</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">邮箱昵称</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="emailname" type="text" name="title" autocomplete="off" placeholder="邮箱昵称" class="layui-input"
|
||||
th:value="${emailConfig.getEmailname()}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">邮箱地址</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="emails" type="text" name="title" autocomplete="off" placeholder="邮箱地址" class="layui-input"
|
||||
th:value="${emailConfig.getEmails()}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">授权码</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="emailkey" type="text" name="title" autocomplete="off" placeholder="授权码" class="layui-input"
|
||||
th:value="${emailConfig.getEmailkey()}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SMTP服务器</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="emailurl" type="text" name="title" autocomplete="off" placeholder="SMTP服务器"
|
||||
class="layui-input" th:value="${emailConfig.getEmailurl()}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">端口</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="port" type="text" name="title" autocomplete="off" placeholder="端口"
|
||||
class="layui-input" th:value="${emailConfig.getPort()}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<a class="layui-btn" lay-submit="" lay-filter="demo2" onclick="updateimgreview()">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
/**
|
||||
* 禁用 ajax 缓存
|
||||
*/
|
||||
$.ajaxSetup({
|
||||
cache: false
|
||||
});
|
||||
|
||||
|
||||
var using = [[${emailConfig.getUsing()}]];
|
||||
$(function () {
|
||||
|
||||
layui.use(['form', 'layedit', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
layer.msg(JSON.stringify(data.field));
|
||||
return false;
|
||||
});
|
||||
//监听指定开关
|
||||
form.on('switch(switchTest)', function (data) {
|
||||
|
||||
if (this.checked == true) {
|
||||
var emailname = $("#emailname").val();
|
||||
var emails = $("#emails").val();
|
||||
var emailkey = $("#emailkey").val();
|
||||
var port = $("#port").val();
|
||||
var emailurl = $("#emailurl").val();
|
||||
if (emailname != "" && emails != "" && emailkey != "" && port !="" && emailurl !="") {
|
||||
emailconfig(1);
|
||||
}else{
|
||||
layer.msg("开启失败,各项内容均不能为空", {icon: 2});
|
||||
}
|
||||
} else {
|
||||
emailconfig(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (using == 1) {
|
||||
$('#open').attr("checked", 'hellohao'); //增加属性
|
||||
} else {
|
||||
$('#open').removeAttr("checked"); //移除属性
|
||||
}
|
||||
});
|
||||
function emailconfig(values) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updateemail",
|
||||
dataType: "text",
|
||||
data: {using: values},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
if (values == 1) {
|
||||
layer.msg('邮箱验证已开启');
|
||||
} else {
|
||||
layer.msg('邮箱验证已关闭');
|
||||
}
|
||||
} else {
|
||||
layer.msg('系统异常,请刷新重试。');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function updateimgreview() {
|
||||
var emailname = $("#emailname").val();
|
||||
var emails = $("#emails").val();
|
||||
var emailkey = $("#emailkey").val();
|
||||
var port = $("#port").val();
|
||||
var emailurl = $("#emailurl").val();
|
||||
if (emailname != "" && emails != "" && emailkey != "" && port !="" && emailurl !="") {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updateemail",
|
||||
dataType: "json",
|
||||
data: {emailname: emailname, emails: emails, emailkey: emailkey,port:port,emailurl:emailurl},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
layer.msg("保存成功", {icon: 1});
|
||||
//window.location.reload();
|
||||
} else {
|
||||
layer.msg("保存失败,请尝试刷新页面后操作", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg("各项内容均不能为空", {icon: 2});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,201 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
|
||||
<meta name="renderer" content="webkit">
|
||||
<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" th:href="@{/layui/layui/css/layui.css}">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main">
|
||||
<!-- <div class="demoTable" style="margin-top: 15px;">-->
|
||||
<!-- 查询用户:-->
|
||||
<!-- <div class="layui-inline">-->
|
||||
<!-- <input class="layui-input" name="id" id="demoReload" placeholder="请输入用户名或邮箱" autocomplete="off">-->
|
||||
<!-- </div>-->
|
||||
<!-- <button class="layui-btn" data-type="reload" onclick="query()">查询</button>-->
|
||||
<!-- </div>-->
|
||||
<br />
|
||||
<h3><span style="color: #DAA5A6;">注意:默认群组不可删除,游客或者未分配的注册用户都将会存入默认群组的存储源。</span></h3>
|
||||
<h3><span style="color: #DAA5A6;">增加群组选择存储源时,必须保证你的存储源配置项已经填写完整,否则会出错。</span></h3>
|
||||
<br />
|
||||
<table id="datas" lay-filter="group" lay-data="datas"></table>
|
||||
</div>
|
||||
|
||||
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script>
|
||||
var tableIns = null;
|
||||
var table = null;
|
||||
layui.use(['form','table','layer'], function(){
|
||||
table = layui.table;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
|
||||
tableIns = table.render({
|
||||
elem: '#datas'
|
||||
,cache: false//关闭本地磁盘缓存,
|
||||
,toolbar: '<div class="layui-btn-group">\n' +
|
||||
' <button type="button" lay-event="add" class="layui-btn layui-btn-sm">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
'</div>' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
,defaultToolbar:['filter', 'print']
|
||||
,url:'/admin/root/getgrouplist'
|
||||
//,limit:20 //默认为10
|
||||
,cols: [ [
|
||||
// {type: 'checkbox', fixed: 'left' ,width:50}
|
||||
{field:'id', width:70, title: '编号', sort: true}, //sort:true页面可进行排序操作
|
||||
{field:'groupname',width:270, title: '分组名称'}
|
||||
,{field:'keyid', title: '所属存储源',templet: function(d){
|
||||
var source = '';
|
||||
if (d.keyid == 1) {
|
||||
source = '网易NOS';
|
||||
} else if (d.keyid == 2) {
|
||||
source = '阿里OSS';
|
||||
} else if (d.keyid == 3) {
|
||||
source = '又拍USS';
|
||||
} else if (d.keyid == 4) {
|
||||
source = '七牛KODO';
|
||||
} else if (d.keyid == 5) {
|
||||
source = '本地存储';
|
||||
}else if (d.keyid == 6) {
|
||||
source = '腾讯COS';
|
||||
}else if (d.keyid == 7) {
|
||||
source = 'FTP存储';
|
||||
}else if (d.keyid == 8) {
|
||||
source = 'U-File';
|
||||
}else {
|
||||
source = '未知';
|
||||
}
|
||||
return source;
|
||||
}
|
||||
}
|
||||
,{field:'level',width:120, title: '操作',templet: function(d){
|
||||
//return '<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>';
|
||||
return '<div class="layui-btn-group">\n' +
|
||||
' <button type="button" class="layui-btn layui-btn-sm" lay-event="xiugai">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
' <button type="button" lay-filter="delete" class="layui-btn layui-btn-sm" lay-event="del">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
//, {title: '操作', fixed: 'right',width:250, align: 'center', toolbar: '#column-toolbar'}
|
||||
] ]
|
||||
,username:'sousuo'
|
||||
,page: true
|
||||
,done:function(res, curr, count){
|
||||
//数据的回调用,可不写
|
||||
}
|
||||
});
|
||||
|
||||
table.on('tool(group)', function(obj){
|
||||
var event = obj.event;
|
||||
var data = obj.data;
|
||||
if(event === 'del'){
|
||||
layer.confirm('删除该群组后,该群组下的所有用户将会自动恢复到默认群组,确认删除该群组吗?', function(index){
|
||||
//obj.del(); //删除对应行(tr)的DOM结构
|
||||
delectgroup(data.id)
|
||||
layer.close(index);
|
||||
});
|
||||
}else if(event === 'xiugai'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'分发群组',
|
||||
shadeClose: true,
|
||||
skin: 'layui-layer-rim', //加上边框
|
||||
area: ['420px', '300px'], //宽高
|
||||
content: '/admin/root/modifygroup?id='+data.id
|
||||
,end:function(){
|
||||
table.reload('datas');//重新获取表数据
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//监听头工具栏事件
|
||||
table.on('toolbar(group)', function(obj){
|
||||
// var tc = table.checkStatus('tableid');//通过指定的table初始化id获取选中的数据
|
||||
var checkStatus = table.checkStatus(obj.config.id)
|
||||
,data = checkStatus.data; //获取选中的数据
|
||||
switch(obj.event){
|
||||
case 'add':
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'用户容量',
|
||||
shadeClose: true,
|
||||
skin: 'layui-layer-rim', //加上边框
|
||||
area: ['420px', '340px'], //宽高
|
||||
content: '/admin/root/addgroup'
|
||||
,end:function(){
|
||||
table.reload('datas');//重新获取表数据
|
||||
}
|
||||
|
||||
});
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
function delectgroup(id) {
|
||||
var index= layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/delegroup",
|
||||
data: {id:id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
}else if(data==-1){
|
||||
layer.msg('默认分组不可以删除', {icon: 2});
|
||||
}else{
|
||||
layer.msg('删除失败,请刷新页面尝试重试', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
}
|
||||
function generate(code) {
|
||||
layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
var sizeval = $('#sizeval').val();
|
||||
var counts = $('#counts').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/addcode",
|
||||
data: {value:sizeval,counts:counts},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('添加成功', {icon: 1});
|
||||
}else{
|
||||
layer.msg('添加失败', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.closeAll();
|
||||
}
|
||||
|
||||
function xiugai() {
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,149 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>图片审核配置</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<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>
|
||||
<div class="layui-main" style="width: 50%;margin-top: 50px;">
|
||||
<h2>百度鉴黄Key配置</h2>
|
||||
<br/>
|
||||
<span style="color: #DAA5A6;"><span style="font-weight: bold">注意:</span>若您修改了配置文件中的默认定时器配置,设置的周期表达式必须小于一天。否则会有遗漏<br/>推荐设置为:每天某个时辰执行、或每几个小时、每几分钟执行一次。</span>
|
||||
<p> </p>
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">鉴黄检测</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="open" type="checkbox" name="close" lay-skin="switch" lay-filter="switchTest"
|
||||
lay-text="ON|OFF">
|
||||
<!-- <input type="checkbox" name="open" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">-->
|
||||
<span style="color: #DAA5A6;">开启前保证下方信息填写正确,并已保存</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">APP_ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="appid" type="text" name="title" autocomplete="off" placeholder="APP_ID" class="layui-input"
|
||||
th:value="${appid}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">API_KEY</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="apikey" type="text" name="title" autocomplete="off" placeholder="API_KEY" class="layui-input"
|
||||
th:value="${apikey}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">SECRET_KEY</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="secretkey" type="text" name="title" autocomplete="off" placeholder="SECRET_KEY"
|
||||
class="layui-input" th:value="${secretkey}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<a class="layui-btn" lay-submit="" lay-filter="demo2" onclick="updataimgreview()">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
/**
|
||||
* 禁用 ajax 缓存
|
||||
*/
|
||||
$.ajaxSetup({
|
||||
cache: false
|
||||
});
|
||||
var using = [[${using}]];
|
||||
|
||||
$(function () {
|
||||
layui.use(['form', 'layedit', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
//监听提交
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
layer.msg(JSON.stringify(data.field));
|
||||
return false;
|
||||
});
|
||||
//监听指定开关
|
||||
form.on('switch(switchTest)', function (data) {
|
||||
// layer.msg('开关checked:'+ (this.checked ? 'true' : 'false'), {
|
||||
// offset: '6px'
|
||||
// });
|
||||
if (this.checked == true) {
|
||||
var appid = $("#appid").val();
|
||||
var apikey = $("#apikey").val();
|
||||
var secretkey = $("#secretkey").val();
|
||||
if (appid != "" && apikey != "" && secretkey != "") {
|
||||
imgreview(1);
|
||||
}else{
|
||||
layer.msg("开启失败,各项内容不能为空", {icon: 2});
|
||||
}
|
||||
} else {
|
||||
imgreview(0);
|
||||
}
|
||||
//layer.tips('温馨提示:请注意开关状态的文字可以随意定义,而不仅仅是ON|OFF', data.othis)
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
if (using == 1) {
|
||||
$('#open').attr("checked", 'hellohao'); //增加属性
|
||||
} else {
|
||||
$('#open').removeAttr("checked"); //移除属性
|
||||
}
|
||||
});
|
||||
|
||||
function imgreview(values) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/ImgreviewSwitch",
|
||||
dataType: "text",
|
||||
data: {using: values},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
if (values == 1) {
|
||||
layer.msg('鉴黄检测已开启');
|
||||
} else {
|
||||
layer.msg('鉴黄检测已关闭');
|
||||
}
|
||||
} else {
|
||||
layer.msg('系统异常,请刷新重试。');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//修改百度图片鉴别
|
||||
function updataimgreview() {
|
||||
var appid = $("#appid").val();
|
||||
var apikey = $("#apikey").val();
|
||||
var secretkey = $("#secretkey").val();
|
||||
if (appid != "" && apikey != "" && secretkey != "") {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/ImgreviewSwitch",
|
||||
dataType: "text",
|
||||
data: {appId: appid, apiKey: apikey, secretKey: secretkey},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
layer.msg("保存成功", {icon: 1});
|
||||
//window.location.reload();
|
||||
} else {
|
||||
layer.msg("保存失败,请尝试刷新页面后操作", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg("各项内容均不能为空", {icon: 2});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,317 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-control" content="no-cache">
|
||||
<meta http-equiv="Cache" content="no-cache">
|
||||
<title>图床后台管理</title>
|
||||
<!-- <link rel="shortcut icon" href="https://hellohao.nos-eastchina1.126.net/BlogImg/favicon.ico" type="image/x-icon"/>-->
|
||||
<link rel="shortcut icon" th:href="${config.getWebfavicons()}" type="image/x-icon"/>
|
||||
<link rel="icon" type="image/ico" th:href="${config.getWebfavicons()}" />
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<link rel="stylesheet" th:href="@{/layui/css/admin.css}">
|
||||
<style>
|
||||
body{
|
||||
font-family: K2D, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
}
|
||||
/*.layui-logo{*/
|
||||
/* font-family: 'Old English Text MT', 'EngraversOldEnglishBT-Bold', 'Lato', "PingFang SC", "Microsoft YaHei", sans-serif;*/
|
||||
/*}*/
|
||||
#titles{
|
||||
font-size: 1.2em;
|
||||
}
|
||||
</style>
|
||||
</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> 图床后台管理 </cite>-->
|
||||
<span id="titles"> <i style="font-size: 1.5em;" class="layui-icon layui-icon-engine"> </i>Console</span>
|
||||
</div>
|
||||
<!-- 头部区域 -->
|
||||
<ul class="layui-nav layui-layout-left">
|
||||
<li class="layui-nav-item" lay-unselect>
|
||||
<a lay-event="flexible" title="侧边伸缩">
|
||||
<i class="layui-icon layui-icon-shrink-right" onclick="cebian()"></i>
|
||||
</a>
|
||||
</li>
|
||||
<!-- 面包屑 -->
|
||||
<span class="layui-breadcrumb">
|
||||
<a><cite>首页</cite></a>
|
||||
</span>
|
||||
</ul>
|
||||
<!-- 头像区域 -->
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
<li class="layui-nav-item">
|
||||
<a lay-event="GoMain" title="返回首页"><img th:src="@{/layui/images/main.png}" alt=""
|
||||
style="height: 18px;"/></a>
|
||||
</li>
|
||||
<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="头像">
|
||||
<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="javascript:void(0);" onclick="exit()">退出</a>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- 左侧导航区域 -->
|
||||
<div class="layui-side">
|
||||
<div class="layui-side-scroll" style="position: relative;">
|
||||
<ul class="layui-nav layui-nav-tree" lay-filter="test" lay-accordion="true">
|
||||
<li class="layui-nav-item">
|
||||
<a lay-url="/table.html" lay-id="home" style="font-weight: 500;">
|
||||
<i class="layui-icon layui-icon-home"></i> <cite>系统概况</cite>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<li class="layui-nav-item xiaoguo layui-nav-itemed">
|
||||
<a style="font-weight: 500;">
|
||||
<i class="layui-icon layui-icon-username"></i> <cite>个人中心</cite>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="01" lay-url="/admin/admin">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>图片列表</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="12" lay-url="/admin/albumlist">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>我的画廊</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="3" lay-url="/admin/tosetuser">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>修改密码</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child" th:if=" ${api} gt '0'">
|
||||
<dd>
|
||||
<a href="#" lay-id="7" lay-url="/admin/toapi">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>API接口</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item xiaoguo" th:if=" ${levels} gt '1'">
|
||||
<a style="font-weight: 500;">
|
||||
<i class="layui-icon layui-icon-user"></i> <cite>用户管理</cite>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="1" lay-url="/admin/root/touser">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>用户列表</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="9" lay-url="/admin/root/group">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>分发群组</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="8" lay-url="/admin/root/tocode">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>扩 容 码</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item xiaoguo" th:if=" ${levels} gt '1'">
|
||||
<a style="font-weight: 500;">
|
||||
<i class="layui-icon layui-icon-set-sm"></i> <cite>系统设置</cite>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="2" lay-url="/admin/root/tostorage">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>存储配置</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="11" lay-url="/admin/root/ImageReview">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>图片鉴黄</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="4" lay-url="/admin/root/emailconfig">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>邮箱配置</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="5" lay-url="/admin/root/towebconfig">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>站点配置</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item xiaoguo" th:if=" ${levels} gt '1'">
|
||||
<a style="font-weight: 500;">
|
||||
<i class="layui-icon layui-icon-about"></i> <cite>更 多</cite>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="#" lay-id="6" lay-url="/admin/root/about">
|
||||
<i class="layui-icon layui-icon-right"></i><cite>关于系统</cite>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="leftstate" style=" color:#f2f2f2;font-size:10px;height: 10px;position:absolute;bottom:55px; width: 70%;margin-left: 7%;">
|
||||
<div class="layui-progress layui-progress-big" lay-filter="datasize" style="height: 12px;position:absolute;bottom:20px; width: 100%;margin-left: 3%;" >
|
||||
<div class="layui-progress-bar layui-bg-blue" lay-percent="100%" style="height: 12px;width: 160px;"></div>
|
||||
</div>
|
||||
<h3 STYLE="text-align: center;" id="ncqk">当前空间:1024M/1024M</h3>
|
||||
<h3 STYLE="text-align: center;"><a style="color: #1E9FFF;font-weight: bold;cursor:pointer;" onclick="kuorong()" title="获取更大空间">扩 容</a></h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-body">
|
||||
<div class="layui-pagetabs">
|
||||
<div class="layui-icon admin-tabs-control layui-icon-refresh-3" lay-event="refresh"></div>
|
||||
<div class="layui-tab" lay-unauto lay-allowclose="true" lay-filter="lay-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li lay-id="home" lay-url="/survey.html" class="layui-this"><i
|
||||
class="layui-icon layui-icon-home"></i></li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<iframe src="/admin/tosurvey" class="layui-iframe"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="rightmenu">
|
||||
<li data-type="closethis">关闭此页</li>
|
||||
<li data-type="closeall">关闭所有</li>
|
||||
<li data-type="closeothers">关闭其他</li>
|
||||
<li data-type="closeleft">关闭左侧</li>
|
||||
<li data-type="closeright">关闭右侧</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="layui-footer">
|
||||
<!-- 底部固定区域 -->
|
||||
copyright © 2019 <a href="http://www.hellohao.cn/" target="_blank">Hellohao</a> 切勿上传违反中华人民共和国互联网法律条约资源.
|
||||
</div>
|
||||
<div class="site-mobile-shade"></div>
|
||||
</div>
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script th:src="@{/layui/js/jquery.js}"></script>
|
||||
<script th:src="@{/layui/js/zadmin.js}"></script>
|
||||
<script th:src="@{/js/js.cookie.min.js}"></script>
|
||||
<!--<script th:src="@{/js/hellohao.js}"></script>-->
|
||||
<script>
|
||||
var usermemory = Number([[${usermemory}]]);
|
||||
var memory = Number([[${memory}]]);
|
||||
var ret = (usermemory/memory)*100;
|
||||
layui.use(['form', 'layedit', 'laydate','element'], function () {
|
||||
var form = layui.form
|
||||
, layer = layui.layer
|
||||
var element = layui.element;
|
||||
if(memory==-1){
|
||||
element.progress('datasize', '100%');
|
||||
$('#ncqk').text('当前空间:'+usermemory+'M/无限制');
|
||||
}else{
|
||||
element.progress('datasize', ret+'0%');
|
||||
$('#ncqk').text('当前空间:'+usermemory+'M/'+memory+'M');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function kuorong() {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title:'空间扩容',
|
||||
shadeClose: true,
|
||||
//skin: 'layui-layer-rim', //加上边框
|
||||
area: ['450px', '240px'], //宽高
|
||||
content: '<div style="width: 360px;"><br /><br /><div class="layui-form-item">\n' +
|
||||
' <label class="layui-form-label">扩容码:</label>\n' +
|
||||
' <div class="layui-input-block">\n' +
|
||||
' <input type="text" name="title" id="krm" required lay-verify="required" placeholder="请输入你的扩容码" autocomplete="off" class="layui-input"> ' +
|
||||
'<span style="color: #DAA5A6; font-size: 12px;">扩容码为一次性,只能扩容一次,切勿泄露。</span><br/><br/><button type="button" onclick="kr()" style="float: right;" class="layui-btn layui-btn-radius layui-btn-normal" onclick="">激 活</button>'+
|
||||
' </div>\n' +
|
||||
'</div></div>'
|
||||
});
|
||||
}
|
||||
function kr() {
|
||||
var krm = $('#krm').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/kuorong",
|
||||
dataType: "json",
|
||||
data:{codestring:krm},
|
||||
success: function (data) {
|
||||
if(data.ret>0){
|
||||
layer.msg('扩容成功,当前总空间:'+data.sizes+'M', {icon: 1});
|
||||
}else if(data.ret ==-1){
|
||||
layer.msg('很抱歉,该扩容码不存在', {icon: 2});
|
||||
}else{
|
||||
layer.msg('很网络超时,请刷新页面后重新尝试', {icon: 2});
|
||||
}
|
||||
//parent.location.reload();//刷新父元素
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//网站退出
|
||||
function exit() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/exit.do",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
// $.cookie('name_hellohaobycookie', null);
|
||||
// $.cookie('pass_hellohaobycookie', null);
|
||||
layer.msg('账号已退出', {icon: 1});
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,89 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<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" th:href="@{/layui/layui/css/layui.css}">
|
||||
</head>
|
||||
<body>
|
||||
<br />
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">用户容量(M)</label>
|
||||
<div class="layui-input-inline">
|
||||
<input id="memory" style="width: 250px;" th:value="${memory}" type="number" name="groupname" lay-verify="required|phone" autocomplete="off" class="layui-input">
|
||||
<input th:value="${uid}" type="hidden" id="uid"/>
|
||||
</div>
|
||||
</div>
|
||||
<form class="layui-form">
|
||||
<label class="layui-form-label">所属群组</label>
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<select id="group" name="quiz1" style="max-height: 360px;">
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<br/><br/><button type="button" style="float: right;margin-right: 65px;" class="layui-btn layui-btn-radius layui-btn-normal" onclick="updateuser()">保 存</button>
|
||||
</div>
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script>
|
||||
var groupid = [[${groupid!=null?groupid:0}]];
|
||||
var id = [[${id}]];
|
||||
var uid = $('#uid').val();
|
||||
var form = null;
|
||||
layui.use(['form','table','layer'], function(){
|
||||
table = layui.table;
|
||||
var layer = layui.layer;
|
||||
form = layui.form;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/getgrouplist",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
var body = '';
|
||||
for(var i=0;i<data.length;i++){
|
||||
body+='<option value="'+data[i].id+'"> '+data[i].groupname+'</option>';
|
||||
}
|
||||
$('#group').append(body);
|
||||
$('#group').val(groupid);
|
||||
form.render('select');
|
||||
}
|
||||
});
|
||||
form.on('select', function(data){
|
||||
groupid = data.value;
|
||||
});
|
||||
});
|
||||
function updateuser() {
|
||||
layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
var memory = $('#memory').val();
|
||||
if(memory!=""){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updateuser",
|
||||
data: {memory:memory,groupid:groupid,uid:uid,id:id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('datas');//重新获取表数据
|
||||
layer.msg('修改成功', {icon: 1});
|
||||
}else{
|
||||
layer.msg('修改失败', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.closeAll();
|
||||
}else{
|
||||
layer.closeAll();
|
||||
layer.msg('用户容量不能为空', {icon: 2});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,77 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<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" th:href="@{/layui/layui/css/layui.css}">
|
||||
</head>
|
||||
<body>
|
||||
<br />
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">群组名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input id="groupname" th:value="${group.getGroupname()}" style="width: 250px;" type="tel" name="groupname" lay-verify="required|phone" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<form class="layui-form">
|
||||
<label class="layui-form-label">所属存储源</label>
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<select id="keyid" name="quiz1" style="max-height: 360px;">
|
||||
<option value="5"> 本地存储</option>
|
||||
<option value="1"> 网易NOS</option>
|
||||
<option value="2"> 阿里OSS</option>
|
||||
<option value="3"> 又拍USS</option>
|
||||
<option value="4"> 七牛云KODO</option>
|
||||
<option value="6"> 腾讯COS</option>
|
||||
<option value="7"> FTP存储</option>
|
||||
<option value="8"> U-File</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<br/><br/><button type="button" style="float: right;margin-right: 65px;" class="layui-btn layui-btn-radius layui-btn-normal" onclick="setgroup()">保 存</button>
|
||||
</div>
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script>
|
||||
var keyid = [[${group.getKeyid()}]];
|
||||
var id = [[${group.getId()}]];
|
||||
layui.use(['form','table','layer'], function(){
|
||||
table = layui.table;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
$('#keyid').val(keyid);
|
||||
form.render('select');
|
||||
form.on('select', function(data){
|
||||
keyid = data.value;
|
||||
});
|
||||
});
|
||||
function setgroup() {
|
||||
layer.msg('加载中', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
var groupname = $('#groupname').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updategroup",
|
||||
data: {groupname:groupname,keyid:keyid,id:id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
layer.msg('保存成功', {icon: 1});
|
||||
}else{
|
||||
layer.msg('保存失败', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.closeAll();
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,133 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>密码修改</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<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>
|
||||
<div class="layui-main" style="width: 50%;margin-top: 50px;">
|
||||
<h2>密码修改</h2>
|
||||
<span id="tishi1" style="color: #DAA5A6;display: none;">只有管理员才能修改邮箱用户名,普通用户不可以修改。</span>
|
||||
<br/>
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<hr/>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">邮箱:</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="email" type="text" name="title" autocomplete="off" disabled="true" class="layui-input"
|
||||
th:value="${user.getEmail()}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户名:</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="username" type="text" name="title" autocomplete="off" disabled="true" class="layui-input"
|
||||
th:value="${user.getUsername()}"/>
|
||||
</div><span id="tishi" style="color: #DAA5A6;display: none;">用户名只可是英文或数字</span>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">密码:</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="newpassword" type="text" name="title" autocomplete="off" placeholder="新密码"
|
||||
class="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">确认密码:</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="registerpassword" type="text" name="title" autocomplete="off" placeholder="确认密码"
|
||||
class="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<a class="layui-btn" lay-submit="" lay-filter="demo2" onclick="change()">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
var level = [[${user.getLevel()}]];
|
||||
layui.use(['form', 'layedit', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
//监听提交
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
layer.msg(JSON.stringify(data.field));
|
||||
return false;
|
||||
});
|
||||
$(function () {
|
||||
if(level==2){
|
||||
$('#username').attr("disabled",false);
|
||||
$('#email').attr("disabled",false);
|
||||
$('#tishi').css('display','block');
|
||||
$('#tishi1').css('display','block');
|
||||
}else{
|
||||
$('#username').attr("disabled",true);
|
||||
$('#email').attr("disabled",true);
|
||||
$('#tishi1').css('display','none');
|
||||
$('#tishi').css('display','none');
|
||||
}
|
||||
})
|
||||
//监听指定开关
|
||||
form.on('switch(switchTest)', function (data) {
|
||||
if (this.checked == true) {
|
||||
imgreview(1);
|
||||
} else {
|
||||
imgreview(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function change() {
|
||||
var email = $("#email").val();
|
||||
var username = $("#username").val();
|
||||
var newpassword = $("#newpassword").val();
|
||||
var registerpassword = $("#registerpassword").val();
|
||||
if ((newpassword != null && newpassword != "") && (registerpassword != null && registerpassword != "")) {
|
||||
var usertype = /^(\d|[a-zA-Z])+$/;
|
||||
if (usertype.test(username) == false || username.length>10) {
|
||||
layer.msg("用户名格式错误", {icon: 2});
|
||||
}else{
|
||||
if (newpassword == registerpassword) {
|
||||
var ze = /^\w+@\w+(\.[a-zA-Z]{2,3}){1,2}$/;
|
||||
if (ze.test(email) == true) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/change",
|
||||
//data:{username:username,password:newpassword},
|
||||
data: {email:email,username:username,password: newpassword},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
layer.msg("修改成功,请重新登录。", {icon: 1});
|
||||
setTimeout(function () {
|
||||
exit();
|
||||
}, 2000);
|
||||
}
|
||||
if (data == "-1") {
|
||||
layer.msg("用户名重复。", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{layer.msg("邮箱格式不正确。", {icon: 2});}
|
||||
} else {
|
||||
layer.msg("两次密码输入不一致。", {icon: 2});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
layer.msg("表单不能为空", {icon: 2});
|
||||
}
|
||||
}
|
||||
function exit() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/exit.do",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
parent.location.reload();//刷新父元素
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,401 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>储存源配置</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<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>
|
||||
<div class="layui-main" style="width: 50%;margin-top: 50px;">
|
||||
<h2>存储源Key配置</h2>
|
||||
<span style="color: #DAA5A6;">此配置仅为保存存储源key信息,若要使用指定存储源,请在【用户管理】-【分发群组】进行指定配置</span>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
|
||||
<div class="layui-form-item tlist">
|
||||
<label class="layui-form-label">对象存储源</label>
|
||||
<div class="layui-input-block">
|
||||
<select id="StorageType" name="city" lay-filter="business" lay-verify="required">
|
||||
<option value="5"> 本地存储</option>
|
||||
<option value="1"> 网易NOS</option>
|
||||
<option value="2"> 阿里OSS</option>
|
||||
<option value="3"> 又拍USS</option>
|
||||
<option value="4"> 七牛云KODO</option>
|
||||
<option value="6"> 腾讯COS</option>
|
||||
<option value="7"> FTP存储</option>
|
||||
<option value="8"> U-File</option>
|
||||
<!-- <i class="layui-icon layui-icon-face-smile" style="margin-right: 10px;float: right;color: red;font-weight: bold;"></i>-->
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<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"
|
||||
class="layui-input" th:value="${AccessKey}"/>
|
||||
</div>
|
||||
</div>
|
||||
<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"
|
||||
class="layui-input" th:value="${AccessSecret}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" id="c3">
|
||||
<label class="layui-form-label" >Endpoint</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="Endpoint" type="text" name="title" autocomplete="off"
|
||||
class="layui-input" th:value="${Endpoint}"/>
|
||||
<span id="ysm" style="color: #DAA5A6;">需带有http://或https://</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item" id="c3-1" style="display: none;">
|
||||
<label class="layui-form-label">桶地区</label>
|
||||
<div class="layui-input-block">
|
||||
<select id="Endpoint2" name="diqu" lay-verify="required">
|
||||
<option value="0">请选择地区</option>
|
||||
<option value="1">华东</option>
|
||||
<option value="2">华北</option>
|
||||
<option value="3">华南</option>
|
||||
<option value="4">北美</option>
|
||||
<option value="5">东南亚</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<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"
|
||||
class="layui-input" th:value="${Bucketname}"/>
|
||||
</div>
|
||||
</div>
|
||||
<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="生成图片url的域名"
|
||||
class="layui-input" th:value="${RequestAddress}"/>
|
||||
<span id="hostsm" style="color: #DAA5A6;">需带有http://或https://</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<h3 id="c6" style="display: none;color: #DAA5A6;">确保站点设置中:【站点域名】已经填写。</h3>
|
||||
<br />
|
||||
<a class="layui-btn" lay-submit="" lay-filter="demo2" onclick="issave();">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
var form = null;
|
||||
layui.use(['form', 'layedit', 'laydate'], function () {
|
||||
form = layui.form;
|
||||
//监听提交
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
layer.msg(JSON.stringify(data.field));
|
||||
return false;
|
||||
});
|
||||
//select选中事件
|
||||
form.on('select(business)', function(data){
|
||||
$("#AccessKey").val('');
|
||||
$("#AccessSecret").val('');
|
||||
$("#Endpoint").val('');
|
||||
$("#Bucketname").val('');
|
||||
$("#RequestAddress").val('');
|
||||
if(data.value!=5){
|
||||
$("#c1").css('display','block');
|
||||
$("#c2").css('display','block');
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','block');
|
||||
$("#c4").css('display','block');
|
||||
$("#c5").css('display','block');
|
||||
$("#c6").css('display','none');
|
||||
if(data.value==1){
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('AccessSecret');
|
||||
$("#c3 label").text('Endpoint');
|
||||
}else if(data.value==2){
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('AccessSecret');
|
||||
$("#c3 label").text('Endpoint');
|
||||
}else if(data.value==3){
|
||||
$("#c3").css('display','none');
|
||||
$("#keyusername").text('操作员名称');
|
||||
$("#keypass").text('操作员密码');
|
||||
$("#c3-1").css('display','none');
|
||||
}else if(data.value==4){
|
||||
$("#c3").css('display','none');
|
||||
$("#c3-1").css('display','block');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('SecretKey');
|
||||
}else if(data.value==6){
|
||||
$("#c3-1").css('display','none');
|
||||
$("#c3 label").text('地区代码');
|
||||
$("#keyusername").text('SecretId');
|
||||
$("#keypass").text('SecretKey');
|
||||
$("#ysm").text("如:北京地区就写ap-beijing");
|
||||
}else if(data.value==7){
|
||||
//$("#c3").css('display','none');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#c4").css('display','none');
|
||||
$("#keyusername").text('FTP账号');
|
||||
$("#keypass").text('FTP密码');
|
||||
$("#c3 label").text('FTP地址');
|
||||
$("#c3 label").text('FTP地址');
|
||||
$("#ysm").text('按格式填写如:127.0.0.1:21不需要添加ftp:// 推荐使用21默认端口,修改过得端口先用xftp等客户端工具测试一下能不能链接。');
|
||||
|
||||
}else if(data.value==8){
|
||||
$("#c3").css('display','none');
|
||||
$("#keyusername").text('操作员名称');
|
||||
$("#keypass").text('操作员密码');
|
||||
$("#c3-1").css('display','none');
|
||||
}else{
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('AccessSecret');
|
||||
$("#c3 label").text('Endpoint');
|
||||
$("#ysm").text('需带有http://或https://');
|
||||
}
|
||||
}else{
|
||||
$("#c1").css('display','none');
|
||||
$("#c2").css('display','none');
|
||||
$("#c3").css('display','none');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#c4").css('display','none');
|
||||
$("#c5").css('display','none');
|
||||
$("#c6").css('display','block');
|
||||
$("#c3 label").text('Endpoint');
|
||||
$("#ysm").text('需带有http://或https://');
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/getkey",
|
||||
data: {
|
||||
storageType: data.value,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$("#AccessKey").val(data[0].accessKey);
|
||||
$("#AccessSecret").val(data[0].accessSecret);
|
||||
$("#Endpoint").val(data[0].endpoint);
|
||||
$("#Bucketname").val(data[0].bucketname);
|
||||
$("#RequestAddress").val(data[0].requestAddress);
|
||||
form.render();
|
||||
}
|
||||
});
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/getkeyourceype",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$("#StorageType").find("option[value='" + data + "']").attr("selected", true);
|
||||
form.render();
|
||||
}
|
||||
});
|
||||
// $(".tlist dd").each(function(){
|
||||
// $(this).append('<img style="float: right;max-width: 23px; margin-top: 5px;" src="/img/ld.gif" />');
|
||||
// });
|
||||
v();
|
||||
});
|
||||
$(function () {
|
||||
var types = [[${StorageType!=null?StorageType:0}]];
|
||||
var Endpoint2=null;
|
||||
if(types==1){
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('AccessSecret');
|
||||
$("#c3 label").text('Endpoint');
|
||||
}else if(types==2){
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('AccessSecret');
|
||||
$("#c3 label").text('Endpoint');
|
||||
}else if(types==3){
|
||||
$("#c3").css('display','none');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('操作员名称');
|
||||
$("#keypass").text('操作员密码');
|
||||
$("#c3 label").text('Endpoint');
|
||||
}else if(types==4){
|
||||
Endpoint2 = [[${Endpoint2!=''?Endpoint2:0}]];
|
||||
$("#c3").css('display','none');
|
||||
$("#c3-1").css('display','block');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('SecretKey');
|
||||
$("#c3 label").text('Endpoint');
|
||||
$("#Endpoint2").find("option[value='" + Endpoint2 + "']").attr("selected", true);
|
||||
}else if(types==5){
|
||||
Endpoint2 = [[${Endpoint2!=''?Endpoint2:0}]];
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('SecretKey');
|
||||
$("#c1").css('display','none');
|
||||
$("#c2").css('display','none');
|
||||
$("#c3").css('display','none');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#c4").css('display','none');
|
||||
$("#c5").css('display','none');
|
||||
$("#c6").css('display','block');
|
||||
}else if(types==6){
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#c3 label").text('地区代码');
|
||||
$("#keyusername").text('SecretId');
|
||||
$("#keypass").text('SecretKey');
|
||||
$("#ysm").text("如:北京地区就写ap-beijing");
|
||||
}else if(types==7){
|
||||
$("#c3-1").css('display','none');
|
||||
$("#c4").css('display','none');
|
||||
$("#keyusername").text('FTP账号');
|
||||
$("#keypass").text('FTP密码');
|
||||
$("#c3 label").text('FTP地址');
|
||||
$("#ysm").text('按格式填写如:127.0.0.1:21不需要添加ftp:// 推荐使用21默认端口,修改过得端口先用xftp等客户端工具测试一下能不能链接。');
|
||||
|
||||
}else if(types==8){
|
||||
$("#c3").css('display','none');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('操作员名称');
|
||||
$("#keypass").text('操作员密码');
|
||||
$("#c3 label").text('Endpoint');
|
||||
}else{
|
||||
$("#c3").css('display','block');
|
||||
$("#c3-1").css('display','none');
|
||||
$("#keyusername").text('AccessKey');
|
||||
$("#keypass").text('AccessSecret');
|
||||
$("#c3 label").text('Endpoint');
|
||||
$("#ysm").text('需带有http://或https://');
|
||||
}
|
||||
//v();
|
||||
form.render();
|
||||
});
|
||||
function issave() {
|
||||
var AccessKey = $("#AccessKey").val();
|
||||
var AccessSecret = $("#AccessSecret").val();
|
||||
var Endpoint = "";
|
||||
var Bucketname = $("#Bucketname").val();
|
||||
var RequestAddress = $("#RequestAddress").val();
|
||||
var StorageType = $("#StorageType").val();
|
||||
if(StorageType==3){Endpoint="0";}
|
||||
else{
|
||||
if(StorageType==4){Endpoint = $("#Endpoint2").val();}else{Endpoint = $("#Endpoint").val();}
|
||||
}
|
||||
if($("#StorageType").val()==5){
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/admin/root/updatekey",
|
||||
// data: {
|
||||
// AccessKey: 0,
|
||||
// AccessSecret: 0,
|
||||
// Endpoint: 0,
|
||||
// Bucketname: 0,
|
||||
// RequestAddress: 0,
|
||||
// StorageType: 5
|
||||
// },
|
||||
// dataType: "json",
|
||||
// success: function (data) {
|
||||
// if (data > 0) {
|
||||
// layer.msg("保存成功", {icon: 1});
|
||||
// } else if(data==-1){
|
||||
// layer.msg("对象存储有参数为空,初始化失败", {icon: 2});
|
||||
// }else{
|
||||
// layer.msg("保存失败", {icon: 2});
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
layer.msg("本都存储不需要保存配置", {icon: 4});
|
||||
}else if($("#StorageType").val()==7){
|
||||
if(AccessKey!="" && AccessSecret!="" &&Endpoint!="" && RequestAddress!="" && StorageType!=""){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updatekey",
|
||||
data: {
|
||||
AccessKey: AccessKey,
|
||||
AccessSecret: AccessSecret,
|
||||
Endpoint: Endpoint,
|
||||
Bucketname: Bucketname,
|
||||
RequestAddress: RequestAddress,
|
||||
StorageType: StorageType
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
layer.msg("保存成功", {icon: 1});
|
||||
} else if(data==-1){
|
||||
layer.msg("对象存储初始化失败,请检查参数是否正确", {icon: 2});
|
||||
}else{
|
||||
layer.msg("保存失败", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg("有参数不正确,请检查", {icon: 2});
|
||||
}
|
||||
}else{
|
||||
if(AccessKey!="" && AccessSecret!="" &&Endpoint!="" && Bucketname!="" && RequestAddress!="" && StorageType!=""){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updatekey",
|
||||
data: {
|
||||
AccessKey: AccessKey,
|
||||
AccessSecret: AccessSecret,
|
||||
Endpoint: Endpoint,
|
||||
Bucketname: Bucketname,
|
||||
RequestAddress: RequestAddress,
|
||||
StorageType: StorageType
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
layer.msg("保存成功", {icon: 1});
|
||||
} else if(data==-1){
|
||||
layer.msg("对象存储初始化失败,请检查参数是否正确", {icon: 2});
|
||||
}else{
|
||||
layer.msg("保存失败", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg("有参数不正确,请检查", {icon: 2});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function v() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/tocheck",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$.each(data, function(i) {
|
||||
$(".tlist dd").each(function(){
|
||||
var temp = $(this).attr("lay-value");
|
||||
if(temp==i){
|
||||
//$(this).remove('img');
|
||||
if(data[i]==1){
|
||||
$(this).append('<img style="float: right;max-width: 23px; margin-top: 5px;" src="/img/yx.png" />');
|
||||
}else {
|
||||
$(this).append('<img style="float: right;max-width: 23px; margin-top: 5px;" src="/img/sx.png" />');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,475 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>本站概况</title>
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<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/font-awesome.css}" rel="stylesheet" />
|
||||
<link th:href="@{/static/css/custom.css}" rel="stylesheet" />
|
||||
<link th:href="@{/static/css/style.css}" rel="stylesheet" />
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}" />
|
||||
<link rel="stylesheet" th:href="@{/static/css/animate.min.css}" />
|
||||
</head>
|
||||
|
||||
<body class="gray-bg">
|
||||
<div>
|
||||
<div class="row" style="width: 95%; margin: 0 auto;margin-top: 50px;" th:if=" ${levels} gt '1'">
|
||||
<h3 class="font-bold">开发者公告</h3>
|
||||
</div>
|
||||
<div class="row " style="width: 95%; margin: 0 auto;margin-top: 50px;" th:if=" ${levels} gt '1'">
|
||||
<blockquote class="animated fadeInRight">
|
||||
<p class="bg-primary" id="notice" style="border-radius: 5px;padding: 20px;line-height: 27px;">暂无重要公告通知。</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row" style="width: 95%; margin: 0 auto;margin-top: 50px;" th:if=" ${levels} gt '1'">
|
||||
<h3 class="font-bold">系统概况</h3>
|
||||
</div>
|
||||
|
||||
<div class="row" style="width: 95%; margin: 0 auto;margin-top: 50px;" th:if=" ${levels} eq '1'">
|
||||
<h2 class="font-bold"> </h2>
|
||||
</div>
|
||||
<div class="wrapper wrapper-content" th:if=" ${levels} gt '1'">
|
||||
<div class="row" style="width: 95%; margin: 0 auto;">
|
||||
<div class="col-sm-3 Mouseevent animated fadeInLeft">
|
||||
<div class="widget style1 navy-bg">
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<i class="glyphicon glyphicon-picture" style="font-size: 4.0em;"></i>
|
||||
</div>
|
||||
<div class="col-xs-8 text-right">
|
||||
<span> 本站累计图片总数 </span>
|
||||
<h2 class="font-bold" id="counts">0</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 Mouseevent animated fadeInLeft">
|
||||
<div class="widget style1 navy-bg" style="background-color: #4ebd87;">
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<i class="glyphicon glyphicon-user fa-5x" style="font-size: 3.6em;"></i>
|
||||
</div>
|
||||
<div class="col-xs-8 text-right">
|
||||
<span> 用户总数 </span>
|
||||
<h2 class="font-bold" id="getusertotal">0</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 Mouseevent animated fadeInLeft">
|
||||
<div class="widget style1 yellow-bg">
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<i class="glyphicon glyphicon-remove-sign fa-5x" style="font-size: 3.6em;"></i>
|
||||
</div>
|
||||
<div class="col-xs-8 text-right">
|
||||
<span>非法图片拦截 </span>
|
||||
<h2 class="font-bold" id="imgreviewcount">0</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 Mouseevent animated fadeInLeft">
|
||||
<div class="widget style1 lazur-bg">
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<i class="glyphicon glyphicon-tasks fa-5x" style="font-size: 4.0em;"></i>
|
||||
</div>
|
||||
<div class="col-xs-8 text-right">
|
||||
<span>游客使用量(M)</span>
|
||||
<h2 class="font-bold" id="source">未知</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 50px;width: 95%; margin: 0 auto;">
|
||||
<h3 class="font-bold">我的信息</h3>
|
||||
</div>
|
||||
<div class="row" style="width: 95%; margin: 0 auto;">
|
||||
<div class="col-sm-6 Mouseevent animated fadeInRight">
|
||||
<div class="widget navy-bg no-padding">
|
||||
<div class="p-m">
|
||||
<h2 class="m-xs">容量使用 <a class="layui-btn layui-btn-sm layui-btn-danger" style="height: 23px;line-height: 24px;" onclick="kuorong()" title="获取更大空间">扩 容</a></h2>
|
||||
<h3 class="font-bold no-margins" id="ly">
|
||||
<div id="leftstate" style=" color:#f2f2f2;font-size:10px;height: 10px;position:absolute;bottom:55px; width: 70%;z-index: 1;">
|
||||
<div class="layui-progress layui-progress-big" lay-filter="datasize" style="height: 12px;position:absolute;bottom:20px; width: 100%;margin-left: 3%;" >
|
||||
<div class="layui-progress-bar layui-bg-blue" lay-percent="100%" style="height: 12px;width: 160px;"></div>
|
||||
</div>
|
||||
<h3 STYLE="text-align: center;" id="ncqk">当前空间:1024M/1024M</h3>
|
||||
</div>
|
||||
</h3>
|
||||
<h3 class="m-xs">
|
||||
<br />
|
||||
<!-- <a class="layui-btn layui-btn-sm layui-btn-radius layui-btn-danger" onclick="kuorong()" title="获取更大空间"> </a>-->
|
||||
</h3>
|
||||
</div>
|
||||
<div class="flot-chart">
|
||||
<div class="flot-chart-content" id="flot-chart1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 Mouseevent animated fadeInRight">
|
||||
<div class="widget lazur-bg no-padding">
|
||||
<div class="p-m">
|
||||
<h1 class="m-xs" id="usercount">0</h1>
|
||||
<h3 class="font-bold no-margins">
|
||||
我的图片总数
|
||||
</h3>
|
||||
<small></small>
|
||||
</div>
|
||||
<div class="flot-chart">
|
||||
<div class="flot-chart-content" id="flot-chart2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="widget yellw-bg no-padding">
|
||||
<table class="table" >
|
||||
<tbody>
|
||||
<tr class="animated fadeInRight">
|
||||
<td>
|
||||
<button type="button" class="btn btn-danger m-r-sm">系统名称:</button>
|
||||
<span th:text="${sysetmname}" style="font-weight: bold;"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="animated fadeInRight">
|
||||
<td>
|
||||
<button type="button" class="btn btn-info m-r-sm">系统架构:</button>
|
||||
<span th:text="${isarch}" style="font-weight: bold;"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="animated fadeInRight">
|
||||
<td>
|
||||
<button type="button" class="btn btn-info m-r-sm">JDK版本:</button>
|
||||
<span th:text="${jdk}" style="font-weight: bold;"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="animated fadeInRight">
|
||||
<td>
|
||||
<button type="button" class="btn btn-info m-r-sm">开发语言:</button>
|
||||
<span style="font-weight: bold;">JAVA开发</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- 全局js -->
|
||||
<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>
|
||||
<!-- 自定义js -->
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script>
|
||||
var usermemory = Number([[${usermemory}]]);
|
||||
var memory = Number([[${memory}]]);
|
||||
var ret = (usermemory/memory)*100;
|
||||
layui.use(['form', 'layedit', 'laydate','element'], function () {
|
||||
var form = layui.form
|
||||
, layer = layui.layer
|
||||
var element = layui.element;
|
||||
if(memory==-1){
|
||||
element.progress('datasize', '100%');
|
||||
$('#ncqk').text('当前空间:'+usermemory+'M/无限制');
|
||||
}else{
|
||||
element.progress('datasize', ret+'0%');
|
||||
$('#ncqk').text('当前空间:'+usermemory+'M/'+memory+'M');
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
//获取本站概况
|
||||
$.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.VisitorUpload == 1) {
|
||||
if(data.VisitorMemory==-1){
|
||||
str ='无限制';
|
||||
}else{
|
||||
str = data.UsedSize+"/"+data.VisitorMemory;
|
||||
}
|
||||
} else{
|
||||
str = "禁用";
|
||||
}
|
||||
$("#source").text(str);
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/getNotice",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#notice').text(data.data);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
$(document).ready(function () {
|
||||
var d1 = [ [1262304000000, 6], [1264982400000, 3057], [1267401600000, 20434], [1270080000000, 31982], [1272672000000, 26602], [1275350400000, 27826], [1277942400000, 24302], [1280620800000, 24237], [1283299200000, 21004], [1285891200000, 12144], [1288569600000, 10577], [1291161600000, 10295] ];
|
||||
var d2 = [ [1262304000000, 5], [1264982400000, 200], [1267401600000, 1605], [1270080000000, 6129], [1272672000000, 11643], [1275350400000, 19055], [1277942400000, 30062], [1280620800000, 39197], [1283299200000, 37000], [1285891200000, 27000], [1288569600000, 21000], [1291161600000, 17000] ];
|
||||
|
||||
var data1 = [
|
||||
{
|
||||
label: "Data 1",
|
||||
data: d1,
|
||||
color: '#17a084'
|
||||
},
|
||||
{
|
||||
label: "Data 2",
|
||||
data: d2,
|
||||
color: '#127e68'
|
||||
}
|
||||
];
|
||||
$.plot($("#flot-chart1"), data1, {
|
||||
xaxis: {
|
||||
tickDecimals: 0
|
||||
},
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fillColor: {
|
||||
colors: [ {
|
||||
opacity: 1
|
||||
}, {
|
||||
opacity: 1
|
||||
} ]
|
||||
},
|
||||
},
|
||||
points: {
|
||||
width: 0.1,
|
||||
show: false
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
borderWidth: 0
|
||||
},
|
||||
legend: {
|
||||
show: false,
|
||||
}
|
||||
});
|
||||
|
||||
var data2 = [
|
||||
{
|
||||
label: "Data 1",
|
||||
data: d1,
|
||||
color: '#19a0a1'
|
||||
}
|
||||
];
|
||||
$.plot($("#flot-chart2"), data2, {
|
||||
xaxis: {
|
||||
tickDecimals: 0
|
||||
},
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fillColor: {
|
||||
colors: [ {
|
||||
opacity: 1
|
||||
}, {
|
||||
opacity: 1
|
||||
} ]
|
||||
},
|
||||
},
|
||||
points: {
|
||||
width: 0.1,
|
||||
show: false
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
borderWidth: 0
|
||||
},
|
||||
legend: {
|
||||
show: false,
|
||||
}
|
||||
});
|
||||
|
||||
var data3 = [
|
||||
{
|
||||
label: "Data 1",
|
||||
data: d1,
|
||||
color: '#fbbe7b'
|
||||
},
|
||||
{
|
||||
label: "Data 2",
|
||||
data: d2,
|
||||
color: '#f8ac59'
|
||||
}
|
||||
];
|
||||
$.plot($("#flot-chart3"), data3, {
|
||||
xaxis: {
|
||||
tickDecimals: 0
|
||||
},
|
||||
series: {
|
||||
lines: {
|
||||
show: true,
|
||||
fill: true,
|
||||
fillColor: {
|
||||
colors: [ {
|
||||
opacity: 1
|
||||
}, {
|
||||
opacity: 1
|
||||
} ]
|
||||
},
|
||||
},
|
||||
points: {
|
||||
width: 0.1,
|
||||
show: false
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
show: false,
|
||||
borderWidth: 0
|
||||
},
|
||||
legend: {
|
||||
show: false,
|
||||
}
|
||||
});
|
||||
|
||||
$('.i-checks').iCheck({
|
||||
checkboxClass: 'icheckbox_square-green',
|
||||
radioClass: 'iradio_square-green',
|
||||
});
|
||||
|
||||
$(".todo-list").sortable({
|
||||
placeholder: "sort-highlight",
|
||||
handle: ".handle",
|
||||
forcePlaceholderSize: true,
|
||||
zIndex: 999999
|
||||
}).disableSelection();;
|
||||
|
||||
var mapData = {
|
||||
"US": 498,
|
||||
"SA": 200,
|
||||
"CA": 1300,
|
||||
"DE": 220,
|
||||
"FR": 540,
|
||||
"CN": 120,
|
||||
"AU": 760,
|
||||
"BR": 550,
|
||||
"IN": 200,
|
||||
"GB": 120,
|
||||
"RU": 2000
|
||||
};
|
||||
|
||||
$('#world-map').vectorMap({
|
||||
map: 'world_mill_en',
|
||||
backgroundColor: "transparent",
|
||||
regionStyle: {
|
||||
initial: {
|
||||
fill: '#e4e4e4',
|
||||
"fill-opacity": 1,
|
||||
stroke: 'none',
|
||||
"stroke-width": 0,
|
||||
"stroke-opacity": 0
|
||||
}
|
||||
},
|
||||
series: {
|
||||
regions: [ {
|
||||
values: mapData,
|
||||
scale: ["#1ab394", "#22d6b1"],
|
||||
normalizeFunction: 'polynomial'
|
||||
} ]
|
||||
},
|
||||
});
|
||||
});
|
||||
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 ("夜里好!")
|
||||
}
|
||||
}
|
||||
//扩容
|
||||
function kuorong() {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title:'空间扩容',
|
||||
shadeClose: true,
|
||||
//skin: 'layui-layer-rim',
|
||||
area: ['450px', '240px'],
|
||||
content: '<div style="width: 360px;"><br /><br /><div class="layui-form-item">\n' +
|
||||
' <label class="layui-form-label"style="width: 90px;">扩容码:</label>\n' +
|
||||
' <div class="layui-input-block">\n' +
|
||||
' <input type="text" name="title" id="krm" required lay-verify="required" placeholder="请输入你的扩容码" autocomplete="off" class="layui-input"> ' +
|
||||
'<span style="color: #DAA5A6; font-size: 12px;">扩容码为一次性,只能扩容一次,切勿泄露。</span><br/><br/><button type="button" onclick="kr()" style="float: right;" class="layui-btn layui-btn-radius layui-btn-normal" onclick="">激 活</button>'+
|
||||
' </div>\n' +
|
||||
'</div></div>'
|
||||
});
|
||||
}
|
||||
function kr() {
|
||||
var krm = $('#krm').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/kuorong",
|
||||
dataType: "json",
|
||||
data:{codestring:krm},
|
||||
success: function (data) {
|
||||
if(data.ret>0){
|
||||
layer.msg('扩容成功,当前总空间:'+data.sizes+'M', {icon: 1});
|
||||
setTimeout(function () { window.location.reload(); }, 2000);
|
||||
}else if(data.ret ==-1){
|
||||
layer.msg('很抱歉,该扩容码不存在', {icon: 2});
|
||||
}else{
|
||||
layer.msg('很网络超时,请刷新页面后重新尝试', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(".Mouseevent").each(function(index){
|
||||
$(this).mouseenter(function(obj) {
|
||||
$(this).removeClass('fadeInLeft');
|
||||
$(this).addClass('pulse');
|
||||
});
|
||||
$(this).mouseleave(function(obj) {
|
||||
$(this).removeClass('pulse');
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,571 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- release v4.1.8, copyright 2014 - 2015 Kartik Visweswaran -->
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>图片列表</title>
|
||||
<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/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/login-register.css}" media="all" rel="stylesheet" type="text/css"/>
|
||||
<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" type="text/css" media="all" th:href="@{/static/css/daterangepicker-bs3.css}" />
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}" />
|
||||
<link rel="stylesheet" th:href="@{/css/viewer.css}" />
|
||||
|
||||
<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/login-register.js}"></script>
|
||||
<script th:src="@{/static/bootstrap-3.3.4-dist/js/bootstrap-table-hellohao1.13.1.js}"></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>
|
||||
<script th:src="@{/static/js/moment.js}"></script>
|
||||
<script th:src="@{/static/js/daterangepicker.js}"></script>
|
||||
<script th:src="@{/js/viewer.min.js}"></script>
|
||||
<script th:src="@{/static/js/popover.min.js}"></script>
|
||||
<script th:src="@{/js/jquery.qrcode.min.js}"></script>
|
||||
|
||||
<!-- 样式 -->
|
||||
<style type="text/css">
|
||||
#table_server{
|
||||
height: inherit;
|
||||
}
|
||||
.kv-main {
|
||||
padding: 13px;
|
||||
}
|
||||
pre {
|
||||
color: #000;
|
||||
line-height: 16px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.slt{
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 260px;
|
||||
max-height: 130px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 1px 2px 4px #999999;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.slt:hover{
|
||||
transform: scale(1.1);
|
||||
}
|
||||
.table>tbody>tr>td{
|
||||
border:0px;
|
||||
}
|
||||
tbody>tr{
|
||||
/*border:1px solid rgb(221, 221, 221);*/
|
||||
}
|
||||
.table>thead>tr>th{
|
||||
border:0px;
|
||||
}
|
||||
thead>tr{
|
||||
/*border:1px solid rgb(221, 221, 221);*/
|
||||
}
|
||||
|
||||
/**/
|
||||
/* 登录、注册标题 */
|
||||
h4{
|
||||
font-size: 20px;
|
||||
line-height: 50px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
label{
|
||||
margin-right: 10px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
/* 弹出层遮罩 */
|
||||
.layer-mask{
|
||||
display: none; /* 遮罩默认开始是不显示的 */
|
||||
z-index: 99999;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #000;
|
||||
opacity: 0.5; /* 设置透明度为50% */
|
||||
}
|
||||
/* 弹出层窗体 */
|
||||
.layer-pop{
|
||||
display: none; /* 默认开始是不显示的 */
|
||||
z-index: 100000;
|
||||
position: fixed;
|
||||
top: 0; /* 设置水平垂直居中 */
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
width: 400px;
|
||||
height: 300px;
|
||||
background: #fff;
|
||||
}
|
||||
/* 弹出层关闭按钮 */
|
||||
.layer-close{
|
||||
float: right;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border:3px solid #fff;
|
||||
text-align: center; /* 设置内容居中显示 */
|
||||
line-height: 24px; /* 设置内容的高度 */
|
||||
border-radius: 50%;
|
||||
background: #eee;
|
||||
margin: -12px -12px 0 0;
|
||||
}
|
||||
/* 添加鼠标滑过的样式 */
|
||||
.layer-close:hover{
|
||||
cursor: pointer;
|
||||
background: #ccc;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container kv-main" style="max-width: 1200px;">
|
||||
<div id="isimgs">
|
||||
<table class="table ft-table table-hover" id="table_server">
|
||||
<hr/>
|
||||
<div class="btn-group">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
|
||||
aria-haspopup="true" aria-expanded="false">
|
||||
展示类型 <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" onclick="lookurl();">URL地址展示</a></li>
|
||||
<li><a href="#" onclick="lookslt();">缩略图展示</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
|
||||
aria-haspopup="true" aria-expanded="false">
|
||||
批量操作 <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" onclick="deleall();">删除选中</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="btn-group" th:if=" ${level} gt '1'">
|
||||
<span style="margin-left: 35px;line-height: 36px;">列表显示:</span>
|
||||
</div>
|
||||
<div class="btn-group" th:if=" ${level} gt '1'">
|
||||
<select id="myselect" class="form-control">
|
||||
<option value="1" checked="checked">所有人</option>
|
||||
<option value="2">仅自己</option>
|
||||
<option value="3">仅他人</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<span style="margin-left: 20px;line-height: 36px;">存储源:</span>
|
||||
</div>
|
||||
<div class="btn-group" th:if=" ${level} gt '1'">
|
||||
<select id="StorageType" class="form-control">
|
||||
<option value="0">所有</option>
|
||||
<option value="5">本地存储</option>
|
||||
<option value="1">网易NOS</option>
|
||||
<option value="2">阿里OSS</option>
|
||||
<option value="3">又拍USS</option>
|
||||
<option value="4">七牛云KODO</option>
|
||||
<option value="6">腾讯COS</option>
|
||||
<option value="7">FTP存储</option>
|
||||
<option value="8">U-File</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<span style="margin-left: 20px;line-height: 36px;">时间:</span>
|
||||
</div>
|
||||
<div class="input-prepend input-group">
|
||||
<span class="add-on input-group-addon" onclick="thisclear()">
|
||||
<i class="glyphicon glyphicon-repeat" ></i>
|
||||
</span>
|
||||
<input type="text" readonly style="width: 168px" name="reservation" id="reservation" class="form-control" />
|
||||
<div class="btn-group">
|
||||
<a style="margin-left: 20px;" type="button" class="btn btn-info" onclick="screening();">筛选</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
<div id="layer-mask" class="layer-mask"></div>
|
||||
<div id="layer-pop" class="layer-pop" style="border-radius: 5px;">
|
||||
<div id="layer-close" class="layer-close">×</div>
|
||||
<div id="layer-content" class="layer-content"></div>
|
||||
</div>
|
||||
<div id="loginHtml" style="display: none;">
|
||||
<div class="login" style="text-align: center;">
|
||||
<div id="qrcode" style="padding: 18px;">
|
||||
<img id="imgbase64" src="" />
|
||||
<div id="erwmxq">
|
||||
<h3></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<label> </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<img id="linshi" style="display:none;" src="#"/>
|
||||
</body>
|
||||
<script type="application/javascript">
|
||||
var kooltype = 1;
|
||||
var layer;
|
||||
layui.use('layer', function () {
|
||||
layer = layui.layer;
|
||||
});
|
||||
var t;
|
||||
$(function () {
|
||||
var loginid = [[${loginid}]];
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#reservation').daterangepicker(null, function(start, end, label) {
|
||||
});
|
||||
});
|
||||
fenye('/admin/selecttable', 1);//1代表查询所有人
|
||||
});
|
||||
function screening(){
|
||||
$("#table_server").bootstrapTable('destroy');
|
||||
var myselect = $('#myselect').val();
|
||||
var StorageType = $('#StorageType').val();
|
||||
var reservation = $('#reservation').val();
|
||||
var arr=new Array();
|
||||
if(reservation!=''){
|
||||
arr=reservation.split(' - ');
|
||||
fenye('/admin/selecttable', myselect,StorageType,arr[0],arr[1]);
|
||||
}else{
|
||||
fenye('/admin/selecttable', myselect,StorageType,null,null);
|
||||
}
|
||||
}
|
||||
function lookurl() {
|
||||
$("#table_server").bootstrapTable('destroy');
|
||||
kooltype = 1;
|
||||
fenye('/admin/selecttable',1);
|
||||
}
|
||||
function lookslt() {
|
||||
$("#table_server").bootstrapTable('destroy');
|
||||
kooltype = 2;
|
||||
fenye('/admin/selecttable',1);
|
||||
}
|
||||
function deleall() {
|
||||
var rows = $("#table_server").bootstrapTable('getSelections');
|
||||
if (rows.length == 0) {
|
||||
layui.layer.msg('请先勾选要操作的图像。');
|
||||
return;
|
||||
}
|
||||
swal({
|
||||
title: "确认删除选中图片?",
|
||||
text: "删除后将无法恢复,请谨慎操作。",
|
||||
type: "warning",
|
||||
showCancelButton: true,//true显示两个按钮
|
||||
confirmButtonColor: "#A5DC86",
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
if (rows.length == 0) {
|
||||
|
||||
} else {
|
||||
var ids = new Array();
|
||||
var sources = new Array();
|
||||
var imgnames = new Array();
|
||||
$(rows).each(function () {// 通过获得别选中的来进行遍历
|
||||
ids.push(this.id);
|
||||
sources.push(this.source);
|
||||
imgnames.push(this.imgname);
|
||||
});
|
||||
deleallimg(ids,sources,imgnames);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function deleallimg(ids,sources,imgnames) {
|
||||
var loading = layer.msg('正在删除', {icon: 16, shade: 0.3, time:0});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/deleallimg",
|
||||
data: {ids: ids,sources:sources,imgnames:imgnames},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
layer.close(loading);
|
||||
if (data.val > 0) {
|
||||
layer.msg('已成功删除所选图片', {icon: 1});
|
||||
}
|
||||
$("#table_server").bootstrapTable('refresh', t);
|
||||
$("#imgcount").text(data.count);
|
||||
$("#usercount").text(data.usercount);
|
||||
$("#imgreviewcount").text(data.imgreviewcount);
|
||||
}
|
||||
});
|
||||
}
|
||||
function exit() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/exit.do",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
layer.msg('账号已退出', {icon: 1});
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
//删除
|
||||
function deleimg(id, sourcekey,imgname) {
|
||||
swal({
|
||||
title: "确认是否删除该图片?",
|
||||
text: "删除后将无法恢复,请谨慎操作。",
|
||||
type: "warning",
|
||||
showCancelButton: true,//true显示两个按钮
|
||||
confirmButtonColor: "#A5DC86",
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/deleimg",
|
||||
data: {id: id, sourcekey: sourcekey,imgname:imgname},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.val > 0) {
|
||||
$("#table_server").bootstrapTable('refresh', t);
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
$("#imgcount").text(data.count);
|
||||
$("#usercount").text(data.usercount);
|
||||
} else {
|
||||
layer.msg('删除失败', {icon: 2});
|
||||
$("#table_server").bootstrapTable('refresh', t);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {return;}
|
||||
});
|
||||
}
|
||||
|
||||
function copy(data) {
|
||||
var copy = new ClipboardJS('.btn', {
|
||||
text: function (trigger) {
|
||||
return data;
|
||||
}
|
||||
});
|
||||
copy.on('success', function (e) {
|
||||
layer.msg('复制成功');
|
||||
copy.off("success");
|
||||
});
|
||||
copy.on('error', function (e) {
|
||||
layer.msg('复制失败');
|
||||
copy.off("error");
|
||||
});
|
||||
}
|
||||
|
||||
function lookimgs(id,urls) {
|
||||
//单张图片预览
|
||||
var viewer = new Viewer(document.getElementById('imgs'+id),{
|
||||
// inline: true,
|
||||
// url: 'data-original',
|
||||
// navbar: false,
|
||||
// zoomRatio: 0.4,
|
||||
// button: true,
|
||||
// title: false,
|
||||
// keyboard: false,
|
||||
toolbar: {
|
||||
zoomIn: 1,
|
||||
zoomOut: 1,
|
||||
oneToOne: 1,
|
||||
reset: 1,
|
||||
prev: 0,
|
||||
play: 0,
|
||||
next: 0,
|
||||
rotateLeft: 1,
|
||||
rotateRight: 1,
|
||||
flipHorizontal: 1,
|
||||
flipVertical: 1,
|
||||
},
|
||||
viewed: function () {
|
||||
viewer.view(0);
|
||||
}
|
||||
});
|
||||
document.getElementById('imgs'+id).click();
|
||||
}
|
||||
|
||||
function fenye(url, selecttype,StorageType,starttime,stoptime) {
|
||||
t = $("#table_server").bootstrapTable({
|
||||
url: url,
|
||||
method: 'get',
|
||||
cache: false,//关闭本地磁盘缓存,
|
||||
dataType: "json",
|
||||
striped: true,//设置为 true 会有隔行变色效果
|
||||
undefinedText: "空",//当数据为 undefined 时显示的字符
|
||||
pagination: true, //分页
|
||||
showRefresh: true,
|
||||
paginationLoop: true,//设置为 true 启用分页条无限循环的功能。
|
||||
showToggle: "true",//是否显示 切换试图(table/card)按钮
|
||||
showColumns: "true",//是否显示 内容列下拉框
|
||||
pageNumber: 1,//如果设置了分页,首页页码
|
||||
// showPaginationSwitch:true,//是否显示 数据条数选择框
|
||||
pageSize: 20,//如果设置了分页,页面数据条数
|
||||
pageList: [20, 40, 80, 160], //如果设置了分页,设置可供选择的页面数据条数。设置为All 则显示所有记录。
|
||||
paginationPreText: '‹',//指定分页条中上一页按钮的图标或文字,这里是<
|
||||
paginationNextText: '›',//指定分页条中下一页按钮的图标或文字,这里是>
|
||||
// singleSelect: false,//设置True 将禁止多选
|
||||
search: false, //显示搜索框
|
||||
data_local: "zh-CN",//表格汉化
|
||||
sidePagination: "server", //服务端处理分页
|
||||
queryParams: function (params) {//自定义参数,这里的参数是传给后台的,我这是是分页用的
|
||||
return {//这里的params是table提供的
|
||||
pageNum: (params.offset / params.limit) + 1,//从数据库第几条记录开始
|
||||
pageSize: params.limit//找多少条
|
||||
, selecttype: selecttype
|
||||
,storageType:StorageType
|
||||
,starttime:starttime
|
||||
,stoptime:stoptime
|
||||
};
|
||||
},
|
||||
idField: "链接",//指定主键列
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
title: '链接',
|
||||
formatter: function (value, rows, index) {
|
||||
var view = {
|
||||
imgurl: rows.imgurl
|
||||
};
|
||||
if(kooltype==1){
|
||||
var output = Mustache.render('<a style="cursor:pointer;" onclick="lookimgs('+rows.id+',\'{{&imgurl}}\')">{{imgurl}}<img class="slt" style="display: none;" id="imgs'+rows.id+'" src="{{imgurl}}" alt="" /></a>', view);
|
||||
}else{
|
||||
var output = Mustache.render('<a style="cursor:pointer;" onclick="lookimgs('+rows.id+',\'{{&imgurl}}\')"><img class="slt" id="imgs'+rows.id+'" src="{{imgurl}}" alt="" onerror="this.src=\'/img/img404.jpg\'" /></a>', view);
|
||||
}
|
||||
return output;
|
||||
},
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
field: 'updatetime',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '大小',
|
||||
formatter: function (value, rows, index) {
|
||||
return getSize(rows.sizes*1024);
|
||||
},
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'IP地址',
|
||||
formatter: function (value, rows, index) {
|
||||
return rows.abnormal;
|
||||
},
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '用户',
|
||||
formatter: function (value, rows, index) {
|
||||
var names = "";
|
||||
if (rows.username == null) {
|
||||
names = "游客";
|
||||
} else {
|
||||
names = rows.username;
|
||||
}
|
||||
return names;
|
||||
},
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '性质',
|
||||
formatter: function (value, rows, index) {
|
||||
var type = "";
|
||||
if (rows.imgtype == 1) {
|
||||
type = "临时";
|
||||
} else {
|
||||
type = "永久";
|
||||
}
|
||||
return type;
|
||||
},
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
formatter: function (value, rows, index) {
|
||||
var view = {
|
||||
imgurl: rows.imgurl,
|
||||
path:rows.imgname,
|
||||
size:rows.sizes,
|
||||
|
||||
id:rows.id,
|
||||
source:rows.source
|
||||
};
|
||||
var htm = '<a onclick="copy(\'' + rows.imgurl +
|
||||
'\')" class="btn btn-info btn-xs"><span class="glyphicon glyphicon-list-alt" title="复制"></span></a>'+ " ";//复制
|
||||
htm += Mustache.render("<a onclick='erwm(\"{{&imgurl}}\",\"{{path}}\",\"{{size}}\")' class='btn btn-success btn-xs'><span title='二维码' class='glyphicon glyphicon-qrcode'></span></a>"+ " ", view) ;//二维码
|
||||
//htm += "<a onclick='deleimg(" + rows.id + "," + rows.source + ")' class='btn btn-danger btn-xs'><span title='删除' class='glyphicon glyphicon-trash'></span></a>";//删除
|
||||
htm += Mustache.render("<a onclick='deleimg(\"{{&id}}\",\"{{source}}\",\"{{path}}\")' class='btn btn-danger btn-xs'><span title='删除' class='glyphicon glyphicon-trash'></span></a>",view);
|
||||
return htm;
|
||||
},
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
});
|
||||
t.on('load-success.bs.table', function (data) {
|
||||
$(".pull-right").css("display", "block");
|
||||
});
|
||||
}
|
||||
function thisclear() {
|
||||
$('#reservation').val('');
|
||||
}
|
||||
function erwm(url,path,size) {
|
||||
var loginHtml = $("#loginHtml").html();
|
||||
showLayer(loginHtml, 500, 300, closeCallback);
|
||||
var imgbase64 = jrQrcode.getQrBase64(url, '#isimgs');
|
||||
$('#imgbase64').attr("src", imgbase64);
|
||||
}
|
||||
function closeCallback(){
|
||||
$(".error-msg").html("");
|
||||
}
|
||||
function hideLayer(){
|
||||
$("#layer-mask").hide();
|
||||
$("#layer-pop").hide();
|
||||
}
|
||||
function showLayer(html, width, height, closeCallback){
|
||||
$("#layer-mask").show();
|
||||
$("#layer-pop").show();
|
||||
$("#layer-pop").css({
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
$("#layer-content").html(html);
|
||||
$("#layer-close").click(function(){
|
||||
hideLayer();
|
||||
closeCallback();
|
||||
})
|
||||
}
|
||||
function getSize(bytes) {
|
||||
if (bytes === 0) return '0 B';
|
||||
var k = 1024;
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return (bytes / Math.pow(k, i)).toFixed(2) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
</script>
|
||||
</html>
|
||||
@@ -1,191 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<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" th:href="@{/layui/layui/css/layui.css}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main">
|
||||
<div class="demoTable" style="margin-top: 15px;">
|
||||
查询用户:
|
||||
<div class="layui-inline">
|
||||
<input class="layui-input" name="id" id="demoReload" placeholder="请输入用户名或邮箱" autocomplete="off">
|
||||
</div>
|
||||
<button class="layui-btn" data-type="reload" onclick="query()">查询</button>
|
||||
</div>
|
||||
<br />
|
||||
<table id="dates" lay-filter="test"></table>
|
||||
</div>
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script th:src="@{/js/base64.min.js}"></script>
|
||||
<script type="text/javascript">
|
||||
var tableIns = null;
|
||||
$.ajaxSetup({
|
||||
cache: false
|
||||
});
|
||||
var table = null;
|
||||
layui.use(['form','table','layer'], function(){
|
||||
table = layui.table;
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
form.on('checkbox', function (data) {
|
||||
if (this.checked == true) {
|
||||
var id = $(this).val();
|
||||
setisko(id,1);
|
||||
} else {
|
||||
var id = $(this).val();
|
||||
setisko(id,-1);
|
||||
}
|
||||
});
|
||||
tableIns = table.render({
|
||||
elem: '#dates'
|
||||
,cache: false//关闭本地磁盘缓存,
|
||||
,defaultToolbar:['filter', 'print']
|
||||
,url:'/admin/selectusertable'
|
||||
,limit:10 //默认为10
|
||||
,cols: [ [
|
||||
{field:'username', title: '用户名'}
|
||||
,{field:'email',width:170, title: '邮箱'}
|
||||
,{field:'password',width:170, title: '密码', templet: function(d){ return $.base64.decode(d.password);}}
|
||||
,{field:'birthder',width:120, title: '注册时间',sort: true}
|
||||
,{field:'level',width:100, title: '等级',templet: function(d){
|
||||
var str = '';
|
||||
if(d.level==1){str='普通用户';}
|
||||
else if(d.level==2){str='管理员';}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
,{field:'memory',width:120, title: '可用容量',templet: function(d){
|
||||
var str = '';
|
||||
if(d.memory==-1){str='无限制';}
|
||||
else{str=d.memory;}
|
||||
return str+" M";
|
||||
}
|
||||
}
|
||||
,{field:'level',width:120, title: '状态',templet: function(d){
|
||||
var str = '';
|
||||
if(d.isok==1){str = ' <form class="layui-form" action=""><div class="layui-form-item">\n' +
|
||||
' <input type="checkbox" checked="checked" value="'+d.id+'" lay-filter="keyong" name="like[write]" title="可用">\n' +
|
||||
' </div></form>';}
|
||||
else {str = ' <form class="layui-form" action=""><div class="layui-form-item">\n' +
|
||||
' <input type="checkbox" value="'+d.id+'" lay-filter="jinyong" name="like[write]" title="禁用">\n' +
|
||||
' </div></form>';}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
,{field:'level',width:110, title: '操作',templet: function(d){
|
||||
//return '<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>';
|
||||
return '<div class="layui-btn-group">\n' +
|
||||
' <button type="button" class="layui-btn layui-btn-sm" lay-event="memory">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
' <button type="button" class="layui-btn layui-btn-sm" lay-event="del">\n' +
|
||||
' <i class="layui-icon"></i>\n' +
|
||||
' </button>\n' +
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
] ]
|
||||
,page: true
|
||||
,done:function(res, curr, count){
|
||||
//数据的回调用,可不写
|
||||
}
|
||||
});
|
||||
// 行点击事件
|
||||
table.on('tool', function (obj) {
|
||||
var data = obj.data;
|
||||
var event = obj.event;
|
||||
if (event === 'memory') {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'用户容量',
|
||||
shadeClose: true,
|
||||
skin: 'layui-layer-rim', //加上边框
|
||||
area: ['420px', '300px'], //宽高
|
||||
content: '/admin/root/modifyuser?uid='+data.uid+'&id='+data.id
|
||||
,end:function(){
|
||||
table.reload('dates');//重新获取表数据
|
||||
}
|
||||
});
|
||||
}else if (event === 'del') {
|
||||
var index = layer.confirm('确定删除此用户?', {
|
||||
btn: ['删除','取消'] //按钮
|
||||
}, function(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/deleuser",
|
||||
data: {id: data.id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('dates');//重新获取表数据
|
||||
layer.msg('删除成功', {icon: 1});
|
||||
}else if(data==-1){
|
||||
layer.msg('不能删除自己', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
}, function(){
|
||||
});
|
||||
}else{
|
||||
layer.msg('参数异常', {icon: 2});
|
||||
}
|
||||
});
|
||||
});
|
||||
function setisko(id,val) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/setisok",
|
||||
data: {id: id,isok:val},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('dates');//重新获取表数据
|
||||
layer.msg('设置成功', {icon: 1});
|
||||
}else if(data==-1){
|
||||
layer.msg('设置失败', {icon: 2});
|
||||
}else if(data==-2){
|
||||
layer.msg('无法对自己进行操作', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function rongliang(id) {
|
||||
var memory = $('#tests').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/setmemory",
|
||||
data: {id: id,memory:memory},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data > 0) {
|
||||
table.reload('dates');//重新获取表数据
|
||||
layer.msg('保存成功', {icon: 1});
|
||||
}else{
|
||||
layer.msg('保存失败', {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function query(){
|
||||
var data = $('#demoReload').val();
|
||||
//这里以搜索为例
|
||||
tableIns.reload({
|
||||
where: { //设定异步数据接口的额外参数,任意设
|
||||
username: data
|
||||
}
|
||||
,page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,565 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>系统配置</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<style>
|
||||
.layui-tab {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main">
|
||||
<br />
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this" lay-id="111">首页设置</li>
|
||||
<li lay-id="222">百度统计</li>
|
||||
<li lay-id="333">上传配置</li>
|
||||
<li lay-id="444">站点配置</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">首页公告</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="notice" type="text" name="title" autocomplete="off" placeholder="首页公告" class="layui-input"
|
||||
th:value="${config.getNotice()}"/>
|
||||
<span style="color: #DAA5A6;">欲想显示多个公告请用 | 分开</span>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">网站标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="webname" type="text" name="title" autocomplete="off" placeholder="网站标题" class="layui-input"
|
||||
th:value="${config.getWebname()}"/>
|
||||
</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,需带有http://或https://,否则开启邮箱激活和本地存储不能正常使用。如:http://127.0.0.1:8088,IP需带端口,最后不需要加/</span>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">站点说明</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="explain" type="text" name="title" autocomplete="off" class="layui-input"
|
||||
th:value="${config.getExplain()}"/>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">视频背景</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="video" type="text" name="title" autocomplete="off" placeholder="视频url地址" class="layui-input"
|
||||
th:value="${config.getVideo()}"/><span style="color: #DAA5A6;">如果你的服务器带宽较差,不建议使用视频背景</span>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图片背景</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="background1" type="text" name="title" autocomplete="off" placeholder="首页背景图" class="layui-input"
|
||||
th:value="${config.getBackground1()}"/>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label">首页背景二</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input id="background2" type="text" name="title" autocomplete="off" placeholder="上传页面背景图" class="layui-input"-->
|
||||
<!-- th:value="${config.getBackground2()}"/>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <br />-->
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label">每日随机图</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input id="open" type="checkbox" name="close" lay-skin="switch" lay-filter="switchTest"-->
|
||||
<!-- lay-text="ON|OFF">-->
|
||||
<!-- <span style="color: #DAA5A6;"> 采集必应每日壁纸,开启随机背景后,手动设置的首页背景将会失效</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <br />-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">备案显示</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="links" name="links" placeholder="备案号,可用html代码" class="layui-textarea" th:text="${config.getLinks()}"></textarea>
|
||||
<span style="color: #DAA5A6;">不填写,则不显示(请合理管理长度,若输入超长代码块可能导致字符溢出,保存失败。)<xmp></xmp></span>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<form class="layui-form-item " >
|
||||
<div class="laydfdaui-form-item">
|
||||
<label class="layui-form-label">主题类型</label>
|
||||
<div class="layui-input-block" id="theme">
|
||||
<input type="radio" id="themetype1" name="themetype" lay-filter="themetype" value="1" title="炫酷壁纸">
|
||||
<input type="radio" id="themetype2" name="themetype" lay-filter="themetype" value="2" title="简约蓝白">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="laydfdaui-form-item themetypeone">
|
||||
<label class="layui-form-label">背景类型</label>
|
||||
<div class="layui-input-block" id="backtype">
|
||||
<input type="radio" id="backtype1" name="isbacktype" value="1" title="图片壁纸">
|
||||
<input type="radio" id="backtype2" name="isbacktype" value="2" title="视频壁纸">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="laydfdaui-form-item themetypeone">
|
||||
<label class="layui-form-label">首页类型</label>
|
||||
<div class="layui-input-block" id="sett">
|
||||
<input type="radio" id="sett11" name="settweb" value="1" title="默认首页">
|
||||
<input type="radio" id="sett22" name="settweb" value="2" title="精简首页">
|
||||
</div><span style="color: #DAA5A6;">精简首页:页面加载完直接打开上传页面,没有展示页</span>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</form>
|
||||
<a class="layui-btn" lay-filter="demo2" style="float: right;margin-right: 50px;" onclick="updateconfig()">保存</a>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">统计JS代码</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="baidu" name="baidu" placeholder="请输入统计JS代码" class="layui-textarea" th:text="${config.getBaidu()}"></textarea>
|
||||
<span style="color: #DAA5A6;"><xmp>添加网站统计的JS代码,不需要要添加<script>标签</script></xmp></span>
|
||||
</div>
|
||||
<a class="layui-btn" lay-filter="demo2" style="float: right;margin-right: 50px;" onclick="updatebaidu()">保存</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!--分组3-->
|
||||
<div class="layui-tab-item">
|
||||
<h3 style="margin-top: 50px;">站点API配置</h3>
|
||||
<hr />
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图床API</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="bedapi" type="checkbox" name="close" lay-skin="switch" lay-filter="switchTest2"
|
||||
lay-text="开启|关闭">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
<h3>游客上传配置</h3>
|
||||
<hr />
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">游客上传</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="upopen" type="checkbox" name="close" lay-skin="switch" lay-filter="switchTest"
|
||||
lay-text="开启|关闭">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" style="width: 100px;">单文件大小(M)</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
<input id="filesizetourists" th:value="${updateConfig.getFilesizetourists()}" type="text" name="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline" style="margin-left: 50px;">
|
||||
<label class="layui-form-label" style="width: 100px;">单次上传个数</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
<input id="imgcounttourists" th:value="${updateConfig.getImgcounttourists()}" type="text" name="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<h3 style="margin-top: 50px;">会员上传配置</h3>
|
||||
<hr />
|
||||
<div class="layui-inline" >
|
||||
<label class="layui-form-label" style="width: 100px;">单文件大小(M)</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
<input id="filesizeuser" th:value="${updateConfig.getFilesizeuser()}" type="text" name="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline" style="margin-left: 50px;">
|
||||
<label class="layui-form-label" style="width: 100px;">单次上传个数</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
<input id="imgcountuser" th:value="${updateConfig.getImgcountuser()}" type="text" name="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<h3 style="margin-top: 50px;">存储容量分配(M) <span style="color: #DAA5A6;">输入“-1”则为无限制</span></h3>
|
||||
<hr />
|
||||
<div class="layui-inline" >
|
||||
<label class="layui-form-label" style="width: 100px;">游客可用总容量</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
<input id="visitormemory" th:value="${updateConfig.getVisitormemory()}" lay-verify="required" type="text" name="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline" style="margin-left: 50px;">
|
||||
<label class="layui-form-label" style="width: 100px;">用户初始容量</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
<input id="usermemory" th:value="${updateConfig.getUsermemory()}" lay-verify="required" type="text" name="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<h3 style="margin-top: 50px;">支持文件配置</h3>
|
||||
<hr />
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">文件类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="suffix" th:value="${updateConfig.getSuffix()}" type="text" name="title" required lay-verify="required" placeholder="配置可上传的文件类型" autocomplete="off" class="layui-input">
|
||||
<span style="color: #DAA5A6;">配个类型用“ , ”隔开(PS:只可以设置图片格式,其他文件格式无效)</span>
|
||||
</div>
|
||||
</div>
|
||||
<h3 style="margin-top: 50px;">图片链接格式</h3>
|
||||
<hr />
|
||||
<form class="layui-form " >
|
||||
<div class="laydfdaui-form-item">
|
||||
<label class="layui-form-label">链接格式</label>
|
||||
<div class="layui-input-block" id="imgurltype">
|
||||
<input type="radio" id="urltype1" name="urltype" value="1" title="用户名格式:/user/">
|
||||
<input type="radio" id="urltype2" name="urltype" value="2" title="日期格式:/YY/mm/dd/" checked>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<hr />
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">IP黑名单</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="blacklist" name="blacklist" placeholder="127.0.0.1;127.0.0.2" class="layui-textarea" th:text="${updateConfig.getBlacklist()}"></textarea>
|
||||
<span style="color: #DAA5A6;"><xmp>多个IP用;(英文分号)隔开 例如:127.0.0.1;127.0.0.2 否则无法生效</xmp></span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
|
||||
<a class="layui-btn" lay-filter="demo2" style="float: right;margin-right: 50px;" onclick="scconfig()">保存</a>
|
||||
</div>
|
||||
<!--站点设置-->
|
||||
<div class="layui-tab-item">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">开放注册</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="dologo" type="checkbox" name="close" lay-skin="switch" lay-filter="switchTest3"
|
||||
lay-text="开启|关闭">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">站点关键词</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="webkeywords" th:value="${config.getWebkeywords()}" type="text" name="title" required lay-verify="required" placeholder="配置站点关键词" autocomplete="off" class="layui-input">
|
||||
<span style="color: #DAA5A6;">多个关键词用(英文)“ , ”隔开</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">站点图标</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="webfavicons" th:value="${config.getWebfavicons()}" type="text" name="title" required lay-verify="required" placeholder="站点(favicon)图标链接URL" autocomplete="off" class="layui-input">
|
||||
<span style="color: #DAA5A6;">填写站点(favicon)图标的,大小控制在64×64以内,需是.ico格式的链接</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">站点描述</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="webms" name="webms" placeholder="请输入站点标描述,这样有利于搜索引擎" class="layui-textarea" th:text="${config.getWebms()}"></textarea>
|
||||
<!-- <span style="color: #DAA5A6;"><xmp>添加网站统计的JS代码,不需要要添加<script>标签</script></xmp></span>-->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
<a class="layui-btn" lay-filter="demo2" style="float: right;margin-right: 50px;" onclick="updateconfig()">保存</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
var isupval = [[${updateConfig.getIsupdate()}]];
|
||||
var isapi = [[${updateConfig.getApi()}]];
|
||||
var state = [[${sysconfig==null?0:sysconfig.getRegister()}]];
|
||||
var group = [[${group}]];
|
||||
|
||||
var usertype = [[${updateConfig.getUrltype()!=null?updateConfig.getUrltype():1}]];
|
||||
var backtype = [[${config.getBacktype()!=null?config.getBacktype():1}]];
|
||||
var sett = [[${config.getSett()}]];
|
||||
var theme = [[${config.getTheme()}]];
|
||||
|
||||
var form = null;
|
||||
layui.use(['form','table','element'], function(){
|
||||
var table = layui.table;
|
||||
var element = layui.element;
|
||||
form = layui.form;
|
||||
//监听指定开关
|
||||
form.on('switch(switchTest)', function (data) {
|
||||
if (this.checked == true) {
|
||||
isupdate(1);
|
||||
} else {
|
||||
isupdate(0);
|
||||
}
|
||||
});
|
||||
form.on('switch(switchTest2)', function (data) {
|
||||
if (this.checked == true) {
|
||||
upapi(1);
|
||||
} else {
|
||||
upapi(0);
|
||||
}
|
||||
});
|
||||
form.on('switch(switchTest3)', function (data) {
|
||||
if (this.checked == true) {
|
||||
setstate(1);
|
||||
} else {
|
||||
setstate(2);
|
||||
}
|
||||
});
|
||||
// form.on('select(group)', function(data){
|
||||
// group = data.value;
|
||||
// });
|
||||
// $('#group').val(group);
|
||||
form.render('select');
|
||||
|
||||
form.on('radio(themetype)', function (data) {
|
||||
if(data.value==1){
|
||||
$('.themetypeone').show();
|
||||
}else{
|
||||
$('.themetypeone').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
window.onload=function (){
|
||||
if (isupval == 1) {
|
||||
$('#upopen').attr("checked", 'hellohao'); //增加属性
|
||||
} else {
|
||||
$('#upopen').removeAttr("checked"); //移除属性
|
||||
}
|
||||
if (isapi == 1) {
|
||||
$('#bedapi').attr("checked", 'hellohao');
|
||||
} else {
|
||||
$('#bedapi').removeAttr("checked");
|
||||
}
|
||||
if (state == 1) {
|
||||
$('#dologo').attr("checked", 'hellohao');
|
||||
} else {
|
||||
$('#dologo').removeAttr("checked");
|
||||
}
|
||||
|
||||
if(usertype==2){
|
||||
$('#urltype2:radio:input:radio:last').attr('checked', 'true');
|
||||
}else{
|
||||
$('#urltype1:radio:first').attr('checked', 'true');
|
||||
}
|
||||
if(backtype==2){
|
||||
$('#backtype2:radio:input:radio:last').attr('checked', 'true');
|
||||
}else{
|
||||
$('#backtype1:radio:first').attr('checked', 'true');
|
||||
}
|
||||
if(sett != 1){
|
||||
$('#sett22:radio:input:radio:last').attr('checked', 'true');
|
||||
}else{
|
||||
$('#sett11:radio:first').attr('checked', 'true');
|
||||
}
|
||||
if(theme != 1){
|
||||
$('#themetype2:radio:input:radio:last').attr('checked', 'true');
|
||||
$('.themetypeone').hide();
|
||||
}else{
|
||||
$('#themetype1:radio:first').attr('checked', 'true');
|
||||
$('.themetypeone').show();
|
||||
}
|
||||
// form.render('select');
|
||||
layui.form.render();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/admin/root/getgrouplist",
|
||||
// //data: {groupid:groupid},
|
||||
// dataType: "json",
|
||||
// success: function (data) {
|
||||
// var body = '';//<option value="0"> 默认群组</option>
|
||||
// for(var i=0;i<data.length;i++){
|
||||
// body+='<option value="'+data[i].id+'">'+data[i].groupname+'</option>';
|
||||
// }
|
||||
// $('#group').append(body);
|
||||
// }
|
||||
// });
|
||||
});
|
||||
function updateconfig() {
|
||||
var webname = $("#webname").val();
|
||||
var explain = $("#explain").val();
|
||||
var video = $("#video").val();
|
||||
var backtype = $('#backtype input[name="isbacktype"]:checked ').val();
|
||||
var links = $("#links").val();
|
||||
var notice = $("#notice").val();
|
||||
var domain = $("#domain").val();
|
||||
var background1 = $("#background1").val();
|
||||
var background2 = $("#background2").val();
|
||||
var sett = $('#sett input[name="settweb"]:checked ').val();
|
||||
var webms = $("#webms").val();
|
||||
var webkeywords = $("#webkeywords").val();
|
||||
var webfavicons = $("#webfavicons").val();
|
||||
var theme = $('#theme input[name="themetype"]:checked ').val();
|
||||
if (webname != "" && domain!="" ) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updateconfig",
|
||||
dataType: "json",
|
||||
data: {webname: webname, explain: explain, video: video,backtype:backtype,links:links,notice:notice,
|
||||
domain:domain,background1:background1,background2:background2,sett:sett,webms:webms,
|
||||
webkeywords:webkeywords,webfavicons:webfavicons,theme:theme},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
layer.msg("保存成功", {icon: 1});
|
||||
//window.location.reload();
|
||||
} else {
|
||||
layer.msg("保存失败,请尝试刷新页面后操作", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg("网站名称或站点域名均不能为空", {icon: 2});
|
||||
}
|
||||
}
|
||||
function updatebaidu() {
|
||||
var baidu = $("#baidu").val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/updateconfig",
|
||||
dataType: "json",
|
||||
data: {baidu: baidu},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
layer.msg("保存成功", {icon: 1});
|
||||
//window.location.reload();
|
||||
} else {
|
||||
layer.msg("保存失败,请尝试刷新页面后操作", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function scconfig() {
|
||||
var filesizetourists = $("#filesizetourists").val();
|
||||
var filesizeuser = $("#filesizeuser").val();
|
||||
var imgcounttourists = $("#imgcounttourists").val();
|
||||
var imgcountuser = $("#imgcountuser").val();
|
||||
var suffix = $("#suffix").val();
|
||||
var imgurltype = $('#imgurltype input[name="urltype"]:checked ').val();
|
||||
var blacklist = $('#blacklist').val();
|
||||
var visitormemory = $('#visitormemory').val();
|
||||
var usermemory = $('#usermemory').val();
|
||||
var re = new RegExp("^[0-9]*[1-9][0-9]*$");
|
||||
if(filesizetourists!=""&&filesizeuser!=""&&imgcounttourists!=""&&imgcountuser!=""&&suffix!=""&&visitormemory!=""&&usermemory!=""){
|
||||
if(re.test(filesizetourists) && re.test(imgcounttourists) && re.test(filesizeuser) && re.test(imgcountuser)){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/scconfig",
|
||||
dataType: "json",
|
||||
data: {filesizetourists: filesizetourists,filesizeuser:filesizeuser,imgcounttourists:imgcounttourists,
|
||||
imgcountuser:imgcountuser,suffix:suffix,urltype:imgurltype,visitormemory:visitormemory,usermemory:usermemory,
|
||||
blacklist:blacklist},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
layer.msg("保存成功", {icon: 1});
|
||||
//window.location.reload();
|
||||
} else {
|
||||
layer.msg("保存失败,请尝试刷新页面后操作", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg("上传大小配置只可输入整数", {icon: 2});
|
||||
}
|
||||
}else{
|
||||
layer.msg("各项内容不能为空", {icon: 2});
|
||||
}
|
||||
}
|
||||
//设置游客是否上传
|
||||
function isupdate(values) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/scconfig",
|
||||
dataType: "text",
|
||||
data: {isupdate: values},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
if (values == 1) {
|
||||
layer.msg("游客上传已开启", {icon: 1});
|
||||
} else {
|
||||
layer.msg("游客上传已禁用", {icon: 1});
|
||||
}
|
||||
} else {
|
||||
layer.msg("操作失败,请重新打开页面会后尝试", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//设置开启/关闭图床api
|
||||
function upapi(values) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/scconfig",
|
||||
dataType: "text",
|
||||
data: {api: values},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
if (values == 1) {
|
||||
layer.msg("已开启站点API", {icon: 1});
|
||||
} else {
|
||||
layer.msg("已禁用站点API", {icon: 1});
|
||||
}
|
||||
} else {
|
||||
layer.msg("操作失败,请重新打开页面会后尝试", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setstate(values) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/root/setstate",
|
||||
dataType: "json",
|
||||
data: {register: values},
|
||||
success: function (data) {
|
||||
var vals = Number(data);
|
||||
if (vals > 0) {
|
||||
if (values == 1) {
|
||||
layer.msg("已开放注册功能", {icon: 1});
|
||||
} else {
|
||||
layer.msg("已禁用注册功能", {icon: 1});
|
||||
}
|
||||
} else {
|
||||
layer.msg("操作失败,请重新打开页面会后尝试", {icon: 2});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,204 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>创建画廊</title>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<style>
|
||||
ul.imglist{ /*margin:0 auto; width:536px;*/width:100%; overflow:hidden}
|
||||
ul.imglist li{ float:left; padding:4px 5px; width:160px}
|
||||
ul.imglist li img{ display:block; width:160px; height:90px;border-radius: 3px;}
|
||||
ul.imglist li span{ display:block; width:100%; height:30px; line-height:30px; background:#F6F6F6}
|
||||
.explain{
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
line-height: 20px ;
|
||||
/*border: 1px #b3b3b3 solid;*/
|
||||
/*border-radius: 2px;*/
|
||||
/*color: #4c4a48;*/
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dcdfe6;
|
||||
box-sizing: border-box;
|
||||
color: #606266;
|
||||
padding: 0 15px;
|
||||
font-size: small;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-main" style="width: 80%;margin-top: 50px;">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<br/>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">画廊标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="albumtitle" type="text" name="title" autocomplete="off" class="layui-input" placeholder="画廊描述(小于50字符)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">访问密码</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="password" type="text" name="title" autocomplete="off" class="layui-input" placeholder="密码可留空(小于10个字)" />
|
||||
</div><span id="tishi" style="color: #DAA5A6;display: none;">用户名只可是英文或数字</span>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
</div>
|
||||
<ul class="imglist">
|
||||
|
||||
</ul>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="layui-form-item">
|
||||
<a class="layui-btn" lay-submit="" style="width: 100%;" lay-filter="demo2" onclick="commit()">创建</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<input id="urltype" type="hidden" th:value="${urltype}" />
|
||||
<input id="sourcekey" type="hidden" th:value="${sourcekey}" />
|
||||
|
||||
<script>
|
||||
var arr = new Array();
|
||||
var layer;
|
||||
layui.use(['form', 'layedit', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
layer = layui.layer;
|
||||
|
||||
$(function () {
|
||||
var urlArr = window.parent.arr_url;
|
||||
if(urlArr=="" || urlArr==undefined){
|
||||
parent.layer.msg('请先上传图片后再生成画廊', {icon: 2});
|
||||
parent.layer.close(window.parent.win);
|
||||
}else{
|
||||
imgList(urlArr)
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
function imgList(urlArr){
|
||||
arr=urlArr.split('\r\n');
|
||||
var temp = arr.length-1;
|
||||
$('.imglist').html('');
|
||||
var body = '';
|
||||
for(var i = 0;i<temp;i++){
|
||||
var filename = arr[i].substring(arr[i].lastIndexOf('/')+1);
|
||||
|
||||
|
||||
|
||||
body +='<li style="border-radius: 5px;border: 1px solid #ebeef5;box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);"><img src="'+arr[i]+'" /><input type="hidden" value="'+arr[i]+'" class="imgsurl" /><span><input type="text" placeholder="图片说明(可留空)" class="explain" id="imgs'+i+'" /></span></li>';
|
||||
}
|
||||
$('.imglist').append(body);
|
||||
}
|
||||
|
||||
function commit() {
|
||||
var albumtitle = $('#albumtitle').val();
|
||||
var password = $('#password').val();
|
||||
if(albumtitle==null || albumtitle==""){
|
||||
parent.layer.msg('画廊标题不能为空', {icon: 7});
|
||||
return false;
|
||||
}
|
||||
if(albumtitle.length>50){
|
||||
parent.layer.msg('画廊标题太长啦,修改一下吧', {icon: 7});
|
||||
return false;
|
||||
}
|
||||
if(password!=null || password!=""){
|
||||
if(password.length>10){
|
||||
parent.layer.msg('密码太长啦,修改一下吧', {icon: 7});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var imgarr = new Array();
|
||||
var aboutarr = new Array();
|
||||
var urltype = $('#urltype').val();
|
||||
var sourcekey = $('#sourcekey').val();
|
||||
var tmpvar = 0;
|
||||
if(urltype==2){
|
||||
tmpvar = 2;
|
||||
}
|
||||
// if(sourcekey==5){
|
||||
// tmpvar = 4;
|
||||
// }
|
||||
$('.imgsurl').each(function(i,n){
|
||||
var url = $(n).val();
|
||||
if(url.indexOf("http://") >= 0 || url.indexOf("https://") >= 0 ) {
|
||||
|
||||
var temparr= new Array();
|
||||
temparr = url.split("/");
|
||||
var imgname = "";
|
||||
// var arrs=temparr.slice(3);
|
||||
// imgarr.push(arrs[arrs.length-2]+"/"+arrs[arrs.length-1]);
|
||||
|
||||
for(var i=tmpvar;i<temparr.length;i++){
|
||||
// if(i<temparr.length-1){
|
||||
// imgname+=temparr[i]+'/';
|
||||
// }else{
|
||||
// imgname+=temparr[i];
|
||||
// }
|
||||
if(i>2 && i!=(temparr.length-1)){
|
||||
imgname+=temparr[i]+"/";
|
||||
}
|
||||
if(i>2 && i==(temparr.length-1)){
|
||||
imgname+=temparr[i];
|
||||
}
|
||||
|
||||
}
|
||||
imgarr.push(imgname);
|
||||
}else{
|
||||
url = "http://"+url;
|
||||
var temparr= new Array();
|
||||
temparr = url.split("/");
|
||||
var imgname = "";
|
||||
// var arrs=temparr.slice(3);
|
||||
// imgarr.push(arrs[arrs.length-2]+"/"+arrs[arrs.length-1]);
|
||||
for(var i=tmpvar;i<temparr.length;i++){
|
||||
if(i<temparr.length-1){
|
||||
imgname+=temparr[i]+'/';
|
||||
}else{
|
||||
imgname+=temparr[i];
|
||||
}
|
||||
}
|
||||
imgarr.push(imgname);
|
||||
}
|
||||
});
|
||||
|
||||
//根据地址获取图片的信息
|
||||
function setimgurl(){
|
||||
for(var i=3;i<arr.length;i++){
|
||||
if(i==arr.length){
|
||||
b+=arr[i];
|
||||
}else{
|
||||
b+=arr[i]+'/'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('.explain').each(function(i,n){
|
||||
aboutarr.push($(n).val());
|
||||
});
|
||||
var albumtitle = $('#albumtitle').val();
|
||||
var password = $('#password').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/SaveForAlbum",
|
||||
dataType: "json",
|
||||
data: {imgarr:imgarr,aboutarr:aboutarr,albumtitle:albumtitle,password:password},
|
||||
success: function (data) {
|
||||
var code = data.code;
|
||||
if(code=='200'){
|
||||
window.parent.albumUrl = data.data;
|
||||
window.parent.albumKey = password;
|
||||
//layer.msg('画廊创建完成', {icon: 1});
|
||||
parent.Popup(data.data,password);
|
||||
//parent.layer.close(window.parent.win);
|
||||
}else{
|
||||
layer.alert(data.info+'错误代码:'+code);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,299 +0,0 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="description" content=""/>
|
||||
<meta name="keywords" content=""/>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1"/>
|
||||
<title th:text="${webname}+' - 画廊分享'"></title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp"/>
|
||||
<meta name="mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
<link rel="shortcut icon" th:href="${ico}" type="image/x-icon"/>
|
||||
<link rel="icon" type="image/ico" th:href="${ico}" />
|
||||
<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/gallery/css/style1.css}" />
|
||||
<link rel="stylesheet" type="text/css" th:href="@{/gallery/css/style_login.css}" />
|
||||
<script th:src="@{/gallery/js/modernizr-custom.js}"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="demo-1" style="background: #FFF;">
|
||||
<!--<div class="kit-name-head" id="some-element">-->
|
||||
<!-- <div class="container">-->
|
||||
<!-- <div class="kit-name-txt" >-->
|
||||
<!--<!– <h2 ><span>画 廊</span><span style="font-size: 16px;font-weight: 500;color: #dee1e6;"> - 分享亦是感动</span></h2>–>-->
|
||||
<!-- <h2 th:text="${webname}">画 廊</h2>-->
|
||||
<!-- <h3 id="webname">分享亦是感动</h3>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="container">
|
||||
<section id="verification" class="signin popup-in" style="display: none;">
|
||||
<div class="container">
|
||||
<div class="sign-content popup-in-content">
|
||||
<div class="popup-in-txt">
|
||||
<div style="position: relative;">
|
||||
<h3 align="center" class="ghost"> <img id="tupian" style="max-height: 1.6em;" th:src="@{/img/signin.png}" /> 画廊共享</h3>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="signin-form">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="signin_form" style="margin-left: 15px;">请输入提取码</label>
|
||||
<input type="text" class="form-control" id="signin_form" placeholder="请输入你的提取码" style="height: 50px;width: 90%;margin: 15px;" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="signin-password">
|
||||
<div class="awesome-checkbox-list">
|
||||
<ul class="unstyled centered">
|
||||
<li>
|
||||
<!-- <input class="styled-checkbox" id="styled-checkbox-2" type="checkbox" value="value2">-->
|
||||
<label style="margin-left: 15px;" for="styled-checkbox-2">Resources from <a href="/" th:text="${webname}">Hellohao</a></label>
|
||||
</li>
|
||||
<!-- <li>-->
|
||||
<!-- <a href="#">Forgot email or password ?</a>-->
|
||||
<!-- </li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="signin-footer">
|
||||
<button type="button" class="btn signin_btn" onclick="tologin();">
|
||||
Verification
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<h3 align="center" id="imgLose"style="display: none;color: #555;margin-top: 50px;" ><i class="layui-icon layui-icon-face-cry" style="font-size: 30px;"></i> 该画廊已经停用或图片已经被删除~</h3>
|
||||
<div class="content" id="Albummain" style="display: none;">
|
||||
<div class="page-header" >
|
||||
<h3 style=" display:block;height: 30px;" >
|
||||
<span th:text="${webname}"></span>
|
||||
<small id='webname'></small>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="grid" id="AlbumList">
|
||||
<!-- <!– <div class="grid__item" data-size="1280x853" style="position: absolute; left: 0px; top: 0px;"> <a href="http://p9.qhimg.com/bdr/__85/t01dfdd66012dca164d.jpg" class="img-wrap"><img src="http://p9.qhimg.com/bdr/__85/t01dfdd66012dca164d.jpg" alt="img1">-->
|
||||
<!-- <div class="description description--grid">Assemblage</div>-->
|
||||
<!-- </a> </div> –>-->
|
||||
</div>
|
||||
<!-- /grid -->
|
||||
<div class="preview">
|
||||
<button class="action action--close"><i class="fa fa-times">x</i><span class="text-hidden">Close</span></button>
|
||||
<div class="description description--preview"></div>
|
||||
</div>
|
||||
<!-- /preview -->
|
||||
</div>
|
||||
</div>
|
||||
<footer class="navbar-fixed-bottom">
|
||||
<div class="container" style="background: #FFF;">
|
||||
<p align="center"></p>
|
||||
<p align="center">© Photo album sharing from <span th:utext="'<a href='+${domain}+'>'+${webname}+'</a>'">hellohao</span></p>
|
||||
<!-- <p align="center">本站资源为用户上传分享,如有违法或侵犯原作合法权益,请与我们联系删除</p>-->
|
||||
</div>
|
||||
</footer>
|
||||
<input type="hidden" id="passType" th:value="${passType}" />
|
||||
<!-- /container -->
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/gallery/js/imagesloaded.pkgd.min.js}"></script>
|
||||
<script th:src="@{/gallery/js/masonry.pkgd.min.js}"></script>
|
||||
<script th:src="@{/gallery/js/classie.js}"></script>
|
||||
<script th:src="@{/gallery/js/main.js}"></script>
|
||||
<script th:src="@{/js/js.cookie.min.js}"></script>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}">
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script th:src="@{/js/background-blur.min.js}"></script>
|
||||
<script>
|
||||
var passType;
|
||||
var album = [[${album}]];
|
||||
var pass = $.cookie('key_cookie');
|
||||
var albumkey = $.cookie('albumkey_cookie');
|
||||
var userpass;
|
||||
var backurl = '';
|
||||
var layer;
|
||||
layui.use(['form', 'layedit', 'laydate'], function () {
|
||||
var form = layui.form;
|
||||
layer = layui.layer;
|
||||
});
|
||||
|
||||
(function() {
|
||||
var passType = $('#passType').val();
|
||||
if(passType==1 || passType=='1'){
|
||||
var thisKey = window.location.pathname.replace(/\//g, "");
|
||||
if(thisKey==albumkey){
|
||||
//是同一个网址,然后获取cookies的pass
|
||||
if(pass!=null && pass!="" && pass!='null'){
|
||||
userpass = pass;
|
||||
getAlbum();
|
||||
}
|
||||
}else{
|
||||
$('#verification').show();
|
||||
}
|
||||
}else{
|
||||
$('#verification').hide();
|
||||
userpass = null;
|
||||
getAlbum();
|
||||
}
|
||||
|
||||
})();
|
||||
//点击验证之后
|
||||
function tologin() {
|
||||
userpass = $('#signin_form').val();
|
||||
getAlbum();
|
||||
}
|
||||
|
||||
//手动输入密码
|
||||
function getAlbum(){
|
||||
var albumkey = window.location.pathname.replace(/\//g, "");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/getAlbumList",
|
||||
dataType: "json",
|
||||
data: {albumkey:albumkey,password:userpass},
|
||||
success: function (data) {
|
||||
var code = data.code;
|
||||
var body = '';
|
||||
//var imgList = data.data.imagesList; //&& typeof(imgList) != "undefined"
|
||||
if(code=='200'){
|
||||
var imgList = data.data.imagesList;
|
||||
$('#webname').html(data.data.titlename);
|
||||
$('#verification').hide();
|
||||
$('#AlbumList').html('');
|
||||
//$('#some-element').show();
|
||||
$.cookie('key_cookie', userpass, { expires: 7 });
|
||||
$.cookie('albumkey_cookie', albumkey, { expires: 7 });
|
||||
if(imgList.length==0){
|
||||
$('#imgLose').css('display','block');
|
||||
}else{
|
||||
for(var i = 0;i<imgList.length;i++){
|
||||
var datasize = "";
|
||||
body+='<div class="grid__item" data-size="9999x9999"> <a href="'+imgList[i].imgurl+'" class="img-wrap"><img src="'+imgList[i].imgurl+'" alt="'+imgList[i].imgurl+'" />\n' +
|
||||
'<div class="description description--grid" style="display: none;">'+imgList[i].notes+'</div>\n' +
|
||||
'</a> </div>';
|
||||
}
|
||||
$('#AlbumList').html(body);
|
||||
imgRendering();
|
||||
$('#Albummain').show();
|
||||
}
|
||||
}else if(code=='404'){
|
||||
$('#verification').hide();
|
||||
$('#imgLose').css('display','block');
|
||||
}else{
|
||||
layer.msg(data.info, {icon: 2});
|
||||
// setTimeout(function () {
|
||||
// }, 1000);
|
||||
$('#verification').show();
|
||||
$.cookie('key_cookie', null);
|
||||
$.cookie('albumkey_cookie', null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getImageWidth(url,callback){
|
||||
var img = new Image();
|
||||
img.src = url;
|
||||
// 如果图片被缓存,则直接返回缓存数据
|
||||
if(img.complete){
|
||||
callback(img.width, img.height);
|
||||
}else{
|
||||
// 完全加载完毕的事件
|
||||
img.onload = function(){
|
||||
callback(img.width, img.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//页面图片渲染
|
||||
function imgRendering() {
|
||||
// create SVG circle overlay and append it to the preview element
|
||||
function createCircleOverlay(previewEl) {
|
||||
var dummy = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
dummy.setAttributeNS(null, 'version', '1.1');
|
||||
dummy.setAttributeNS(null, 'width', '100%');
|
||||
dummy.setAttributeNS(null, 'height', '100%');
|
||||
dummy.setAttributeNS(null, 'class', 'overlay');
|
||||
var g = document.createElementNS('http://www.w3.org/2000/svg', 'g');
|
||||
var circle = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
||||
circle.setAttributeNS(null, 'cx', 0);
|
||||
circle.setAttributeNS(null, 'cy', 0);
|
||||
circle.setAttributeNS(null, 'r', Math.sqrt(Math.pow(previewEl.offsetWidth,2) + Math.pow(previewEl.offsetHeight,2)));
|
||||
dummy.appendChild(g);
|
||||
g.appendChild(circle);
|
||||
previewEl.appendChild(dummy);
|
||||
}
|
||||
|
||||
new GridFx(document.querySelector('.grid'), {
|
||||
onInit : function(instance) {
|
||||
createCircleOverlay(instance.previewEl);
|
||||
},
|
||||
onResize : function(instance) {
|
||||
instance.previewEl.querySelector('svg circle').setAttributeNS(null, 'r', Math.sqrt(Math.pow(instance.previewEl.offsetWidth,2) + Math.pow(instance.previewEl.offsetHeight,2)));
|
||||
},
|
||||
onOpenItem : function(instance, item) {
|
||||
// item's image
|
||||
var gridImg = item.querySelector('img'),
|
||||
gridImgOffset = gridImg.getBoundingClientRect(),
|
||||
win = {width: document.documentElement.clientWidth, height: window.innerHeight},
|
||||
SVGCircleGroupEl = instance.previewEl.querySelector('svg > g'),
|
||||
SVGCircleEl = SVGCircleGroupEl.querySelector('circle');
|
||||
|
||||
SVGCircleEl.setAttributeNS(null, 'r', Math.sqrt(Math.pow(instance.previewEl.offsetWidth,2) + Math.pow(instance.previewEl.offsetHeight,2)));
|
||||
// set the transform for the SVG g node. This will animate the circle overlay. The origin of the circle depends on the position of the clicked item.
|
||||
if( gridImgOffset.left + gridImg.offsetWidth/2 < win.width/2 ) {
|
||||
SVGCircleGroupEl.setAttributeNS(null, 'transform', 'translate(' + win.width + ', ' + (gridImgOffset.top + gridImg.offsetHeight/2 < win.height/2 ? win.height : 0) + ')');
|
||||
}
|
||||
else {
|
||||
SVGCircleGroupEl.setAttributeNS(null, 'transform', 'translate(0, ' + (gridImgOffset.top + gridImg.offsetHeight/2 < win.height/2 ? win.height : 0) + ')');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// window.onload=function(){
|
||||
// var oDiv=document.getElementById('some-element');
|
||||
// var x = 10;
|
||||
// var y = 1;
|
||||
// var rand = parseInt(Math.random() * (x - y + 1) + y);
|
||||
// var c1 = '';
|
||||
// var c2 = '';
|
||||
// if(rand==1){c1 = '26d9b3';c2 = '5a84fd';}
|
||||
// else if(rand==2){c1 = '6DE195';c2 = 'C4E759';}
|
||||
// else if(rand==3){c1 = '41C7AF';c2 = '54E38E';}
|
||||
// else if(rand==4){c1 = '99E5A2';c2 = 'D4FC78';}
|
||||
// else if(rand==5){c1 = 'A16BFE';c2 = 'DEB0DF';}
|
||||
// else if(rand==6){c1 = 'F78FAD';c2 = 'FDEB82';}
|
||||
// else if(rand==7){c1 = 'BC3D2F';c2 = 'A16BFE';}
|
||||
// else if(rand==8){c1 = 'A43AB2';c2 = 'E13680';}
|
||||
// else if(rand==9){c1 = '8DEBFF';c2 = '41D8DD';}
|
||||
// else{c1 = '5583EE';c2 = '5a84fd';}
|
||||
// oDiv.style.cssText="background: #"+c1+";background: -moz-linear-gradient(right, #"+c1+" 0%, #"+c2+" 100%);background: -webkit-linear-gradient(right, #"+c1+" 0%, #"+c2+" 100%);background: linear-gradient(to right, #"+c1+" 0%, #"+c2+" 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#"+c1+"', endColorstr='#"+c2+"',GradientType=1 );"; //第二种 使用cssText
|
||||
// };
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,51 +0,0 @@
|
||||
<!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>
|
||||
<script th:src="@{/js/js.cookie.min.js}"></script>
|
||||
</head>
|
||||
<body>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<h2 id="logmsg" align="center" style=" color: #555;">登录已过期,请重新登录</h2>
|
||||
|
||||
<script>
|
||||
top.location.href="/";
|
||||
|
||||
// var isurl = window.location.protocol+'//'+window.location.host+'/admin/goadmin';//document.referrer+'/admin/goadmin'
|
||||
// //cookie登录
|
||||
// var cookiepass = $.cookie('pass_hellohaobycookie');
|
||||
// var cookiename = $.cookie('name_hellohaobycookie');
|
||||
// if(cookiepass!=null && cookiepass!="" && cookiepass!="null"){
|
||||
// $('#logmsg').text('正在验证本地登录');
|
||||
// cookieLogin(cookiename,cookiepass)
|
||||
// }else{
|
||||
// top.location.href="/";
|
||||
// }
|
||||
function cookieLogin(loginemail,loginpassword){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/login_c",
|
||||
data: {email: loginemail, password: loginpassword},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data == 1) {
|
||||
$.cookie('name_hellohaobycookie', loginemail, { expires: 90});
|
||||
$.cookie('pass_hellohaobycookie', loginpassword, { expires: 90});
|
||||
top.location.href=isurl;
|
||||
} else {
|
||||
$('#logmsg').text('本地账号已失效。');
|
||||
$.cookie('name_hellohaobycookie', null);
|
||||
$.cookie('pass_hellohaobycookie', null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,17 +0,0 @@
|
||||
<!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>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<h2 id="logmsg" align="center" style=" color: #555;" th:text="${error}"></h2>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,913 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="keywords" th:content="${config.getWebkeywords()}" />
|
||||
<meta name="description" th:content="${config.getWebms()}" />
|
||||
<meta name="author" content="Hellohao" />
|
||||
<title th:text="${config.getWebname()}"></title>
|
||||
<link rel="shortcut icon" th:href="${config.getWebfavicons()}" type="image/x-icon"/>
|
||||
<link rel="icon" type="image/ico" th:href="${config.getWebfavicons()}" />
|
||||
<link rel="stylesheet" th:href="@{/css/intro.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"/>
|
||||
<link th:href="@{/webuploade/css/component.css}" media="all" rel="stylesheet" type="text/css"/>
|
||||
<link th:href="@{/static/css/login-register.css}" media="all" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" th:href="@{/css/verify.css}" />
|
||||
<link rel="stylesheet" th:href="@{/css/Mini/reset.css}" />
|
||||
<link rel="stylesheet" th:href="@{/css/Mini/style.css}" />
|
||||
<link rel="stylesheet" th:href="@{/static/css/animate.min.css}" />
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}" />
|
||||
<link rel='stylesheet' th:href="@{css/urllist/all.min.css}" />
|
||||
<link rel="stylesheet" th:href="@{/css/urllist/style.css}" />
|
||||
<link rel="stylesheet" th:href="@{/css/default.css}" id="theme-color" />
|
||||
<style>
|
||||
#uploader .placeholder {
|
||||
/* border: 3px dashed #4ebd87; */
|
||||
min-height: 238px;
|
||||
padding-top: 158px;
|
||||
text-align: center;
|
||||
background: url(/webuploade/images/image2.png) center 93px no-repeat;
|
||||
color: #555555;
|
||||
font-size: 18px;
|
||||
position: relative;
|
||||
}
|
||||
#uploader .placeholder .webuploader-pick {
|
||||
/*background: #57a3f3;*/
|
||||
background: linear-gradient(to right,#2775ff,#7202bb);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
#container {border: 0px solid #FFF;border-radius: 0px;font-size: 12px;margin-top: 10px;}
|
||||
.nav-item:hover{position: relative;}
|
||||
#asd:hover{position: relative;}
|
||||
.layui-tab-brief > .layui-tab-title .layui-this {color: #ff0000;}
|
||||
.feather-grid{color: #F5F5F6;}
|
||||
#uploader .statusBar .btns .uploadBtn {background: linear-gradient(to right,#2775ff,#7202bb);}
|
||||
#uploader .statusBar .btns .uploadBtn:hover {background: linear-gradient(to right,#2775ff,#7202bb);}
|
||||
.fontstyle{word-wrap: break-word;word-break: break-all;overflow: hidden;margin-left: 10px;padding-top: 20px;}
|
||||
.el-backtop {
|
||||
position: fixed;
|
||||
background-color: #fff;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
color: #409eff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
/*box-shadow: 0 0 6px rgba(0,0,0,.12);*/
|
||||
cursor: pointer;
|
||||
z-index: 5;
|
||||
border: 1px solid #f0f0f0;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
.iconimg{
|
||||
display: block;
|
||||
float: left;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 10px;
|
||||
background: #505050;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ebeef5;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
background-size:auto 100%;
|
||||
-moz-background-size:100% 100%;
|
||||
}
|
||||
.close {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
#jyupdate{
|
||||
color: #2a70fc;font-size: 0.9em;cursor:pointer;font-weight: bold;
|
||||
}
|
||||
#setday{
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
.mt-5, .my-5 {
|
||||
margin-top: 0rem !important;
|
||||
}
|
||||
.pb-5, .py-5 {
|
||||
padding-bottom: 1rem !important;
|
||||
}
|
||||
.pt-5, .py-5 {
|
||||
padding-top: 1rem !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<section class="sticky-top sticky-navigation" style=" background: linear-gradient(to right,#2775ff,#7202bb); ">
|
||||
<div class="container">
|
||||
<nav class="navbar navbar-expand-md navbar-light" style="color: #F5F5F6;">
|
||||
<a class="navbar-brand heading-black animated fipInX " href="/" style="color: #F5F5F6;" th:text="${config.getWebname()}">
|
||||
Hellohao图床
|
||||
</a>
|
||||
<button class="navbar-toggler navbar-toggler-right border-0" type="button" data-toggle="collapse"
|
||||
data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span data-feather="grid"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse animated fipInX " id="navbarCollapse">
|
||||
<ul class="navbar-nav ml-auto" id="usersrc" >
|
||||
<li class="nav-item" >
|
||||
<a style="color: #F5F5F6;" href="javascript:;" class="nav-link page-scroll d-flex flex-row align-items-center md-trigger" onclick="tologin()" >
|
||||
<em data-feather="user" width="18" height="18" class="mr-2"></em>
|
||||
登录
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" id="asd">
|
||||
<a style="color: #F5F5F6;" href="javascript:;" class="nav-link page-scroll d-flex flex-row align-items-center md-trigger" onclick="toregister()">
|
||||
<em data-feather="user-plus" width="18" height="18" class="mr-2"></em>
|
||||
注册
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bg-hero py-7">
|
||||
<div class="container">
|
||||
|
||||
<div class="alert alert-info" role="alert" id="explaindiv" style="display: none;">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<strong>🔊</strong> <span id="explain">Better check yourself, you're not looking too good.</span>
|
||||
</div>
|
||||
<form enctype="multipart/form-data">
|
||||
<!--图片上传模板-->
|
||||
<div id="wrapper">
|
||||
<div id="container" class="animated bounce" style="border-radius: 5px;border: 1px solid #ebeef5;box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);">
|
||||
<!--头部,相册选择和格式选择-->
|
||||
<div id="uploader">
|
||||
<div class="queueList">
|
||||
<div id="dndArea" class="placeholder">
|
||||
<br />
|
||||
<span class="text">您也可以尝试文件拖拽,使用截屏工具,然后激活窗口后使用Ctrl+V粘贴。<span id="whts" data-toggle="popover" title="Example popover" class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></span>
|
||||
<br />
|
||||
<span class="text" id="urlsc" ><a style="color: #2a70fc;font-size: 0.9em;cursor:pointer;font-weight: bold;" onclick="imgsc()">使用图片URL地址上传</a></span>
|
||||
<div id="filePicker">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="statusBar" style="display:none;">
|
||||
<div class="progress">
|
||||
<span class="text">0%</span>
|
||||
<span class="percentage"></span>
|
||||
</div><div class="info"></div>
|
||||
<div class="btns">
|
||||
<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bg-hero py-7" id="updateurl" style="display: none;">
|
||||
<div class="text-center mb-60 position-relative">
|
||||
<h5 class="font__family-montserrat font__weight-light text-uppercase font__size-18 text-blue brk-library-rendered" data-brk-library="component__title">Picture link address</h5>
|
||||
<hr class="divider wow zoomIn brk-library-rendered" data-brk-library="component__title" style="visibility: visible; animation-name: zoomIn;">
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="panel__wrapper-icon mb-100 brk-library-rendered" data-brk-library="component__panel">
|
||||
<div class="panel__head all-light">
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin: 0 auto;">
|
||||
<ul class="layui-tab-title" id="urllist">
|
||||
<li class="imgurltype" onclick="imgurltype(2)" style="float:right;display: inline-block;">Markdown</li>
|
||||
<li class="imgurltype" onclick="imgurltype(3)" style="float:right;display: inline-block;">HTML</li>
|
||||
<li class="imgurltype" onclick="imgurltype(4)" style="float:right;display: inline-block;">BBCode</li>
|
||||
<li class="layui-this imgurltype" id="urls" onclick="imgurltype(1)" style="float:right;display: inline-block;">U R L</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="panel__list" id="imgurls">
|
||||
</ul>
|
||||
<div class="el-backtop" style="right: 50px; bottom: 150px;" onclick="anniu()"><i class="layui-icon layui-icon-picture" style="color: #666666;"></i> </div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<br /><br />
|
||||
<footer class="py-5 bg-light" style="position: fixed;bottom: 0px;width: 100%;">
|
||||
<div class="container">
|
||||
<div class="row mt-5">
|
||||
<div class="col-12 text-muted text-center small-xl" th:utext="${config.getLinks()}" >
|
||||
© 2019 Hellohao - All Rights Reserved - Collect from <a href="http://www.Hellohao.cn/" target="_blank" title="Hellohao">Hellohao博客</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="scroll-top">
|
||||
<i class="fa fa-angle-up" aria-hidden="true"></i>
|
||||
</div>
|
||||
<input type="hidden" th:value="${suffix}" id="suffix" />
|
||||
<input type="hidden" th:value="${config.getExplain()}" id="exp" />
|
||||
<div class="login" style="z-index: 9999;display: none;position: fixed;">
|
||||
</div>
|
||||
<div class="sk-rotating-plane"></div>
|
||||
<div class="modal-backdrop fade show" id="zhezhao" style="display: none;"></div>
|
||||
<script th:src="@{/static/js/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<!-- <script type="text/javascript" th:src="@{/static/js/bootstrap.min.js}"></script>-->
|
||||
<script th:src="@{/js/bootstrap.jj.js}"></script>
|
||||
<script th:src="@{/static/js/bootbox.min.js}"></script>
|
||||
<script th:src="@{/static/js/clipboard.min.js}"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script th:src="@{/webuploade/js/webuploader.js}"></script>
|
||||
<script th:src="@{/static/js/login-register.js}"></script>
|
||||
<script th:src="@{/webuploade/js/upload.js}" ></script>
|
||||
<script th:src="@{/webuploade/js/classie.js}"></script>
|
||||
<script th:src="@{/static/js/sweetalert2.min.js}"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script type="text/javascript" th:src="@{/js/feather.min.js}"></script>
|
||||
<script th:src="@{/js/verify.js}"></script>
|
||||
<script th:src="@{/js/js.cookie.min.js}"></script>
|
||||
<script th:src="@{/js/base64.min.js}"></script>
|
||||
<script th:src="@{/static/js/clipboard.min.js}"></script>
|
||||
<script th:src="@{/js/jquery.qrcode.min.js}"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$("#myModal modal-backdrop").addClass('show')
|
||||
var isday = 0;
|
||||
var verification = false;
|
||||
var zcverification = false;
|
||||
var logotmp = 0;
|
||||
var zctmp = 0;
|
||||
var arr_imgurl = "";
|
||||
var arr_url = "";
|
||||
var arr_markdown = "";
|
||||
var arr_html = "";
|
||||
var arr_ddcode = "";
|
||||
var urltypes = 1;//1 url 2 md 3 a标签 4 论坛格式
|
||||
var VisitorUpload = [[${VisitorUpload}]];
|
||||
var filesize = [[${filesize}]];
|
||||
var imgcount = [[${imgcount}]];
|
||||
var theme = [[${config.getTheme()}]];
|
||||
var exp = $("#exp").val();
|
||||
var suffix= $('#suffix').val();
|
||||
var qq ='hellohao-code-yz';
|
||||
var layer;
|
||||
layui.use('layer', function(){
|
||||
layer = layui.layer;
|
||||
//url(../images/img2.png) center 93px no-repeat
|
||||
feather.replace();
|
||||
});
|
||||
$(function () {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/islogin",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if(data.lgoinret==1){
|
||||
bodys();
|
||||
}
|
||||
}
|
||||
});
|
||||
if(exp!="" && exp!=null && typeof(exp) != undefined){
|
||||
$("#explaindiv").show();
|
||||
$("#explain").text(exp);
|
||||
}else{
|
||||
$("#explaindiv").hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function tologin() {
|
||||
|
||||
var html = ' <p style="display: block;float: right;margin-top: 5px; cursor:pointer;margin-right: 13px;font-size: 24px;" onclick="Closelogin()">×</p>\n' +
|
||||
' <div class="login-top">\n' +
|
||||
' 登录\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
//' <div class="login-center-img"><img th:src="@{/img/name.png}"/></div>\n' +
|
||||
' <div class="login-center-input">\n' +
|
||||
' <input type="text" id="loginemail" name="" value="" placeholder="请输入您的邮箱" onfocus="this.placeholder=\'\'" onblur="this.placeholder=\'请输入您的邮箱\'"/>\n' +
|
||||
' <div class="login-center-input-text">邮箱</div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
//' <div class="login-center-img"><img th:src="@{/img/password.png}"/></div>\n' +
|
||||
' <div class="login-center-input">\n' +
|
||||
' <input type="password" id="loginpassword" name=""value="" placeholder="请输入您的密码" onfocus="this.placeholder=\'\'" onblur="this.placeholder=\'请输入您的密码\'"/>\n' +
|
||||
' <div class="login-center-input-text">密码</div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
' <div style="width: 280px;height: 50px;">\n' +
|
||||
' <div id="mpanel1" ></div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-button" onclick="loginAjax()">\n' +
|
||||
' 登陆\n' +
|
||||
' </div>';
|
||||
|
||||
|
||||
$('.login').html(html);
|
||||
$('#zhezhao').show();
|
||||
$('.login').show();
|
||||
$('.login').addClass('animated slideInDown');
|
||||
$('body').css({
|
||||
"overflow-x":"hidden",
|
||||
"overflow-y":"hidden"
|
||||
});
|
||||
initSlideVerify(1);
|
||||
}
|
||||
|
||||
function toregister() {
|
||||
var html = '<p style="display: block;float: right;margin-top: 5px; cursor:pointer;margin-right: 13px;font-size: 24px;" onclick="Closelogin()">×</p>\n' +
|
||||
' <div class="login-top" style="margin-top: 50px;">\n' +
|
||||
' 注册\n' +
|
||||
' </div>\n' +
|
||||
' <p align="center" style="color: #db5860;margin-top: -40px;" id="zcts"></p>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
//' <div class="login-center-img"><img th:src="@{/img/name.png}"/></div>\n' +
|
||||
' <div class="login-center-input">\n' +
|
||||
' <input type="text" id="registerusername" name="username" value="" placeholder="用户名(数字/字母不得超过10位)" onfocus="this.placeholder=\'\'" onblur="this.placeholder=\'用户名(数字/字母不得超过10位)\'"/>\n' +
|
||||
' <div class="login-center-input-text">用户名</div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
//' <div class="login-center-img"><img th:src="@{/img/name.png}"/></div>\n' +
|
||||
' <div class="login-center-input">\n' +
|
||||
' <input type="text" id="registeremail" name="email" value="" placeholder="待验证的邮箱" onfocus="this.placeholder=\'\'" onblur="this.placeholder=\'待验证的邮箱\'"/>\n' +
|
||||
' <div class="login-center-input-text">邮箱</div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
//' <div class="login-center-img"><img th:src="@{/img/password.png}"/></div>\n' +
|
||||
' <div class="login-center-input">\n' +
|
||||
' <input type="password" id="registerpassword" name="password" value="" placeholder="请输入您的密码" onfocus="this.placeholder=\'\'" onblur="this.placeholder=\'请输入您的密码\'"/>\n' +
|
||||
' <div class="login-center-input-text">密码</div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
//' <div class="login-center-img"><img th:src="@{/img/password.png}"/></div>\n' +
|
||||
' <div class="login-center-input">\n' +
|
||||
' <input type="password" id="registerpassword_confirmation" name="password" value="" placeholder="请输入您的密码" onfocus="this.placeholder=\'\'" onblur="this.placeholder=\'请输入您的密码\'"/>\n' +
|
||||
' <div class="login-center-input-text">密码</div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-center clearfix">\n' +
|
||||
' <div style="width: 280px;height: 50px;">\n' +
|
||||
' <div id="mpanel2" ></div>\n' +
|
||||
' </div>\n' +
|
||||
' </div>\n' +
|
||||
' <div class="login-button" onclick="ismail();">\n' +
|
||||
' 注册\n' +
|
||||
' </div>';
|
||||
|
||||
$('.login').html(html);
|
||||
$('#zhezhao').show();
|
||||
$('.login').show();
|
||||
$('.login').addClass('animated slideInDown');
|
||||
$('body').css({
|
||||
"overflow-x":"hidden",
|
||||
"overflow-y":"hidden"
|
||||
});
|
||||
initSlideVerify(2);
|
||||
}
|
||||
|
||||
function Closelogin() {
|
||||
$('#zhezhao').hide();
|
||||
$('.login').hide();
|
||||
$('.registers').hide();
|
||||
$('body').css({
|
||||
"overflow-x":"auto",
|
||||
"overflow-y":"auto"
|
||||
});
|
||||
}
|
||||
|
||||
function imgsc() {
|
||||
var str = '输入图片URL地址:';
|
||||
if(isday>0){
|
||||
str = '输入图片URL地址:('+isday+'天后将会自动销毁)';
|
||||
}
|
||||
swal(str, {
|
||||
content: "input",
|
||||
})
|
||||
.then((value) => {
|
||||
var result =value;
|
||||
if(result!=null && result!="" ){
|
||||
urlimg(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
function urlimg(result) {
|
||||
if(result) {
|
||||
var rx=/^https?:\/\//i;
|
||||
if(rx.test(result)==true){
|
||||
var msgid = layer.msg('上传中..', {
|
||||
icon: 16
|
||||
,shade: 0.01
|
||||
});
|
||||
qq = GetDateStr(new Date());
|
||||
$('#loadingModal').modal({backdrop: 'static', keyboard: false,upurlk:qq});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/upurlimg",
|
||||
dataType: "json",
|
||||
data: {imgurl: result,setday:isday,upurlk:qq},
|
||||
success: function (data) {
|
||||
layer.close(msgid);
|
||||
for(var i=0;i<data.length;i++){
|
||||
if(data[i]==-1){
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('上传失败', '未配置存储源,请先后台配置存储源');
|
||||
}
|
||||
else if(data[i]==-2){
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('上传失败', '图片太大或不存在');
|
||||
}
|
||||
else if(data[i]==-3){
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('上传失败', '文件类型不符合要求');
|
||||
}
|
||||
else if(data[i]==-4){
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('上传失败', '该文件不支持上传');
|
||||
}else if(data[i]==-5){
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('上传失败,可用空间不足');
|
||||
}else if(data[i]==403){
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('非法调用,请刷新页面后重试');
|
||||
}else if(data[i]==911){
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('你目前不能上传图片,请联系管理员');
|
||||
}else{
|
||||
$('#loadingModal').modal('hide');
|
||||
swal('上传成功', '该图片链接已成功上传');
|
||||
$("#address").css('display', 'block');
|
||||
$("#updateurl").show();
|
||||
arr_url += data[i] + '\r\n';
|
||||
arr_imgurl += '<li onclick="copyimgurl(this)" class="copyimgurl"><span class="line"></span><i class="icon fab fa-gg"></i><p class="fontstyle" >'+data[i]+ '</p></li>';
|
||||
arr_markdown += '<li onclick="copyimgurl(this)" class="copyimgurl "><span class="line"></span><i class="icon fab fa-gg"></i><p class="fontstyle">'+'</p></li>';
|
||||
arr_html += '<li onclick="copyimgurl(this)" class="copyimgurl "><span class="line"></span><i class="icon fab fa-gg"></i><p class="fontstyle">'+'<img src="' + data[i] + '" alt="image" /> </p></li>';
|
||||
arr_ddcode +='<li onclick="copyimgurl(this)" class="copyimgurl"><span class="line"></span><i class="icon fab fa-gg"></i><p class="fontstyle">'+'[img]'+data[i]+'[/img]</p></li>';
|
||||
}
|
||||
if(urltypes==1){
|
||||
$("#imgurls").html(arr_imgurl);
|
||||
}else if(urltypes==2){
|
||||
$("#imgurls").html(arr_markdown);
|
||||
}else if(urltypes==3){
|
||||
$("#imgurls").html(arr_html);
|
||||
}else{
|
||||
$("#imgurls").html(arr_ddcode);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{layer.close(msgid);Popups('网址格式错误','网址必须以http(s)://开头。','error');}
|
||||
}
|
||||
}
|
||||
|
||||
function setday() {
|
||||
swal("输入图片期限(天),到期自动销毁图片,最高365天:\n(输入0为永久保存)", {
|
||||
content: "input",
|
||||
html: true,
|
||||
})
|
||||
.then((value) => {
|
||||
var result =value;
|
||||
var reg=/^[0-9]\d*$/;
|
||||
if(result!=null && result!="" ){
|
||||
if(reg.test(result)){
|
||||
if(result<=365){
|
||||
isday = result;
|
||||
// 初始化以后添加
|
||||
uploader.options.formData.setday = isday;
|
||||
}else{
|
||||
swal('输入天数有误,最大不可超过365天');
|
||||
}
|
||||
}else{
|
||||
swal('输入格式不正确,只可输入0-9之间正整数');
|
||||
}
|
||||
}
|
||||
if(isday>0){
|
||||
$('#setday').text(isday+'天后销毁');
|
||||
}else{
|
||||
$('#setday').text('图片期限');
|
||||
}
|
||||
});
|
||||
}
|
||||
function keyLogin(){
|
||||
if (event.keyCode==13)
|
||||
document.getElementById("dl").click();
|
||||
}
|
||||
|
||||
function loginAjax() {
|
||||
var loginemail = $("#loginemail").val();
|
||||
var loginpassword = $("#loginpassword").val();
|
||||
if(verification){
|
||||
//验证成功
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/login",
|
||||
data: {email: loginemail, password: loginpassword,logotmp:logotmp},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#loginModal').modal('hide');
|
||||
if (data == 1) {
|
||||
layer.msg('登录成功', {icon: 1});
|
||||
setTimeout(function () {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
} else {
|
||||
if (data == -1) {
|
||||
//$('#dlts').text('您的账号是未激活状态,无法登陆。');
|
||||
layer.msg('此账号是未激活状态,无法登陆', {icon: 4});
|
||||
again(1);
|
||||
} else if(data==-2){
|
||||
//$('#dlts').text('您的账号已被冻结。');
|
||||
layer.msg('您的账号已被冻结', {icon: 2});
|
||||
again(1);
|
||||
}else if(data==-3){
|
||||
//$('#dlts').text('非法登录,请刷新页面重新尝试。');
|
||||
layer.msg('非法登录,请刷新页面重新尝试', {icon: 2});
|
||||
again(1);
|
||||
}
|
||||
else {
|
||||
//$('#dlts').text('登录失败,你的邮箱或密码不正确,请重试。');
|
||||
layer.msg('登录失败,邮箱或者密码不正确', {icon: 2});
|
||||
again(1);
|
||||
}
|
||||
setTimeout(function () {
|
||||
//window.location.reload();
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
//$('#dlts').text('请滑动验证码进行验证,才可登录。');
|
||||
layer.msg('请滑动验证码进行验证,才可登录。', {icon: 2});
|
||||
}
|
||||
}
|
||||
|
||||
function initSlideVerify(v) {
|
||||
if(v==1){
|
||||
$('#mpanel1').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
verification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
logotmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:logotmp,type:1},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
}else{
|
||||
$('#mpanel2').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
zcverification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
zctmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:zctmp,type:2},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function again(v) {
|
||||
if(v==1){
|
||||
logotmp=0;
|
||||
verification = false;
|
||||
$('#mpanel1').html('');
|
||||
$('#mpanel1').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
verification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
logotmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:logotmp,type:1},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
}
|
||||
if(v==2){
|
||||
zctmp=0;
|
||||
zcverification = false;
|
||||
$('#mpanel2').html('');
|
||||
$('#mpanel2').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
verification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
zctmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:zctmp,type:2},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function bodys() {
|
||||
var h = '<li class="nav-item"><a style="color: #f5f5f5;cursor: pointer;" target="_blank" href="/admin/goadmin" class="nav-link page-scroll d-flex flex-row align-items-center md-trigger"> <em data-feather="tool" width="18" height="18" class="mr-2"></em>控制台</a></li>';
|
||||
var h1 = '<li class="nav-item"><a style="color: #f5f5f5;cursor: pointer;" target="_blank" onclick="exit()" class="nav-link page-scroll d-flex flex-row align-items-center md-trigger"> <em data-feather="x-square" width="18" height="18" class="mr-2"></em>退出</a></li>';
|
||||
$("#usersrc").html(h + h1 );
|
||||
feather.replace();
|
||||
}
|
||||
|
||||
function exit() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/exit.do",
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$.cookie('name_hellohaobycookie', null);
|
||||
$.cookie('pass_hellohaobycookie', null);
|
||||
layer.msg('账号已退出', {icon: 1});
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function zhuce(mail, registerusername, registerpassword) {
|
||||
if(zcverification){
|
||||
//验证成功
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/register",
|
||||
data: {email: mail, username: registerusername, password: registerpassword,zctmp:zctmp},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.ret > 0) {
|
||||
$("#zctishi").text('注册成功');
|
||||
if (data.zctype == 1) {
|
||||
layer.alert('注册成功,请前往邮箱激活你的账号,注意!激活邮件如果迟迟未收到,有可能在您的【垃圾箱】中。', {
|
||||
skin: 'layui-layer-molv'
|
||||
,closeBtn: 0
|
||||
,anim: 1
|
||||
,btn: ['确定']
|
||||
,icon: 1
|
||||
,yes:function(){
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.alert('注册成功,快去登录体验吧。', {
|
||||
skin: 'layui-layer-molv'
|
||||
,closeBtn: 0
|
||||
,anim: 1
|
||||
,btn: ['确定']
|
||||
,icon: 1
|
||||
,yes:function(){
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (data.ret == -2) {
|
||||
layer.alert('注册失败,用户名或邮箱重复且用户名只能为字母数字,请重试。', {
|
||||
skin: 'layui-layer-molv'
|
||||
,closeBtn: 0
|
||||
,anim: 1
|
||||
,btn: ['确定']
|
||||
,icon: 2
|
||||
});
|
||||
} else if(data.ret == -3){
|
||||
layer.alert('本站关闭了注册功能。', {
|
||||
skin: 'layui-layer-molv'
|
||||
,closeBtn: 0
|
||||
,anim: 1
|
||||
,btn: ['确定']
|
||||
,icon: 2
|
||||
});
|
||||
}else if(data.ret == -4){
|
||||
layer.alert('非法注册,请刷新页面后重新尝试。', {
|
||||
skin: 'layui-layer-molv'
|
||||
,closeBtn: 0
|
||||
,anim: 1
|
||||
,btn: ['确定']
|
||||
,icon: 2
|
||||
});
|
||||
}else {
|
||||
layer.alert('注册失败,请重试。', {
|
||||
skin: 'layui-layer-molv'
|
||||
,closeBtn: 0
|
||||
,anim: 1
|
||||
,btn: ['确定']
|
||||
,icon: 2
|
||||
});
|
||||
}
|
||||
setTimeout(function () {
|
||||
}, 2000);
|
||||
}
|
||||
again(2);
|
||||
$("#userzc").css('display','block');
|
||||
$("#zctishi").css('display','none');
|
||||
}
|
||||
});
|
||||
}else{
|
||||
shakeModal(6);
|
||||
$("#userzc").css('display','block');
|
||||
$("#zctishi").css('display','none');
|
||||
}
|
||||
}
|
||||
|
||||
$('.imgurltype').click(function () {
|
||||
$('.imgurltype').removeClass('layui-this');
|
||||
$(this).addClass('layui-this');
|
||||
});
|
||||
function imgurltype(v) {
|
||||
if(v==1){
|
||||
$("#imgurls").html(arr_imgurl);
|
||||
}else if(v==2){
|
||||
$("#imgurls").html(arr_markdown);
|
||||
}else if(v==3){
|
||||
$("#imgurls").html(arr_html);
|
||||
}else{
|
||||
$("#imgurls").html(arr_ddcode);
|
||||
}
|
||||
}
|
||||
|
||||
function copyimgurl(t) {
|
||||
var data = $(t).children('p').text();
|
||||
var copy = new ClipboardJS('.copyimgurl', {
|
||||
text: function (trigger) {
|
||||
return data;
|
||||
}
|
||||
});
|
||||
copy.on('success', function (e) {
|
||||
layer.msg('复制成功');
|
||||
copy.off("success");
|
||||
});
|
||||
copy.on('error', function (e) {
|
||||
layer.msg("复制失败");
|
||||
copy.off("error");
|
||||
});
|
||||
}
|
||||
|
||||
var win = null;
|
||||
function anniu(){
|
||||
if(arr_html!=null && arr_html!=""){
|
||||
win = layer.open({
|
||||
title:'画廊分享',
|
||||
type: 2,
|
||||
area: ['870px', '500px'],
|
||||
fixed: false, //不固定
|
||||
maxmin: true,
|
||||
content: '/addalbum'
|
||||
});
|
||||
}else{
|
||||
layer.msg('请先上传图片后再生成画廊', {icon: 7});
|
||||
}
|
||||
|
||||
if($(window).width()<=880){
|
||||
layer.full(win);
|
||||
}
|
||||
}
|
||||
|
||||
//浏览器窗口大小变化时
|
||||
$(window).resize(function() {
|
||||
if(win!=null){
|
||||
var window_width = $(window).width();//获取浏览器窗口宽度
|
||||
var window_height = $(window).height();//获取浏览器窗口高度
|
||||
if(window_width<880){
|
||||
layer.full(win);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function Popup(url,pass) {
|
||||
layer.close(win);
|
||||
if(pass==null || pass==''){
|
||||
pass = '无'
|
||||
}
|
||||
var imgbase64 = jrQrcode.getQrBase64(url);
|
||||
var body = '<div class="layui-row">\n' +
|
||||
'<form class="layui-form" action="">\n' +
|
||||
'<div class="layui-form-item" style="width: 80%;margin: 20px auto;">\n' +
|
||||
'<div class="layui-input-block" style="margin-left: 0px;">\n' +
|
||||
'<input id="albumurl" value="'+url+'" style="color:#999;border-radius:5px;border:1px #999 solid;" readonly="readonly" type="text" name="title" lay-verify="title" class="layui-input">\n' +
|
||||
'</div>\n' +
|
||||
'<div class="layui-form-mid "style="width:100%;text-align: center;color: #999999;font-weight: 500;">画廊密码:<span id="ckey" style="font-weight: 600;">'+pass+'</span><button onclick="copyurl()" style="margin-left: 50px;" type="button" class="copyurl layui-btn layui-btn-sm layui-btn-normal">复制链接及密码</button></div>\n' +
|
||||
'</div>\n' +
|
||||
'</form>\n' +
|
||||
'</div>\n' +
|
||||
'<div class="layui-row">\n' +
|
||||
'<div align="center"><img style="width: 150px;" src="'+imgbase64+'" /><p style="font-size: 12px;color: #999999;">将二维码分享给好友</p><p style="font-size: 12px;color: #999999;">对方通过扫码即可查看相册</p></div>\n' +
|
||||
'</div>';
|
||||
layer.open({
|
||||
type: 1,
|
||||
title:'画廊分享链接',
|
||||
area: ['520px', '400px'], //宽高
|
||||
//skin: 'layui-layer-demo', //样式类名
|
||||
closeBtn: 1, //不显示关闭按钮
|
||||
anim: 2,
|
||||
shadeClose: false, //开启遮罩关闭
|
||||
content: body
|
||||
});
|
||||
}
|
||||
function copyurl() {
|
||||
var data = "";
|
||||
var k = $('#ckey').text();
|
||||
var u = $('#albumurl').val();
|
||||
if(k=='无'){
|
||||
data = '画廊链接:'+u+ ' 复制这段内容后用浏览器打开,即可查看画廊哦';
|
||||
}else{
|
||||
data = '画廊链接:'+u+' 提取码:'+k+ ' 复制这段内容后用浏览器打开,即可查看画廊哦';
|
||||
}
|
||||
var copy = new ClipboardJS('.copyimgurl', {
|
||||
text: function (trigger) {
|
||||
return data;
|
||||
}
|
||||
});
|
||||
copy.on('success', function (e) {
|
||||
layer.msg('复制成功');
|
||||
copy.off("success");
|
||||
});
|
||||
copy.on('error', function (e) {
|
||||
layer.msg("复制失败");
|
||||
copy.off("error");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script th:inline="javascript">
|
||||
var baidu = [[${config.getBaidu()}]];
|
||||
loadScriptString(baidu);
|
||||
function loadScriptString(code) {
|
||||
var script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
try {
|
||||
// firefox、safari、chrome和Opera
|
||||
script.appendChild(document.createTextNode(code));
|
||||
} catch (ex) {
|
||||
// IE早期的浏览器 ,需要使用script的text属性来指定javascript代码。
|
||||
script.text = code;
|
||||
}
|
||||
document.getElementsByTagName("head")[0].appendChild(script);
|
||||
}
|
||||
</script>
|
||||
<input th:value="${vu}" type="hidden" id="vu" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,736 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
|
||||
<meta name="keywords" th:content="${config.getWebkeywords()}" />
|
||||
<meta name="description" th:content="${config.getWebms()}" />
|
||||
<meta name="author" content="Hellohao" />
|
||||
<title th:text="${config.getWebname()}"></title>
|
||||
<link rel="shortcut icon" th:href="${config.getWebfavicons()}" type="image/x-icon"/>
|
||||
<link rel="icon" type="image/ico" th:href="${config.getWebfavicons()}" />
|
||||
<link rel="stylesheet" th:href="@{css/style.css}" 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"/>
|
||||
<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<link th:href="@{/static/css/login-register.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/component.css}" media="all" rel="stylesheet" type="text/css"/>
|
||||
<link rel="stylesheet" th:href="@{/layui/layui/css/layui.css}" />
|
||||
<link rel="stylesheet" th:href="@{/css/intro.css}" />
|
||||
<link rel="stylesheet" th:href="@{/css/verify.css}" />
|
||||
<link rel="stylesheet" th:href="@{/static/css/animate.min.css}" />
|
||||
|
||||
<style type="text/css">
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
/* #usersrc a{
|
||||
transition: all 0.6s;
|
||||
}
|
||||
#usersrc a:hover{
|
||||
transform: scale(1.4);
|
||||
}*/
|
||||
#usersrc{
|
||||
cursor: default;
|
||||
}
|
||||
.goupdate {
|
||||
text-decoration: none;
|
||||
background: none;
|
||||
border: 0;
|
||||
box-shadow: inset 0 0 0 2px white;
|
||||
box-sizing: border-box;
|
||||
margin: 1em;
|
||||
padding: 1em 2em;
|
||||
font-size: inherit;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.goupdate::before, .goupdate::after {
|
||||
box-sizing: inherit;
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.goupdate{
|
||||
isolation: isolate;
|
||||
width:140px;
|
||||
height:50px;
|
||||
margin-right: 6%;
|
||||
font-size:15px;
|
||||
text-align:center;
|
||||
float: right;
|
||||
color:#FFF;
|
||||
cursor:pointer;
|
||||
}
|
||||
#beian a{
|
||||
color: #fff;
|
||||
}
|
||||
#setday{
|
||||
cursor: pointer;
|
||||
color: #4ebc86;
|
||||
font-weight: 600;
|
||||
font-family: 黑体;
|
||||
text-shadow: 5px 2px 6px #000;
|
||||
}
|
||||
.goupdate {
|
||||
transition: color 0.25s;
|
||||
}
|
||||
.goupdate::before, .goupdate::after {
|
||||
border: 2px solid transparent;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
.goupdate::before {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.goupdate::after {
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
.goupdate:hover {
|
||||
color: #60daaa;
|
||||
}
|
||||
.goupdate:hover::before, .goupdate:hover::after {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.goupdate:hover::before {
|
||||
border-top-color: #60daaa;
|
||||
border-right-color: #60daaa;
|
||||
transition: width 0.25s ease-out, height 0.25s ease-out 0.25s;
|
||||
}
|
||||
.goupdate:hover::after {
|
||||
border-bottom-color: #60daaa;
|
||||
border-left-color: #60daaa;
|
||||
transition: border-color 0s ease-out 0.5s, width 0.25s ease-out 0.5s, height 0.25s ease-out 0.75s;
|
||||
}
|
||||
.copytext{
|
||||
z-index: 99999;
|
||||
display: block;
|
||||
color: #4ebd87;
|
||||
position: relative;
|
||||
right: 22px;
|
||||
top: 21px;
|
||||
font-weight: 700;
|
||||
float: right;
|
||||
}
|
||||
.copytext:hover{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
#urls::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0.3);
|
||||
background-color:#F5F5F5;
|
||||
}
|
||||
#urls::-webkit-scrollbar {
|
||||
width:6px;
|
||||
background-color:#F5F5F5;
|
||||
}
|
||||
#urls::-webkit-scrollbar-thumb {
|
||||
background-color:#4ebd87;
|
||||
}
|
||||
#jyupdate{
|
||||
color: #4ebd87;font-size: 0.9em;cursor:pointer;font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="simple" id="body">
|
||||
<div class="text-center w-mian" id="videohtml">
|
||||
</div>
|
||||
<div class="preloader-container">
|
||||
<div class="content-container">
|
||||
<span class="spinner-section-far"></span>
|
||||
<h6 class="preloader-text">
|
||||
LOADING</h6>
|
||||
</div>
|
||||
</div>
|
||||
<img class="img-logo menu-link" data-section="home" data-nav-title="home" alt="logo" th:src="@{img/logo_white.png}" />
|
||||
<div class="open">
|
||||
<div class="cls">
|
||||
</div>
|
||||
<div>
|
||||
<ul class="sub-menu-t" id="usersrc">
|
||||
<li class="active"><a class="menu-link" data-section="home" data-nav-title="home"
|
||||
data-section-pos="0" data-section-posy="0">首页 <i class="fa fa-fw fa-home"></i>
|
||||
</a></li>
|
||||
<li><a href="javascript:;" class="md-trigger" data-modal="modal-3">登录 <span class="glyphicon glyphicon-user" aria-hidden="true"></span></a></li>
|
||||
<li><a href="javascript:;" class="md-trigger" data-modal="modal-4">注册 <span class="glyphicon glyphicon-retweet" aria-hidden="true"></span></a></li>
|
||||
|
||||
<!-- <li><a class="menu-link" href="https://github.com/Hello-hao/Tbed" target="_blank"-->
|
||||
<!-- >GitHub<i class="fa fa-github"></i></a></li>-->
|
||||
<!-- <li><a class="menu-link" href="http://www.hellohao.cn" target="_blank"-->
|
||||
<!-- >作者<i class="fa fa-github"></i></a></li>-->
|
||||
|
||||
<!-- <li><a href="javascript:;" class="md-trigger" data-modal="modal-2">赞助商 <i class="fa fa-share-alt"></i></a></li>-->
|
||||
|
||||
<!-- <li><a class="menu-link" onclick="Popups('亲爱的开发者','全新的响应式图床站,如果你也喜欢,希望给我一个Star。\n Hellohao开发者交流群:864800972','success');"-->
|
||||
<!-- >关于<i class="fa fa-share-alt"></i></a></li>-->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cls">
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-container">
|
||||
<div class="section-container">
|
||||
<section id="diyi" class="home-section">
|
||||
<div class="bg-container"></div>
|
||||
<div class="content col-lg-8 col-lg-offset-2 col-md-8 col-md-offset-2 col-sm-12 col-xs-rlt no-pad centering-y">
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<h1 class="animated" id="webtext" style="font-size: 3.5em;" th:text="${config.getWebname()}"></h1>
|
||||
<a id="goupdate" class="menu-link goupdate" data-section="contact" data-nav-title="contact" data-section-pos="-100"
|
||||
data-section-posy="0"><span class="glyphicon glyphicon-open" aria-hidden="true"></span>立即上传</a>
|
||||
<!-- <a id="goupdate2" onclick="xiazai()" class="goupdate">-->
|
||||
<!-- <span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>客户端</a>-->
|
||||
<br />
|
||||
<div class="sub-title" id="wordsrotator">
|
||||
<h4>纯粹免费的图片驿站</h4>
|
||||
</div>
|
||||
<p class="desc" th:text="${config.getExplain()}">
|
||||
Hellohao Figure bed:support several mainstream object storage, CDN acceleration is more stable.
|
||||
Technology constantly updated, we will always move forward on the road ahead.
|
||||
</p>
|
||||
<center>
|
||||
<div id="countdown" class="countdown-container" style="text-align: center;">
|
||||
<br />
|
||||
<div class="dash days_dash" style="max-width: 172px;">
|
||||
<div class="counter">
|
||||
<div class="dash_title">days</div>
|
||||
<div id="ri" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dash hours_dash" style="max-width: 172px;">
|
||||
<div class="counter">
|
||||
<div class="dash_title">hours</div>
|
||||
<div id="shi" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dash minutes_dash" style="max-width: 172px;">
|
||||
<div class="counter">
|
||||
<div class="dash_title">mins</div>
|
||||
<div id="fen" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dash seconds_dash" style="max-width: 172px;">
|
||||
<div class="counter">
|
||||
<div class="dash_title">secs</div>
|
||||
<div id="miao" style="margin-top: 26%;font-size: 2.5em;color: #FFFFFF;font-weight: bold;">0</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<div id="beian" style="text-align: center;float: initial;z-index: 99999;margin-top: 30px;">
|
||||
<br />
|
||||
<span style="margin-top: 20px;" th:utext="${config.getLinks()}">
|
||||
<a href="http://www.hellohao.cn">Hellohao©技术支持</a>
|
||||
</span>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="tlinks">Collect from <a href="/" >网站建设</a></div>
|
||||
<section id="dier" class="contact-section" >
|
||||
<ul style=" position: absolute;right: 63px;top: 24px;z-index: 9999;">
|
||||
<li class="active">
|
||||
<a class="menu-link" data-section="home" data-nav-title="home"data-section-pos="0" data-section-posy="0">
|
||||
<i class="fa fa-fw fa-home" style="font-size: 40px;color: #FFF;"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="bg-container-static"></div>
|
||||
<div class="content col-md-10 col-md-offset-1 col-sm-12 col-xs-12 no-pad centering-y col-sm-rlt" >
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<form enctype="multipart/form-data">
|
||||
<!--图片上传模板-->
|
||||
<div id="wrapper">
|
||||
<div id="container">
|
||||
<!--头部,相册选择和格式选择-->
|
||||
<div id="uploader">
|
||||
<div class="queueList">
|
||||
<div id="dndArea" class="placeholder">
|
||||
<br />
|
||||
<span class="text">您也可以尝试文件拖拽,使用截屏工具,然后激活窗口后粘贴。<span id="whts" data-toggle="popover" title="Example popover" class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></span>
|
||||
<br />
|
||||
<span class="text" id="urlsc" ><a style="color: #4ebd87;font-size: 0.9em;cursor:pointer;font-weight: bold;" onclick="imgsc()">使用图片URL地址上传</a></span>
|
||||
<div id="filePicker">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="statusBar" style="display:none;">
|
||||
<div class="progress">
|
||||
<span class="text">0%</span>
|
||||
<span class="percentage"></span>
|
||||
</div><div class="info"></div>
|
||||
<div class="btns">
|
||||
<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="contact-form" action="contact.php" method="post" enctype="multipart/form-data">
|
||||
<div class="col-xs-12 text-center no-pad">
|
||||
<div class="input-container no-mrg" id="urlstext">
|
||||
<a class="copytext" onclick="copyText()">
|
||||
COPY
|
||||
</a>
|
||||
<textarea id="urls" name="message" readonly="readonly" style="padding:20px;font-weight: 600; border: 1px solid #838383;border-radius: 5px;"></textarea>
|
||||
<div class="input-border-bottom"></div>
|
||||
</div>
|
||||
<div class="col-xs-12 notif-container no-pad">
|
||||
<div class="form-notif"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-xs-12 no-pad text-left mrg-top-xs">
|
||||
<div style="margin: 0 auto;text-align:center">
|
||||
<button type="button" style="width: 195px;height: 36px;padding: 10px 50px;" onclick="urltype(1);" class="button button-green button-small">URL</button>
|
||||
<button type="button" style="width: 195px;height: 36px;padding: 10px 50px;" onclick="urltype(2);" class="button button-green button-small">Markdown</button>
|
||||
<button type="button" style="width: 195px;height: 36px;padding: 10px 50px;" onclick="urltype(3);" class="button button-green button-small">HTML</button>
|
||||
<button type="button" style="width: 195px;height: 36px;padding: 10px 50px;" onclick="urltype(4);" class="button button-green button-small">BBCode</button>
|
||||
<!-- New Album-->
|
||||
<button type="button" style="width: 195px;height: 36px;padding: 10px 50px;background: #FC5348;color: #FFF;" onclick="anniu();" class="button button-green button-small">创建画廊</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--登录弹窗-->
|
||||
<div class="md-modal md-effect-3" id="modal-4">
|
||||
<div class="md-content" >
|
||||
<h3>账号注册</h3>
|
||||
<div>
|
||||
<p style="color: #ea1c27;" id="zcts"></p>
|
||||
<div class="form loginBox">
|
||||
<form method="post" data-remote="true" accept-charset="UTF-8">
|
||||
<div style="font-size: 13px;">
|
||||
<span> > 用户名注册后不能修改<br/>
|
||||
> 邮箱激活链接如果没有请在【垃圾箱】查找</span>
|
||||
</div>
|
||||
<hr/>
|
||||
<input id="registerusername" style="border-left:none;border-right:none;border-top:none;border-bottom:none;" type="text"
|
||||
placeholder="用户名(数字/字母不得超过10位)"
|
||||
name="username">
|
||||
<input id="registeremail" style=" border-left:none;border-right:none;border-top:none;border-bottom:none;" type="text" placeholder="邮箱"
|
||||
name="email">
|
||||
<input id="registerpassword" style="color:#000;background-color:#fff;padding: 18px 25px 22px 25px;; border-left:none;border-right:none;border-top:none;border-bottom: none;" type="text" placeholder="密码"
|
||||
name="password">
|
||||
<input id="registerpassword_confirmation" style="color:#000;background-color:#fff;padding: 18px 25px 22px 25px; border-left:none;border-right:none;border-top:none;border-bottom: none;" type="text"
|
||||
placeholder="重复密码" name="password_confirmation">
|
||||
<div class="form-group">
|
||||
<br />
|
||||
<div id="mpanel2" ></div>
|
||||
<hr />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div style="width: 100%;height: 30px;">
|
||||
<p id="zctishi" style="color: #000;font-weight: 700; display: none;">正在注册,请稍等...</p>
|
||||
<br />
|
||||
<button class=" btn-sm btn-primary" style="float: right;border-radius: initial;background: rgb(78, 189, 135);border: 0px;width: 100%;" id="userzc" onclick="ismail();">注册</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 注册-->
|
||||
<div class="md-modal md-effect-3" id="modal-3">
|
||||
<div class="md-content">
|
||||
<h3>账号登录</h3>
|
||||
<div>
|
||||
<p id="dlts" style="color: #f35518; text-align: center;"></p>
|
||||
<div class="form loginBox">
|
||||
<form id="login" onkeydown="keyLogin();">
|
||||
<div class="form-group">
|
||||
<input id="loginemail" type="email" style=" border-left:none;border-right:none;border-top:none;border-bottom:1px solid #0F2543;" placeholder="Email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input id="loginpassword" type="password" style="color:#000;background-color:#fff;padding: 18px 25px 22px 25px;width: 100%; border-left:none;border-right:none;border-top:none;border-bottom:1px solid #0F2543;" placeholder="Password">
|
||||
<hr />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div id="mpanel1" ></div>
|
||||
<hr />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div style="width: 100%;height: 30px;">
|
||||
<button class=" btn-sm btn-primary" data-loading-text="Loading..." id="dl" style="float: right;float: right;border-radius: initial;background: rgb(78, 189, 135);border: 0px;width: 100%;display: block;height: 30px;" onclick="loginAjax()">登录</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md-overlay"></div>
|
||||
<script type="text/javascript" th:src="@{js/jquery.js}"></script>
|
||||
<script th:src="@{/static/js/login-register.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/sweetalert2.min.js}"></script>
|
||||
<script th:src="@{/layui/layui/layui.js}"></script>
|
||||
<script th:src="@{/js/jquery.qrcode.min.js}"></script>
|
||||
<script th:src="@{/webuploade/js/webuploader.js}"></script>
|
||||
<script th:src="@{/webuploade/js/upload.js}" ></script>
|
||||
<script th:src="@{/webuploade/js/classie.js}"></script>
|
||||
<script th:src="@{/webuploade/js/modalEffects.js}" ></script>
|
||||
<script th:src="@{js/html5shiv.js}"></script>
|
||||
<script th:src="@{js/respond.min.js}"></script>
|
||||
<script type="text/javascript" th:src="@{/static/js/bootstrap.min.js}"></script>
|
||||
<script type="text/javascript" th:src="@{js/plugins.min.js}"></script>
|
||||
<script type="text/javascript" th:src="@{js/main_constellation.js}"></script>
|
||||
<script th:src="@{/js/verify.js}"></script>
|
||||
<script th:src="@{/js/base64.min.js}"></script>
|
||||
<script th:src="@{/js/js.cookie.min.js}"></script>
|
||||
<script th:src="@{/js/hellohao.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
var isday = 0;
|
||||
var verification = false;
|
||||
var zcverification = false;
|
||||
var logotmp = 0;
|
||||
var zctmp = 0;
|
||||
var arr_url = "";
|
||||
var arr_markdown = "";
|
||||
var arr_html = "";
|
||||
var arr_ddcode = "";
|
||||
var urltypes = 1;//1 url 2 md 3 a标签 4 论坛格式
|
||||
var VisitorUpload = [[${VisitorUpload}]];
|
||||
var filesize = [[${filesize}]];
|
||||
var imgcount = [[${imgcount}]];
|
||||
var suffix= [[${suffix}]];
|
||||
var theme = [[${config.getTheme()}]];
|
||||
var qq ='hellohao-code-yz';
|
||||
var layer;
|
||||
layui.use('layer', function(){
|
||||
layer = layui.layer;
|
||||
});
|
||||
var oDiv=document.getElementById('body');
|
||||
var x = 10;
|
||||
var y = 1;
|
||||
var rand = parseInt(Math.random() * (x - y + 1) + y);
|
||||
var c1 = '';
|
||||
var c2 = '';
|
||||
if(rand==1){c1 = '26d9b3';c2 = '5a84fd';}
|
||||
else if(rand==2){c1 = '6DE195';c2 = 'C4E759';}
|
||||
else if(rand==3){c1 = '41C7AF';c2 = '54E38E';}
|
||||
else if(rand==4){c1 = '99E5A2';c2 = 'D4FC78';}
|
||||
else if(rand==5){c1 = 'A16BFE';c2 = 'DEB0DF';}
|
||||
else if(rand==6){c1 = 'F78FAD';c2 = 'FDEB82';}
|
||||
else if(rand==7){c1 = 'BC3D2F';c2 = 'A16BFE';}
|
||||
else if(rand==8){c1 = 'A43AB2';c2 = 'E13680';}
|
||||
else if(rand==9){c1 = '8DEBFF';c2 = '41D8DD';}
|
||||
else{c1 = '5583EE';c2 = '5a84fd';}
|
||||
oDiv.style.cssText="background: #"+c1+";background: -moz-linear-gradient(right, #"+c1+" 0%, #"+c2+" 100%);background: -webkit-linear-gradient(right, #"+c1+" 0%, #"+c2+" 100%);background: linear-gradient(to right, #"+c1+" 0%, #"+c2+" 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#"+c1+"', endColorstr='#"+c2+"',GradientType=1 );";
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".jb").fadeToggle();
|
||||
$(".jb").fadeToggle(4000);
|
||||
});
|
||||
|
||||
if (window != top){top.location.href = location.href;}
|
||||
|
||||
$(function () {
|
||||
var backtype = [[${config.getBacktype()}]];
|
||||
var sc = [[${error}]];
|
||||
if(sc!=1 && sc!=null){
|
||||
alert(sc);
|
||||
}
|
||||
var gg=[[${config.getNotice()}]];
|
||||
var arr=new Array();
|
||||
var arr2=new Array();
|
||||
//可以用字符或字符串分割
|
||||
arr=gg.split('|');
|
||||
for(var i=0;i<arr.length;i++)
|
||||
{arr2.push('<h2>'+arr[i]+'</h2>');}
|
||||
$.wordrotator_words =arr2;
|
||||
setInterval(clock,1000);//首页动态时间
|
||||
//设置页面资料
|
||||
var webname = [[${config.getWebname()}]];
|
||||
var explain = [[${config.getExplain()}]];
|
||||
var backtype = [[${config.getBacktype()}]];
|
||||
var links = [[${config.getLinks()}]];
|
||||
var video = [[${config.getVideo()}]];
|
||||
$("#webname").text(webname);
|
||||
$("#explain").text(explain);
|
||||
$("#links").html(links);
|
||||
$("#whts").attr("title",'图片大小不得超过'+[[${uploadConfig.getFilesizetourists()}]]+' MB,登录本站可上传'+[[${uploadConfig.getFilesizeuser()}]]+' M图片以及查看历史图片记录等更多操作。');
|
||||
|
||||
});
|
||||
|
||||
var baidu = [[${config.getBaidu()}]];
|
||||
loadScriptString(baidu);
|
||||
|
||||
(function ($) {
|
||||
var backtype = [[${config.getBacktype()}]];
|
||||
var videourl = [[${config.getVideo()}]];
|
||||
"use strict";
|
||||
if(backtype==1){
|
||||
$.bg_urls = [
|
||||
[[${config.getBackground1()}]]
|
||||
];
|
||||
}else{
|
||||
$('#videohtml').html('\t<video muted autoplay="autoplay" loop="loop" class="bgvid" id="bgvid" style="width: 100%;height: 100%;display: block;object-fit: fill;"><source src="'+videourl+'" type="video/mp4"></video>');
|
||||
}
|
||||
$.youtube_url = ""; //-- just the last words after https://www.youtube.com/watch?v=
|
||||
$.self_host_video_path = ""; //-- self hosted video path
|
||||
$.self_host_video_filename = ""; //-- self hosted video filename "WITHOUT .MP4 EXTENSION"
|
||||
$.latitude_longitude = [ [21.1991367, 72.84016666] ];
|
||||
$.map_marker_url = "img/marker.png"; //-- Map marker image url
|
||||
$.map_marker_info = '<h6 class="text-darkgrey">Main Office</h6><p class="map-marker-info">Open at 09:00 - 15:00<br>Monday till Saturday</p>';
|
||||
$.enable_wordrotator = true; //-- enabling wordrotator on headline text
|
||||
$.wordrotator_words = ['<h2>也许...</h2>', '<h2>这将是你用过最好用的图床站</h2>']; //-- Array of words, for headline text
|
||||
$.is_changing_section = false;
|
||||
|
||||
var sett = [[${config.getSett()}]];
|
||||
if(sett!=1){
|
||||
$('#diyi').removeClass('home-section');
|
||||
$('#diyi').html('');
|
||||
$('#dier').addClass('home-section');
|
||||
$('#dier').removeClass('contact-section');
|
||||
$('#dier').css("background","rgba(38,38,38,0.7)");//style="background: rgba(38,38,38,0.7);"
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
||||
$('#mpanel1').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
verification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
logotmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:logotmp,type:1},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
|
||||
$('#mpanel2').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
zcverification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
zctmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:zctmp,type:2},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
|
||||
function again(v) {
|
||||
if(v==1){
|
||||
logotmp=0;
|
||||
verification = false;
|
||||
$('#mpanel1').html('');
|
||||
$('#mpanel1').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
verification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
logotmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:logotmp,type:1},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
}
|
||||
if(v==2){
|
||||
zctmp=0;
|
||||
zcverification = false;
|
||||
$('#mpanel2').html('');
|
||||
$('#mpanel2').slideVerify({
|
||||
type : 1, //类型
|
||||
vOffset : 5, //误差量,根据需求自行调整
|
||||
barSize : {
|
||||
width : '100%',
|
||||
height : '40px',
|
||||
},
|
||||
ready : function() {
|
||||
},
|
||||
success : function() {
|
||||
verification = true;
|
||||
var myDate = new Date();
|
||||
var tmp = Number(myDate.getMinutes()+''+myDate.getSeconds());
|
||||
zctmp = (tmp-500+1+2+3-4);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/verification",
|
||||
data:{tmp:zctmp,type:2},
|
||||
dataType: "json",
|
||||
success: function (data) {}
|
||||
});
|
||||
},
|
||||
error : function() {}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function setday() {
|
||||
swal("输入图片期限(天),到期自动销毁图片,最高365天:\n(输入0为永久保存)", {
|
||||
content: "input",
|
||||
html: true,
|
||||
})
|
||||
.then((value) => {
|
||||
var result =value;
|
||||
var reg=/^[0-9]\d*$/;
|
||||
if(result!=null && result!="" ){
|
||||
if(reg.test(result)){
|
||||
if(result<=365){
|
||||
isday = result;
|
||||
// 初始化以后添加
|
||||
uploader.options.formData.setday = isday;
|
||||
}else{
|
||||
swal('输入天数有误,最大不可超过365天');
|
||||
}
|
||||
}else{
|
||||
swal('输入格式不正确,只可输入0-9之间正整数');
|
||||
}
|
||||
}
|
||||
if(isday>0){
|
||||
$('#setday').text(isday+'天后销毁');
|
||||
}else{
|
||||
$('#setday').text('图片期限');
|
||||
}
|
||||
});
|
||||
}
|
||||
var win = null;
|
||||
function anniu(){
|
||||
if(arr_html!=null && arr_html!=""){
|
||||
win = layer.open({
|
||||
title:'画廊分享',
|
||||
type: 2,
|
||||
area: ['870px', '500px'],
|
||||
fixed: false, //不固定
|
||||
maxmin: true,
|
||||
content: '/addalbum'
|
||||
});
|
||||
}else{
|
||||
layer.msg('请先上传图片后再生成画廊', {icon: 7});
|
||||
}
|
||||
|
||||
if($(window).width()<=880){
|
||||
layer.full(win);
|
||||
}
|
||||
}
|
||||
|
||||
//浏览器窗口大小变化时
|
||||
$(window).resize(function() {
|
||||
if(win!=null){
|
||||
var window_width = $(window).width();
|
||||
var window_height = $(window).height();
|
||||
if(window_width<880){
|
||||
layer.full(win);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function Popup(url,pass) {
|
||||
layer.close(win);
|
||||
if(pass==null || pass==''){
|
||||
pass = '无'
|
||||
}
|
||||
var imgbase64 = jrQrcode.getQrBase64(url);
|
||||
var body = '<div class="layui-row">\n' +
|
||||
'<form class="layui-form" action="">\n' +
|
||||
'<div class="layui-form-item" style="width: 80%;margin: 20px auto;">\n' +
|
||||
'<div class="layui-input-block" style="margin-left: 0px;">\n' +
|
||||
'<input id="albumurl" value="'+url+'" style="color:#999;border-radius:5px;border:1px #999 solid;" readonly="readonly" type="text" name="title" lay-verify="title" class="layui-input">\n' +
|
||||
'</div>\n' +
|
||||
'<div class="layui-form-mid "style="width:100%;text-align: center;color: #999999;font-weight: 500;">画廊密码:<span id="ckey" style="font-weight: 600;">'+pass+'</span><button onclick="copyurl()" style="margin-left: 50px;" type="button" class="copyurl layui-btn layui-btn-sm layui-btn-normal">复制链接及密码</button></div>\n' +
|
||||
'</div>\n' +
|
||||
'</form>\n' +
|
||||
'</div>\n' +
|
||||
'<div class="layui-row">\n' +
|
||||
'<div align="center"><img style="width: 150px;" src="'+imgbase64+'" /><p style="font-size: 12px;color: #999999;">将二维码分享给好友</p><p style="font-size: 12px;color: #999999;">对方通过扫码即可查看相册</p></div>\n' +
|
||||
'</div>';
|
||||
layer.open({
|
||||
type: 1,
|
||||
title:'画廊分享链接',
|
||||
area: ['520px', '400px'], //宽高
|
||||
//skin: 'layui-layer-demo', //样式类名
|
||||
closeBtn: 1, //不显示关闭按钮
|
||||
anim: 2,
|
||||
shadeClose: false, //开启遮罩关闭
|
||||
content: body
|
||||
});
|
||||
}
|
||||
function copyurl() {
|
||||
var data = "";
|
||||
var k = $('#ckey').text();
|
||||
var u = $('#albumurl').val();
|
||||
if(k=='无'){
|
||||
data = '画廊链接:'+u+ ' 复制这段内容后用浏览器打开,即可查看画廊哦';
|
||||
}else{
|
||||
data = '画廊链接:'+u+' 提取码:'+k+ ' 复制这段内容后用浏览器打开,即可查看画廊哦';
|
||||
}
|
||||
var copy = new ClipboardJS('.copyimgurl', {
|
||||
text: function (trigger) {
|
||||
return data;
|
||||
}
|
||||
});
|
||||
copy.on('success', function (e) {
|
||||
layer.msg('复制成功');
|
||||
copy.off("success");
|
||||
});
|
||||
copy.on('error', function (e) {
|
||||
layer.msg("复制失败");
|
||||
copy.off("error");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<input th:value="${vu}" type="hidden" id="vu" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,70 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- release v4.1.8, copyright 2014 - 2015 Kartik Visweswaran -->
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<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 rel="shortcut icon" th:href="${config.getWebfavicons()}" type="image/x-icon"/>
|
||||
<link rel="icon" type="image/ico" th:href="${config.getWebfavicons()}" />
|
||||
<link th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet" />
|
||||
<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>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<!-- box-shadow: 0 0 1px 0 rgb(70, 150, 255); border-radius: 15px 15px 0 0; -->
|
||||
<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;" th:text="${config.getWebname()}">Hellohao图床</p>
|
||||
</div>
|
||||
<div style="float: left;height: 47px;margin-left: 10px;">
|
||||
<div style="margin-top: 6px;">
|
||||
<span style="font-size: 12px;color:#FFFFFF;"> - 纯粹的图片寄存站。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<div style="border: 1px #FFFFFF solid;position: relative;">
|
||||
<div style="padding: 20px;font-size: 16px; min-height: 200px;font-weight:bold;">
|
||||
<p th:text="'您好:'+${username}"></p>
|
||||
<br/>
|
||||
<p>您的账号已<span style="font-size: 22px;color: #5cb85c"> 成功激活 </span>啦,注册用户可上传更大图片和所有的上传历史记录。快去试试吧!</p>
|
||||
<br/>
|
||||
<br/>
|
||||
<p><a href="#" id="urls" 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.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;">嗨~朋友</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>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<div style="border-radius:0 0 15px 15px;background-color: rgb(70, 150, 255);height: 30px;text-align: center; line-height:30px;color: #373d47;font-size: 12px;" >
|
||||
<span th:text="'Copyright © 2019 '+${config.getWebname()}"></span><span th:text="'By '+${config.getWebname()}+' All rights reserved.'"></span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,14 +1,16 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Verification failed</title>
|
||||
<title>消息提示</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
|
||||
* {
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
color: #888;
|
||||
display: table;
|
||||
@@ -17,16 +19,19 @@
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
margin: 2em auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #555;
|
||||
font-size: 2em;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 auto;
|
||||
width: 280px;
|
||||
@@ -48,10 +53,11 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1 style="font-size: 5.5em;">Verification failed</h1>
|
||||
<br/>
|
||||
<h1>你的域名验证未通过审核。</h1>
|
||||
<p>此版本为HellohaoPro,需要域名验证才可使用。</p>
|
||||
<h1 style="font-size: 4.5em;" th:text="${title}"></h1>
|
||||
<br />
|
||||
<h1 style="line-height: 80px;" th:text="${name}"></h1>
|
||||
<p th:text="${note}"></p>
|
||||
<a style="font-weight: bold; line-height: 80px;" th:href="${webhost}">GO HOME</a>
|
||||
</body>
|
||||
</html>
|
||||
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ -->
|
||||
Reference in New Issue
Block a user