|
@@ -1,6 +1,7 @@
|
|
|
package com.template.controller;
|
|
package com.template.controller;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
import com.github.pagehelper.util.StringUtil;
|
|
@@ -11,6 +12,8 @@ import com.template.api.WechatScanLoginControllerAPI;
|
|
|
import com.template.common.constanst.Constanst;
|
|
import com.template.common.constanst.Constanst;
|
|
|
import com.template.common.result.ResponseStatusEnum;
|
|
import com.template.common.result.ResponseStatusEnum;
|
|
|
import com.template.common.utils.*;
|
|
import com.template.common.utils.*;
|
|
|
|
|
+import com.template.model.evaluate.student.SmartEvaluateStudent;
|
|
|
|
|
+import com.template.model.pojo.SmartAuthority;
|
|
|
import com.template.model.pojo.SmartUser;
|
|
import com.template.model.pojo.SmartUser;
|
|
|
import com.template.model.result.CommonResult;
|
|
import com.template.model.result.CommonResult;
|
|
|
import com.template.model.result.PageUtils;
|
|
import com.template.model.result.PageUtils;
|
|
@@ -19,6 +22,8 @@ import com.template.model.vo.LoginVO;
|
|
|
import com.template.model.weixin.AccessToken;
|
|
import com.template.model.weixin.AccessToken;
|
|
|
import com.template.model.weixin.HttpParame;
|
|
import com.template.model.weixin.HttpParame;
|
|
|
import com.template.model.weixin.WechatUserUnionID;
|
|
import com.template.model.weixin.WechatUserUnionID;
|
|
|
|
|
+import com.template.services.SmartAuthorGroupService;
|
|
|
|
|
+import com.template.services.SmartAuthorityService;
|
|
|
import com.template.services.SmartUserService;
|
|
import com.template.services.SmartUserService;
|
|
|
import com.template.services.WechatScanLoginService;
|
|
import com.template.services.WechatScanLoginService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -52,6 +57,10 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
|
|
|
private WechatScanLoginService wechatScanLoginService;
|
|
private WechatScanLoginService wechatScanLoginService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
public SmartUserService smartUserService;
|
|
public SmartUserService smartUserService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ public SmartAuthorityService smartAuthorityService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ public SmartAuthorGroupService smartAuthorGroupService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Title: list
|
|
* Title: list
|
|
@@ -100,7 +109,15 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
|
|
|
return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("请绑定信息", "UTF-8");
|
|
return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("请绑定信息", "UTF-8");
|
|
|
} else {
|
|
} else {
|
|
|
String token = JWTUtil.getToken(user);
|
|
String token = JWTUtil.getToken(user);
|
|
|
- return "redirect:"+HttpParame.FRONT_URI+"/#/wanzai/home?token=" + token;
|
|
|
|
|
|
|
+ QueryWrapper<SmartAuthority> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper1.eq("deleted", 0);
|
|
|
|
|
+ queryWrapper1.eq("user_id", user.getId());
|
|
|
|
|
+ List<SmartAuthority> query = smartAuthorityService.getAuthorByKey(queryWrapper1);
|
|
|
|
|
+ if (query.size()>0){
|
|
|
|
|
+ return "redirect:"+HttpParame.FRONT_URI+"/#/wanzai/home?token=" + token;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("无登录权限", "UTF-8");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -152,7 +169,15 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
|
|
|
int m = wechatScanLoginService.updateSmartUser(userc);
|
|
int m = wechatScanLoginService.updateSmartUser(userc);
|
|
|
if (m>0){
|
|
if (m>0){
|
|
|
String token = JWTUtil.getToken(userc);
|
|
String token = JWTUtil.getToken(userc);
|
|
|
- return "redirect:"+HttpParame.FRONT_URI+"/#/wanzai/home?token=" + token;
|
|
|
|
|
|
|
+ QueryWrapper<SmartAuthority> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper1.eq("deleted", 0);
|
|
|
|
|
+ queryWrapper1.eq("user_id", userc.getId());
|
|
|
|
|
+ List<SmartAuthority> query = smartAuthorityService.getAuthorByKey(queryWrapper1);
|
|
|
|
|
+ if (query.size()>0){
|
|
|
|
|
+ return "redirect:"+HttpParame.FRONT_URI+"/#/wanzai/home?token=" + token;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return "redirect:"+HttpParame.FRONT_URI+"/#/login?message=" + URLEncoder.encode("无登录权限", "UTF-8");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|