mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
Merge branch 'master' into hellohao-dev
This commit is contained in:
@@ -324,7 +324,6 @@ public class AdminController {
|
||||
img.setSelecttype(selecttype);
|
||||
}
|
||||
}else{
|
||||
//普通用户
|
||||
img.setUserid(user.getId());
|
||||
}
|
||||
List<Images> images = imgService.selectimg(img);
|
||||
@@ -491,7 +490,6 @@ public class AdminController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
//工具函数
|
||||
private static String getChinaes(int v){
|
||||
String ch = "";
|
||||
switch(v){
|
||||
|
||||
@@ -97,8 +97,7 @@ public class AlbumController {
|
||||
|
||||
}
|
||||
|
||||
//后台列表要修改时的查询表单
|
||||
@PostMapping("/admin/getAlbumListForKey")
|
||||
@PostMapping("/admin/getAlbumListForKey")
|
||||
@ResponseBody
|
||||
public Msg getAlbumListForKey(@RequestParam(value = "data", defaultValue = "") String data){
|
||||
Msg msg = new Msg();
|
||||
@@ -214,8 +213,6 @@ public class AlbumController {
|
||||
String password = jsonObject.getString("password");
|
||||
JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("albumlist"));
|
||||
if(null!=password){
|
||||
// String regex = "^[a-z0-9A-Z\u4e00-\u9fa5]+$";
|
||||
// return str.matches(regex);
|
||||
password = password.replace(" ", "");
|
||||
if(password.replace(" ", "").equals("") || password.length()<3){
|
||||
msg.setCode("110403");
|
||||
|
||||
@@ -24,7 +24,6 @@ public class ExceptionHandling {
|
||||
ModelAndView modelAndView = new ModelAndView("index");
|
||||
Print.Normal("异常拦截成功:"+ ssie.getMessage());
|
||||
modelAndView.addObject("error",ssie.getMessage());
|
||||
//返回错误信息,并显示给用户
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
|
||||
@@ -282,12 +282,9 @@ public class IndexController {
|
||||
msg.setInfo("图像已不存在,删除成功");
|
||||
return msg;
|
||||
}
|
||||
//判断是不是自己的图片 因为这里的删除功能只能是首页上传后才会调用的接口 能删除的图片只能是自己的
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
User user = (User) subject.getPrincipal();
|
||||
if(null!=user){
|
||||
//由于integer类型的==比较方式适用于-128~127之间,所以超过这个范围就会不对
|
||||
// if(user.getId()!=image.getUserid()){
|
||||
if(!user.getId().equals(image.getUserid())){
|
||||
msg.setInfo("删除失败,该图片不允许你执行操作");
|
||||
msg.setCode("100403");
|
||||
|
||||
@@ -124,12 +124,12 @@ public class UserController {
|
||||
userService.register(user);
|
||||
}else{
|
||||
msg.setCode("110408");
|
||||
msg.setInfo("验证码不正确");//失效也要处理。
|
||||
msg.setInfo("验证码不正确");
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
@PostMapping("/login")//new
|
||||
@PostMapping("/login")
|
||||
@ResponseBody
|
||||
public Msg login(HttpServletRequest request,HttpSession httpSession,@RequestParam(value = "data", defaultValue = "") String data) {
|
||||
Msg msg = new Msg();
|
||||
@@ -176,7 +176,6 @@ public class UserController {
|
||||
msg.setData(jsonObject);
|
||||
return msg;
|
||||
} catch (UnknownAccountException e) {
|
||||
//此异常说明用户名不存在
|
||||
msg.setCode("4000");
|
||||
msg.setInfo("登录邮箱不存在");
|
||||
System.err.println("邮箱不存在");
|
||||
@@ -225,7 +224,7 @@ public class UserController {
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = "/logout")//new
|
||||
@PostMapping(value = "/logout")
|
||||
@ResponseBody
|
||||
public Msg exit(Model model, HttpServletRequest request, HttpServletResponse response, HttpSession session) {
|
||||
Msg msg = new Msg();
|
||||
@@ -236,7 +235,7 @@ public class UserController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@PostMapping("/retrievePass") //new
|
||||
@PostMapping("/retrievePass")
|
||||
@ResponseBody
|
||||
public Msg retrievePass(HttpServletRequest request,HttpSession httpSession, @RequestParam(value = "data", defaultValue = "") String data) {
|
||||
Msg msg = new Msg();
|
||||
@@ -296,7 +295,7 @@ public class UserController {
|
||||
return msg;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/retrieve", method = RequestMethod.GET) //new
|
||||
@RequestMapping(value = "/retrieve", method = RequestMethod.GET)
|
||||
public String retrieve(Model model, String activation,String cip) {
|
||||
Integer ret = 0;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user