Merge remote-tracking branch 'ruoyi/master'

rf
tony 2023-03-02 20:31:19 +08:00
commit a4a12075e5
8 changed files with 29 additions and 28 deletions

View File

@ -34,10 +34,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND user_name like concat('%', #{userName}, '%') AND user_name like concat('%', #{userName}, '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(login_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') AND login_time &gt;= #{params.beginTime}
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(login_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d') AND login_time &lt;= #{params.endTime}
</if> </if>
</where> </where>
order by info_id desc order by info_id desc

View File

@ -56,10 +56,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND oper_name like concat('%', #{operName}, '%') AND oper_name like concat('%', #{operName}, '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') AND oper_time &gt;= #{params.beginTime}
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d') AND oper_time &lt;= #{params.endTime}
</if> </if>
</where> </where>
order by oper_id desc order by oper_id desc

View File

@ -15,9 +15,9 @@ export default {
url: url, url: url,
responseType: 'blob', responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() } headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(async (res) => { }).then((res) => {
const isLogin = await blobValidate(res.data); const isBlob = blobValidate(res.data);
if (isLogin) { if (isBlob) {
const blob = new Blob([res.data]) const blob = new Blob([res.data])
this.saveAs(blob, decodeURIComponent(res.headers['download-filename'])) this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
} else { } else {
@ -32,9 +32,9 @@ export default {
url: url, url: url,
responseType: 'blob', responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() } headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(async (res) => { }).then((res) => {
const isLogin = await blobValidate(res.data); const isBlob = blobValidate(res.data);
if (isLogin) { if (isBlob) {
const blob = new Blob([res.data]) const blob = new Blob([res.data])
this.saveAs(blob, decodeURIComponent(res.headers['download-filename'])) this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
} else { } else {
@ -49,9 +49,9 @@ export default {
url: url, url: url,
responseType: 'blob', responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() } headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(async (res) => { }).then((res) => {
const isLogin = await blobValidate(res.data); const isBlob = blobValidate(res.data);
if (isLogin) { if (isBlob) {
const blob = new Blob([res.data], { type: 'application/zip' }) const blob = new Blob([res.data], { type: 'application/zip' })
this.saveAs(blob, name) this.saveAs(blob, name)
} else { } else {

View File

@ -72,7 +72,7 @@ service.interceptors.response.use(res => {
// 获取错误信息 // 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default'] const msg = errorCode[code] || res.data.msg || errorCode['default']
// 二进制数据则直接返回 // 二进制数据则直接返回
if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){ if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
return res.data return res.data
} }
if (code === 401) { if (code === 401) {
@ -125,8 +125,8 @@ export function download(url, params, filename, config) {
responseType: 'blob', responseType: 'blob',
...config ...config
}).then(async (data) => { }).then(async (data) => {
const isLogin = await blobValidate(data); const isBlob = blobValidate(data);
if (isLogin) { if (isBlob) {
const blob = new Blob([data]) const blob = new Blob([data])
saveAs(blob, filename) saveAs(blob, filename)
} else { } else {

View File

@ -228,12 +228,6 @@ export function tansParams(params) {
} }
// 验证是否为blob格式 // 验证是否为blob格式
export async function blobValidate(data) { export function blobValidate(data) {
try { return data.type !== 'application/json'
const text = await data.text();
JSON.parse(text);
return false;
} catch (error) {
return true;
}
} }

View File

@ -38,11 +38,12 @@
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>

View File

@ -53,11 +53,12 @@
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>

View File

@ -433,7 +433,10 @@ create table sys_oper_log (
error_msg varchar(2000) default '' comment '错误消息', error_msg varchar(2000) default '' comment '错误消息',
oper_time datetime comment '操作时间', oper_time datetime comment '操作时间',
cost_time bigint(20) default 0 comment '消耗时间', cost_time bigint(20) default 0 comment '消耗时间',
primary key (oper_id) primary key (oper_id),
key idx_sys_oper_log_bt (business_type),
key idx_sys_oper_log_s (status),
key idx_sys_oper_log_ot (oper_time)
) engine=innodb auto_increment=100 comment = '操作日志记录'; ) engine=innodb auto_increment=100 comment = '操作日志记录';
@ -562,7 +565,9 @@ create table sys_logininfor (
status char(1) default '0' comment '登录状态0成功 1失败', status char(1) default '0' comment '登录状态0成功 1失败',
msg varchar(255) default '' comment '提示消息', msg varchar(255) default '' comment '提示消息',
login_time datetime comment '访问时间', login_time datetime comment '访问时间',
primary key (info_id) primary key (info_id),
key idx_sys_logininfor_s (status),
key idx_sys_logininfor_lt (login_time)
) engine=innodb auto_increment=100 comment = '系统访问记录'; ) engine=innodb auto_increment=100 comment = '系统访问记录';