feat(client): 实现跟卖精灵异步启动和Chrome驱动预加载- 在GenmaiServiceImpl中添加@Async注解实现异步启动跟卖精灵- 增加ChromeDriverPreloader组件预加载Chrome驱动- 添加AsyncConfig配置类启用异步支持
- 优化跟卖精灵启动提示信息和加载状态显示 - 移除Java代码中关于刷新令牌的相关逻辑和依赖- 更新版本号从2.5.5到2.5.6
This commit is contained in:
@@ -1,79 +0,0 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 刷新令牌对象 refresh_token
|
||||
*/
|
||||
public class RefreshToken extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 账号ID */
|
||||
private Long accountId;
|
||||
|
||||
/** 设备ID */
|
||||
private String deviceId;
|
||||
|
||||
/** 刷新令牌 */
|
||||
private String token;
|
||||
|
||||
/** 到期时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date expireTime;
|
||||
|
||||
/** 是否已撤销 */
|
||||
private String revoked;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public void setAccountId(Long accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Date getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(Date expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public String getRevoked() {
|
||||
return revoked;
|
||||
}
|
||||
|
||||
public void setRevoked(String revoked) {
|
||||
this.revoked = revoked;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import com.ruoyi.system.domain.RefreshToken;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 刷新令牌数据层
|
||||
*/
|
||||
public interface RefreshTokenMapper {
|
||||
|
||||
/**
|
||||
* 保存刷新令牌
|
||||
*/
|
||||
int insertRefreshToken(RefreshToken refreshToken);
|
||||
|
||||
/**
|
||||
* 根据令牌查找
|
||||
*/
|
||||
RefreshToken selectByToken(String token);
|
||||
|
||||
/**
|
||||
* 撤销账号的所有令牌
|
||||
*/
|
||||
int revokeByAccountId(Long accountId);
|
||||
|
||||
/**
|
||||
* 撤销设备的所有令牌
|
||||
*/
|
||||
int revokeByDeviceId(String deviceId);
|
||||
|
||||
/**
|
||||
* 删除过期令牌
|
||||
*/
|
||||
int deleteExpiredTokens();
|
||||
|
||||
/**
|
||||
* 更新令牌状态
|
||||
*/
|
||||
int updateRefreshToken(RefreshToken refreshToken);
|
||||
|
||||
/**
|
||||
* 根据账号ID删除令牌
|
||||
*/
|
||||
int deleteByAccountId(Long accountId);
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RefreshTokenMapper">
|
||||
|
||||
<resultMap type="RefreshToken" id="RefreshTokenResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="accountId" column="account_id"/>
|
||||
<result property="deviceId" column="device_id"/>
|
||||
<result property="token" column="token"/>
|
||||
<result property="expireTime" column="expire_time"/>
|
||||
<result property="revoked" column="revoked"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertRefreshToken" parameterType="RefreshToken" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into refresh_token
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="accountId != null">account_id,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="token != null">token,</if>
|
||||
<if test="expireTime != null">expire_time,</if>
|
||||
<if test="revoked != null">revoked,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="accountId != null">#{accountId},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="token != null">#{token},</if>
|
||||
<if test="expireTime != null">#{expireTime},</if>
|
||||
<if test="revoked != null">#{revoked},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="selectByToken" parameterType="String" resultMap="RefreshTokenResult">
|
||||
select id, account_id, device_id, token, expire_time, revoked, create_time, update_time
|
||||
from refresh_token
|
||||
where token = #{token} and revoked = '0'
|
||||
</select>
|
||||
|
||||
<update id="revokeByAccountId" parameterType="Long">
|
||||
update refresh_token set revoked = '1', update_time = sysdate()
|
||||
where account_id = #{accountId} and revoked = '0'
|
||||
</update>
|
||||
|
||||
<update id="revokeByDeviceId" parameterType="String">
|
||||
update refresh_token set revoked = '1', update_time = sysdate()
|
||||
where device_id = #{deviceId} and revoked = '0'
|
||||
</update>
|
||||
|
||||
<delete id="deleteExpiredTokens">
|
||||
delete from refresh_token
|
||||
where expire_time < sysdate() or revoked = '1'
|
||||
</delete>
|
||||
|
||||
<update id="updateRefreshToken" parameterType="RefreshToken">
|
||||
update refresh_token
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="revoked != null">revoked = #{revoked},</if>
|
||||
update_time = sysdate()
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByAccountId" parameterType="Long">
|
||||
delete from refresh_token where account_id = #{accountId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user