|
@@ -6,7 +6,10 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import cn.com.usky.iot.auth.TokenAuthBO;
|
|
|
import cn.com.usky.iot.auth.TokenAuthService;
|
|
|
+import cn.com.usky.iot.controller.login.Constants;
|
|
|
+import cn.com.usky.iot.entity.YtiotTAdmin;
|
|
|
import cn.com.usky.utils.HttpServletRequestUtils;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import org.apache.tools.ant.taskdefs.condition.Http;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -53,16 +56,24 @@ public class FrontpageController {
|
|
|
@RequestParam(value = "queryJson", required = false) String queryJson,
|
|
|
HttpServletRequest request
|
|
|
) {
|
|
|
- TokenAuthBO tokenAuthBO = HttpServletRequestUtils.tokenAuthForPC(request, tokenAuthService);
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+
|
|
|
+ TokenAuthBO tokenAuthBO = HttpServletRequestUtils.tokenAuthForYT(request, tokenAuthService);
|
|
|
boolean isAuth = tokenAuthBO.isAuthState();
|
|
|
if (!isAuth) {
|
|
|
-
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("check", false);
|
|
|
+ json.put("errMsg", "权限错误,请重新登录");
|
|
|
+ mav.addObject("ret_str", json.toJSONString());
|
|
|
}
|
|
|
-
|
|
|
- ModelAndView mav = new ModelAndView();
|
|
|
mav.setViewName("return");
|
|
|
+ //通过获取用户信息
|
|
|
+ YtiotTAdmin o = (YtiotTAdmin) tokenAuthBO.getData().get(Constants.USER_INFO);
|
|
|
+ net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(queryJson);
|
|
|
+ jsonObject.put("V_LOGINNAME", o.getVLoginname());
|
|
|
+ jsonObject.put("V_PASSWORD", o.getVPassword());
|
|
|
try {
|
|
|
- String ret = frontpageController.ytiotFrontpageQueryService.getCurrentObjectListByCompanyId(queryJson);
|
|
|
+ String ret = frontpageController.ytiotFrontpageQueryService.getCurrentObjectListByCompanyId(jsonObject.toString());
|
|
|
mav.addObject("ret_str", ret);
|
|
|
} catch (Exception e) {
|
|
|
// TODO Auto-generated catch block
|