|
@@ -6,12 +6,12 @@ import java.util.Objects;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
+import com.rtrh.projects.modules.rolemeun.dao.SecRoleMeunDao;
|
|
|
import com.rtrh.projects.modules.rolemeun.po.SecRole;
|
|
|
+import com.rtrh.projects.modules.rolemeun.po.SecRoleMeun;
|
|
|
+import com.rtrh.projects.web.util.JwtUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import com.rtrh.common.modules.vcode.VCodeManager;
|
|
|
import com.rtrh.common.modules.vcode.exception.VCodeFailException;
|
|
@@ -105,6 +105,53 @@ public class AuthApiController extends BaseOutApiController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 工信局切换发改委登录验证
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @TokenAuthenticate(AuthenticateType.NONE)
|
|
|
+ @GetMapping("gxjLogin")
|
|
|
+ public JsonResult gxjLogin(@RequestParam String token) {
|
|
|
+ JsonResult result = new JsonResult();
|
|
|
+ try {
|
|
|
+ //对token进行解密得到用户名
|
|
|
+ String username = JwtUtil.validateToken(token);
|
|
|
+ CommUser commUser = commUserService.findCommUserByLoginname(username);
|
|
|
+ if(null == commUser){
|
|
|
+ result.setCode(ResultCode.LOGIN_FAIL);
|
|
|
+ }
|
|
|
+ if(CommUserChecker.isDisabledUser(commUser)){
|
|
|
+ result.setCode(ResultCode.ACCOUNT_DISABLE);
|
|
|
+ }
|
|
|
+ SecUser user = secUserService.getById(commUser.getId());
|
|
|
+ String tokenApp = jwtUtils.createToken(user);
|
|
|
+ result.setData("token",tokenApp);
|
|
|
+
|
|
|
+ Boolean isLead=user.getIsLead()==null?false:user.getIsLead();
|
|
|
+
|
|
|
+ String roleCode="";
|
|
|
+ SecRole role=secRoleservice.getById(user.getKind());
|
|
|
+ if(null!=role){
|
|
|
+ roleCode=role.getCode();
|
|
|
+ result.setData("roleCode",roleCode);
|
|
|
+ if(roleCode.equals("001")){
|
|
|
+ result.setData("kind","2");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isLead&&"1".equals(user.getKindUnit())){
|
|
|
+ result.setData("kind","3");
|
|
|
+ }else{
|
|
|
+ result.setData("kind",user.getKindUnit());
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("", e);
|
|
|
+ result.setCode(ResultCode.SYSTEM_ERROR, e.getMessage());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@TokenAuthenticate
|
|
|
@PostMapping("outLogin")
|
|
|
public JsonResult outLogin() {
|