| | |
| | | package com.panzhihua.sangeshenbian.api; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.controller.BaseController; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; |
| | | import com.panzhihua.common.service.auth.TokenService; |
| | | import com.panzhihua.common.utlis.HttpClientUtil; |
| | | import com.panzhihua.common.utlis.ServletUtils; |
| | | import com.panzhihua.sangeshenbian.annotation.SysLog; |
| | | import com.panzhihua.sangeshenbian.model.entity.*; |
| | | import com.panzhihua.sangeshenbian.model.vo.RegionVO; |
| | | import com.panzhihua.sangeshenbian.service.*; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.security.MessageDigest; |
| | | import java.text.MessageFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | @Resource |
| | | private IComActService comActService; |
| | | |
| | | @Resource |
| | | private ISystemLogService systemLogService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/login") |
| | | @ApiOperation(value = "登录", tags = {"三个身边后台-登录"}) |
| | | @OperLog(operModul = "三个身边后台",operType = 0,businessType = "登录") |
| | | @SysLog(operatorCategory = "登录") |
| | | public R<TokenVo> login(@RequestBody LoginVo vo){ |
| | | String key = "login:" + vo.getPhone(); |
| | | Integer size = (Integer) redisTemplate.opsForValue().get(key); |
| | |
| | | LoginReturnVO loginReturnVO = reult.getData(); |
| | | TokenVo tokenVo = new TokenVo(); |
| | | BeanUtils.copyProperties(loginReturnVO, tokenVo); |
| | | tokenVo.setUserId(Long.valueOf(systemUser.getId())); |
| | | |
| | | List<SystemRoleMenu> list = systemRoleMenuService.list(new LambdaQueryWrapper<SystemRoleMenu>().eq(SystemRoleMenu::getSystemRoleId, systemUser.getSystemRoleId())); |
| | | List<Integer> collect = list.stream().map(SystemRoleMenu::getSystemMenuId).collect(Collectors.toList()); |