修改
This commit is contained in:
@ -1,18 +1,17 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
|
||||
import com.ruoyi.wgz.bo.WgzUserQueryBo;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserLongInReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppUserRegisterReq;
|
||||
@ -21,7 +20,6 @@ import com.ruoyi.wgz.common.SnowflakeIdUtil;
|
||||
import com.ruoyi.wgz.domain.WgzUser;
|
||||
import com.ruoyi.wgz.mapper.WgzUserMapper;
|
||||
import com.ruoyi.wgz.service.IWgzUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -40,8 +38,8 @@ import java.util.Map;
|
||||
@Service
|
||||
public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser> implements IWgzUserService {
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
// @Autowired
|
||||
// private TokenService tokenService;
|
||||
|
||||
@Override
|
||||
public WgzUser queryById(String id){
|
||||
@ -144,22 +142,22 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
|
||||
throw new RuntimeException("密码错误!");
|
||||
}
|
||||
//4、创建token返回wgzUser
|
||||
String token = tokenService.createToken(wgzUser);
|
||||
WgzAppUserLongInRes res = new WgzAppUserLongInRes();
|
||||
res.setToken(token);
|
||||
// String token = tokenService.createToken(wgzUser);
|
||||
// WgzAppUserLongInRes res = new WgzAppUserLongInRes();
|
||||
// res.setToken(token);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String createToken(WgzUser wu) {
|
||||
String token = IdUtil.fastUUID();
|
||||
loginUser.setToken(token);
|
||||
setUserAgent(loginUser);
|
||||
refreshToken(loginUser);
|
||||
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put(Constants.LOGIN_USER_KEY, token);
|
||||
return createToken(claims);
|
||||
}
|
||||
// public String createToken(WgzUser wu) {
|
||||
// String token = IdUtil.fastUUID();
|
||||
// loginUser.setToken(token);
|
||||
// setUserAgent(loginUser);
|
||||
// refreshToken(loginUser);
|
||||
//
|
||||
// Map<String, Object> claims = new HashMap<>();
|
||||
// claims.put(Constants.LOGIN_USER_KEY, token);
|
||||
// return createToken(claims);
|
||||
// }
|
||||
}
|
||||
|
Reference in New Issue
Block a user