【v3.0.1】1、【新增】tomcat访问日志accessslog 最大保存天数;2、【新增】获取登录结果信息接口返回 Token;3、【新增】员工列表、表单 新增超级管理员标识;4、【优化】移除dev环境swagger用户名和密码;5、【优化】成功返回消息内容改为"操作成功";6、【优化】代码下载zip文件名改为 下划线,eg:t_apply_code.zip;7、【优化】Service代码生成自动Import;8、【优化】AdminInterpter 拦截器中对超级管理员放行;9、【优化】优化重复提交RepeatSubmitAspect;10、【优化】修改其他bug

This commit is contained in:
zhuoda 2024-03-18 22:35:07 +08:00
parent 27dffd9919
commit 1723f2514f
21 changed files with 85 additions and 22528 deletions

View File

@ -109,6 +109,11 @@ public class AdminInterceptor implements HandlerInterceptor {
return true;
}
// 如果是超级管理员的话不需要校验权限
if(requestEmployee.getAdministratorFlag()){
return true;
}
SaStrategy.instance.checkMethodAnnotation.accept(method);
} catch (SaTokenException e) {

View File

@ -24,7 +24,7 @@ public class ResponseDTO<T> {
public static final int OK_CODE = 0;
public static final String OK_MSG = "success";
public static final String OK_MSG = "操作成功";
@Schema(description = "返回码")
private Integer code;

View File

@ -87,7 +87,7 @@ public class CodeGeneratorController extends SupportBaseController {
ResponseDTO<byte[]> download = codeGeneratorService.download(tableName);
if (download.getOk()) {
SmartResponseUtil.setDownloadFileHeader(response, tableName + "-code.zip", (long) download.getData().length);
SmartResponseUtil.setDownloadFileHeader(response, tableName + "_code.zip", (long) download.getData().length);
response.getOutputStream().write(download.getData());
} else {
SmartResponseUtil.write(response, download);

View File

@ -55,22 +55,15 @@ public class RepeatSubmitAspect {
if (StringUtils.isEmpty(ticket)) {
return point.proceed();
}
Long timeStamp = this.repeatSubmitTicket.getTicketTimestamp(ticket);
if (timeStamp != null) {
Long lastRequestTime = this.repeatSubmitTicket.getTicketTimestamp(ticket);
if (lastRequestTime != null) {
Method method = ((MethodSignature) point.getSignature()).getMethod();
RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
// 说明注解去掉了
if (annotation != null) {
return point.proceed();
}
int interval = Math.min(annotation.value(), RepeatSubmit.MAX_INTERVAL);
if (System.currentTimeMillis() < timeStamp + interval) {
if (System.currentTimeMillis() < lastRequestTime + interval) {
// 提交频繁
return ResponseDTO.error(UserErrorCode.REPEAT_SUBMIT);
}
}
Object obj = null;
try {
@ -80,8 +73,6 @@ public class RepeatSubmitAspect {
} catch (Throwable throwable) {
log.error("", throwable);
throw throwable;
} finally {
this.repeatSubmitTicket.removeTicket(ticket);
}
return obj;
}

View File

@ -9,6 +9,7 @@ import net.lab1024.sa.base.common.domain.ResponseDTO;
import net.lab1024.sa.base.common.domain.PageResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

View File

@ -62,9 +62,9 @@ server:
basedir: ${project.log-directory}/tomcat-logs
accesslog:
enabled: true
max-days: 7
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"
# 文件上传 配置
file:
storage:
@ -81,7 +81,6 @@ file:
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
private-url-expire-seconds: 3600
# open api配置
springdoc:
swagger-ui:
@ -93,7 +92,7 @@ springdoc:
knife4j:
enable: true
basic:
enable: true
enable: false
username: api # Basic认证用户名
password: 1024 # Basic认证密码

View File

@ -62,6 +62,7 @@ server:
basedir: ${project.log-directory}/tomcat-logs
accesslog:
enabled: true
max-days: 7
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"

View File

@ -62,6 +62,7 @@ server:
basedir: ${project.log-directory}/tomcat-logs
accesslog:
enabled: true
max-days: 30
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"

View File

@ -62,6 +62,7 @@ server:
basedir: ${project.log-directory}/tomcat-logs
accesslog:
enabled: true
max-days: 7
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"

View File

@ -6,11 +6,12 @@
* @Copyright 1024创新实验室
-->
<template>
<a-modal title="更新日志" width="700px" :open="visibleFlag" @close="onClose" >
<a-modal title="更新日志" width="700px" :open="visibleFlag" @cancel="onClose">
<div>
<pre>{{ content }}</pre>
<div v-if="link">链接<a :href="link" target="_blank">{{ link }}</a></div>
<div v-if="link">
链接<a :href="link" target="_blank">{{ link }}</a>
</div>
</div>
<template #footer>
@ -18,7 +19,6 @@
<a-button type="primary" @click="onClose">关闭</a-button>
</a-space>
</template>
</a-modal>
</template>
<script setup>

View File

@ -16,6 +16,8 @@
@close="onClose"
destroyOnClose
>
<a-alert message="超管需要直接在数据库表 t_employee修改哦" type="error" closable />
<br />
<a-form ref="formRef" :model="form" :rules="rules" layout="vertical">
<a-form-item label="姓名" name="actualName">
<a-input v-model:value.trim="form.actualName" placeholder="请输入姓名" />
@ -63,7 +65,7 @@
import { GENDER_ENUM } from '/@/constants/common-const';
import { regular } from '/@/constants/regular-const';
import { SmartLoading } from '/@/components/framework/smart-loading';
import { smartSentry } from '/@/lib/smart-sentry';
import { smartSentry } from '/@/lib/smart-sentry';
// ----------------------- emits props ---------------------
const departmentTreeSelect = ref();
// emit

View File

@ -57,6 +57,9 @@
bordered
>
<template #bodyCell="{ text, record, index, column }">
<template v-if="column.dataIndex === 'administratorFlag'">
<a-tag color="error" v-if="text">超管</a-tag>
</template>
<template v-if="column.dataIndex === 'disabledFlag'">
<a-tag :color="text ? 'error' : 'processing'">{{ text ? '禁用' : '启用' }}</a-tag>
</template>
@ -152,6 +155,11 @@
dataIndex: 'loginName',
width: 100,
},
{
title: '超管',
dataIndex: 'administratorFlag',
width: 60,
},
{
title: '状态',
dataIndex: 'disabledFlag',

View File

@ -12,7 +12,7 @@
<div>
<div class="btn-group">
<a-button class="button-style" type="primary" @click="updateDataScope" v-privilege="'system:role:dataScope:update'"> 保存 </a-button>
<a-button class="button-style" @click="getDataScope" > 刷新 </a-button>
<a-button class="button-style" @click="getDataScope"> 刷新 </a-button>
</div>
<a-row class="header">
<a-col class="tab-margin" :span="4">业务单据</a-col>
@ -107,7 +107,7 @@
roleId: selectRoleId.value,
dataScopeItemList: selectedDataScopeList.value.filter((e) => !_.isUndefined(e.viewType)),
};
await roleApi.updateRoleDataScopeList(data);
await roleApi.updateDataScope(data);
message.success('保存成功');
getDataScope();
} catch (e) {

View File

@ -1,3 +1,3 @@
NODE_ENV=production
VITE_APP_TITLE='SmartH5 预发布环境(Pre)'
VITE_APP_API_URL='https://preview.smartadmin.vip/smart-admin-api'
VITE_APP_API_URL='https://app.smartadmin.vip/smart-app-api'

22463
smart-app/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,4 +15,8 @@
<style lang="scss">
@import '@/uni_modules/uni-scss/index.scss';
/* 设置基准字体大小为16px */
body {
font-size: 16px;
}
</style>

View File

@ -74,6 +74,9 @@
:deep(.uni-card__header) {
border: none;
}
:deep(.uni-card .uni-card__header .uni-card__header-content .uni-card__header-content-title) {
font-size: 32rpx;
}
:deep(.uni-list-item__container) {
padding: 16rpx 20rpx;
}
@ -81,10 +84,13 @@
background: linear-gradient(180deg, #e8f4ff, #f8fcff);
}
:deep(.uni-card__header-extra) {
font-size: 24rpx;
font-size: 30rpx;
font-weight: 400;
text-align: center;
color: #1a9aff;
}
:deep(.uni-list-item__content-title) {
font-size: 30rpx;
}
}
</style>

View File

@ -93,10 +93,15 @@
overflow: hidden;
box-shadow: 0 3px 4px 0 rgba(24, 144, 255, 0.06);
padding: 0 10rpx;
:deep(.uni-list-item__content-title) {
font-size: 30rpx;
}
:deep(.uni-list-item__extra-text) {
font-size: 28rpx;
}
.icon {
width: 42rpx;
height: 42rpx;
width: 56rpx;
height: 56rpx;
margin-right: 20rpx;
}
}

View File

@ -54,23 +54,23 @@
border-radius: 6px;
box-shadow: 0px 3px 4px 0px rgba(24, 144, 255, 0.06);
backdrop-filter: blur(5.98px);
padding: 20px 15px;
padding: 40rpx 30rpx;
display: flex;
flex-direction: row;
align-items: center;
.user-icon {
width: 58px;
height: 58px;
width: 120rpx;
height: 120rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 29px;
border-radius: 60rpx;
background-color: white;
.user-image {
width: 54px;
height: 54px;
border-radius: 27px;
width: 108rpx;
height: 108rpx;
border-radius: 54rpx;
}
}
.user-info {
@ -78,30 +78,30 @@
flex-direction: column;
align-items: flex-start;
flex-shrink: 0;
margin: 5px auto 0 12px;
margin: 10rpx auto 0 24rpx;
align-self: flex-start;
.user-name {
height: 25px;
font-size: 18px;
height: 50rpx;
font-size: 40rpx;
font-weight: 600;
text-align: center;
color: #323333;
}
.user-phone {
margin-top: 4px;
height: 20px;
font-size: 14px;
margin-top: 8rpx;
height: 40rpx;
font-size: 30rpx;
font-weight: 400;
text-align: left;
color: #777777;
line-height: 20px;
line-height: 40rpx;
}
}
.vip-flag {
align-self: flex-start;
width: 83px;
height: 29px;
margin: 3px 0 0 auto;
width: 170rpx;
height: 60rpx;
margin: 6rpx 0 0 auto;
image {
width: 100%;
height: 100%;

View File

@ -63,23 +63,21 @@
<style scoped lang="scss">
.user-info-box {
z-index: 10;
padding: 32px 12px 15px;
padding: 60rpx 24rpx 30rpx;
display: flex;
flex-direction: row;
align-items: center;
.user-icon {
width: 58px;
height: 58px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 29px;
border-radius: 60rpx;
background-color: white;
.user-image {
width: 54px;
height: 54px;
border-radius: 27px;
width: 120rpx;
height: 120rpx;
border-radius: 54rpx;
}
}
.user-info {
@ -87,23 +85,23 @@
flex-direction: column;
align-items: flex-start;
flex-shrink: 0;
margin: 5px auto 0 12px;
margin: 10rpx auto 0 24rpx;
align-self: flex-start;
.user-name {
height: 25px;
font-size: 18px;
height: 50rpx;
font-size: 40rpx;
font-weight: 600;
text-align: center;
color: #323333;
}
.user-phone {
margin-top: 4px;
height: 20px;
font-size: 14px;
margin-top: 8rpx;
height: 40rpx;
font-size: 30rpx;
font-weight: 400;
text-align: left;
color: #777777;
line-height: 20px;
line-height: 40rpx;
}
}
}
@ -163,8 +161,8 @@
}
.text {
font-size: 14px;
margin-top: 5px;
font-size: 30rpx;
margin-top: 10rpx;
}
.grid-item-box {
flex: 1;
@ -172,6 +170,6 @@
flex-direction: column;
align-items: center;
justify-content: center;
padding: 15px 0;
padding: 30rpx 0;
}
</style>

View File

@ -112,8 +112,6 @@ $collapse-bg-color: #F3F6FB; // 折叠面板二级背景颜色
// 颜色 ------------------- end -------------
// 样式 ------------------- begin -------------
// 这里导出的样式在APP端无效APP端不要再引用了
:export {