diff --git a/front/src/utils/i18n/languages/en-us.js b/front/src/utils/i18n/languages/en-us.js
index ead16bf2c661601be5881542e2caa1082b47ece8..1c76df4c69c4cf19921342a8e6b06d977bb647ce 100644
--- a/front/src/utils/i18n/languages/en-us.js
+++ b/front/src/utils/i18n/languages/en-us.js
@@ -221,6 +221,10 @@ export default {
'shareUrl': 'Share Url',
'shareDoc': 'Share Doc',
'shareStyle': 'Share Style',
+ 'expirationTime': 'Expiration Time',
+ 'permanentValidity': 'Permanent Validity',
+ 'permanentValidityTip': 'Leave empty for perpetual validity',
+ 'expirationTimePicker': 'Please Pick a day',
'encryption': 'Encryption',
'deleteRowConfirm': 'Delete record?',
'remark': 'Remark',
diff --git a/front/src/utils/i18n/languages/zh-cn.js b/front/src/utils/i18n/languages/zh-cn.js
index acc6f5c5dffb4381ba7cc19d9b519711bed421c3..f1d3676e73b028524c10eb9a107250017bbbe1da 100644
--- a/front/src/utils/i18n/languages/zh-cn.js
+++ b/front/src/utils/i18n/languages/zh-cn.js
@@ -218,6 +218,10 @@ export default {
'shareUrl': '分享链接',
'shareDoc': '分享文档',
'shareStyle': '分享形式',
+ 'expirationTime': '过期时间',
+ 'permanentValidity': '永久有效',
+ 'permanentValidityTip': '留空表示永不过期',
+ 'expirationTimePicker': '请选择日期',
'encryption': '加密',
'deleteRowConfirm': '确定要删除此记录吗',
'remark': '备注',
diff --git a/front/src/views/project/ShareConfig/index.vue b/front/src/views/project/ShareConfig/index.vue
index 4e5c528281930c51dc0e7e9a4942a0635600588f..af1196b3bd2c1fa7f7fcce1ae477adae07b71603 100644
--- a/front/src/views/project/ShareConfig/index.vue
+++ b/front/src/views/project/ShareConfig/index.vue
@@ -31,7 +31,12 @@
{{ $t('encryption') }}
-
+
+
+ {{ scope.row.expirationTime ? scope.row.expirationTime : $t('permanentValidity') }}
+
+
+
{{ $t('enable') }}
@@ -59,10 +64,14 @@
>
{{ $t('update') }}
-
+
{{ $t('disable') }}
- {{ $t('enable') }}
+ {{
+ $t('enable')
+ }}
+
-
+
@@ -110,6 +119,20 @@
{{ $t('encryption') }}
+
+
+ {{ $t('expirationTime') }}
+
+
+
+
+
+
{{ $t('partDocs') }}
@@ -127,11 +150,14 @@
{{ $t('selectAll') }}
- {{ env.name }}
+ {{
+ env.name
+ }}
+
-
+
@@ -152,10 +178,8 @@
import DocTree from '@/components/DocTree'
export default {
- components: { DocTree },
- props: {
-
- },
+ components: {DocTree},
+ props: {},
data() {
return {
moduleId: '',
@@ -175,6 +199,7 @@ export default {
dialogFormData: {
id: '',
type: 1,
+ expirationTime: '',
moduleId: '',
isAll: 0,
remark: '',
@@ -183,7 +208,11 @@ export default {
},
autoAppend: 1,
moduleEnvironmentList: [],
- dialogFormRules: {
+ dialogFormRules: {},
+ pickerOptions: {
+ disabledDate(time) {
+ return time.getTime() < Date.now() - 8.64e7; // Disable dates before today
+ }
}
}
},
@@ -223,6 +252,7 @@ export default {
this.dialogFormData = {
id: '',
type: 1,
+ expirationTime: '',
isShowDebug: 0,
moduleId: '',
isAll: 0,
@@ -235,13 +265,13 @@ export default {
})
},
loadDebugEnvs(moduleId, shareConfigId) {
- this.get('/module/environment/list', { moduleId: moduleId }, resp => {
+ this.get('/module/environment/list', {moduleId: moduleId}, resp => {
this.moduleEnvironmentList = resp.data
})
if (!shareConfigId) {
return
}
- this.get('/doc/share/listEnvironment', { id: shareConfigId }, resp => {
+ this.get('/doc/share/listEnvironment', {id: shareConfigId}, resp => {
this.$set(this.dialogFormData, 'moduleEnvironmentIdList', resp.data.map(item => item.moduleEnvironmentId))
})
},
@@ -263,7 +293,7 @@ export default {
}
if (!row.isAll) {
- this.get('/doc/share/listShareDocIds', { id: row.id }, resp => {
+ this.get('/doc/share/listShareDocIds', {id: row.id}, resp => {
const contentList = resp.data
// 所有的文档id
const idList = contentList.map(row => row.docId)
@@ -378,7 +408,7 @@ export default {
viewDoc(row) {
this.dialogViewVisible = true
this.$nextTick(() => {
- this.get('/doc/share/listShareDocIds', { id: row.id }, resp => {
+ this.get('/doc/share/listShareDocIds', {id: row.id}, resp => {
const contentList = resp.data
const idList = contentList.map(row => row.docId)
this.reloadDocTreeView(treeData => {
diff --git a/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java b/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java
index 05fca1393e4857d0ad086bc49a925d03d4a32c34..e0e27e94c51dc8ccef5ee2be2bb6c68ae5f7f121 100644
--- a/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java
+++ b/server/server-dao/src/main/java/cn/torna/dao/entity/ShareConfig.java
@@ -5,6 +5,7 @@ import com.gitee.fastmybatis.annotation.PkStrategy;
import com.gitee.fastmybatis.annotation.Table;
import lombok.Data;
+import java.time.LocalDate;
import java.time.LocalDateTime;
@@ -27,6 +28,9 @@ public class ShareConfig {
/** 密码, 数据库字段:password */
private String password;
+ /** 过期时间 null:永久有效 数据库字段:expiration_time */
+ private LocalDate expirationTime;
+
/** 状态,1:有效,0:无效, 数据库字段:status */
private Byte status;
diff --git a/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java b/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java
index d091e49b8f6953de7873d048d7ac5986fe0ea002..d480232d33a8ec28df22baa2117ff4c6b30a3b02 100644
--- a/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java
+++ b/server/server-service/src/main/java/cn/torna/service/ShareConfigService.java
@@ -64,6 +64,8 @@ public class ShareConfigService extends BaseService childIdList = docInfoService.list(query);
idList.addAll(childIdList.stream().map(DocInfo::getId).collect(Collectors.toList()));
// 递归获取子文件夹下的文件内容
- addChildFoldersAndFiles(idList, childIdList.stream().filter(doc->doc.getIsFolder().equals(Booleans.TRUE)).map(DocInfo::getId).collect(Collectors.toList()));
+ addChildFoldersAndFiles(idList, childIdList.stream().filter(doc -> doc.getIsFolder().equals(Booleans.TRUE)).map(DocInfo::getId).collect(Collectors.toList()));
}
}
return idList;