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

This commit is contained in:
Hellohao
2019-06-17 22:31:01 +08:00
parent d80b63f424
commit 86f2b266ce
5 changed files with 51 additions and 15 deletions
@@ -10,6 +10,7 @@ import cn.hellohao.service.impl.USSImageupload;
import cn.hellohao.utils.Sentence;
import cn.hellohao.utils.SetText;
import cn.hellohao.utils.StringUtils;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@@ -187,6 +188,24 @@ public class UpdateImgController {
return jsonArray.toString();
}
//ajax查询用户是否已经登录
@RequestMapping(value = "/islogin")
@ResponseBody
public String islogin(HttpSession session) {
JSONObject jsonObject = new JSONObject();
User user = (User) session.getAttribute("user");
if(user!=null){
if (user.getEmail() != null && user.getPassword() != null) {
jsonObject.put("username",user.getUsername());
jsonObject.put("level",user.getLevel());
jsonObject.put("lgoinret",1);
}else{
jsonObject.put("lgoinret",0);
}
}
return jsonObject.toString();
}
@RequestMapping("/err")
public String err() {
return "err";
@@ -143,4 +143,5 @@ public class UserController {
}
}