Skip to content

Commit

Permalink
v3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuoda committed Mar 18, 2024
1 parent de91535 commit 526557e
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 22,528 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
return true;
}

// 如果是超级管理员的话,不需要校验权限
if(requestEmployee.getAdministratorFlag()){
return true;
}

SaStrategy.instance.checkMethodAnnotation.accept(method);

} catch (SaTokenException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void download(@PathVariable String tableName, HttpServletResponse respons
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,15 @@ public Object around(ProceedingJoinPoint point) throws Throwable {
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 {
Expand All @@ -80,8 +73,6 @@ public Object around(ProceedingJoinPoint point) throws Throwable {
} catch (Throwable throwable) {
log.error("", throwable);
throw throwable;
} finally {
this.repeatSubmitTicket.removeTicket(ticket);
}
return obj;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions smart-admin-api/sa-base/src/main/resources/dev/sa-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -93,7 +92,7 @@ springdoc:
knife4j:
enable: true
basic:
enable: true
enable: false
username: api # Basic认证用户名
password: 1024 # Basic认证密码

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
* @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>
<a-space>
<a-button type="primary" @click="onClose">关闭</a-button>
</a-space>
</template>

</a-modal>
</template>
<script setup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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="请输入姓名" />
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -152,6 +155,11 @@
dataIndex: 'loginName',
width: 100,
},
{
title: '超管',
dataIndex: 'administratorFlag',
width: 60,
},
{
title: '状态',
dataIndex: 'disabledFlag',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion smart-app/.env.pre
Original file line number Diff line number Diff line change
@@ -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'
Loading

0 comments on commit 526557e

Please sign in to comment.