mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
6-17更新 新增又拍云存储
This commit is contained in:
@@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user