Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions apps/backend/src/jobs/transferFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,16 @@ const transferFileWorker: Processor<TransferFileJobData, TransferFileJobResponse
})
}

// 判断分享链接是否过期
if (dayjs(share_link.ctime).add(1, 'year').isBefore(dayjs())) {
return status(500, {
message: '转存文件失败: 分享链接已过期, 请联系管理员',
data: null,
})
// 取出当前分享链接的用户的信息
const keyUserData = share_link.tkbind_list.find(item => item.uk === userInfo.response.data.uk)
if (keyUserData) {
// 判断分享链接是否过期
if (dayjs(keyUserData.ctime * 1000).add(1, 'year').isBefore(dayjs())) {
return status(500, {
message: '转存文件失败: 分享链接已过期, 请联系管理员',
data: null,
})
}
}

// 更新卡密的过期时间
Expand Down
4 changes: 3 additions & 1 deletion apps/frontend-vue/src/hooks/useProSearchFormPlus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface UseProSearchFormPlusOptions<T extends object> {
/** 搜索表单卡片标题 */
title?: string
searchFormItemStyle?: string
formProps?: Omit<ProSearchFormPlusProps<T>, 'columns' | 'rules' | 'initValues' | 'value' | 'onUpdate:value'>
}

export interface ProSearchFormPlusReturn<T extends object> {
Expand All @@ -28,7 +29,7 @@ export interface ProSearchFormPlusReturn<T extends object> {
}

export function useProSearchFormPlus<T extends object>(options: UseProSearchFormPlusOptions<T>): ProSearchFormPlusReturn<T> {
const { columns, initValues, rules, title, searchFormItemStyle } = options
const { columns, initValues, rules, title, searchFormItemStyle, formProps } = options

const formValues = ref(structuredClone(initValues))
const computedColumns = computed(() => columns())
Expand All @@ -47,6 +48,7 @@ export function useProSearchFormPlus<T extends object>(options: UseProSearchForm
'rules': computedRules.value,
'title': title ?? '搜索',
searchFormItemStyle,
...formProps,
})),
formValues,
rules: computedRules,
Expand Down
7 changes: 7 additions & 0 deletions apps/frontend-vue/src/stores/Admin/accountsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useAsyncJob } from '@frontend/hooks/useAsyncJob.ts'
import { useProDataTablePlus } from '@frontend/hooks/useProDataTablePlus.ts'
import { useProModalForm } from '@frontend/hooks/useProModalForm.ts'
import { useRouteQueryWatcher } from '@frontend/hooks/useRouteQueryWatcher.ts'
import { router } from '@frontend/router/index.ts'
import { copyText } from '@frontend/utils/copyText.ts'
import { dialog, notification } from '@frontend/utils/discreteApi.ts'
import { renderIcon } from '@frontend/utils/renderIcon.ts'
Expand Down Expand Up @@ -303,6 +304,12 @@ export const useAccountsStore = defineStore('admin_accounts', () => {
},
],
initValues: {},
formProps: {
onReset() {
router.replace({ query: {} })
accountSearchFormValues.value.id = undefined
},
},
},
)

Expand Down
6 changes: 6 additions & 0 deletions apps/frontend-vue/src/stores/Admin/shareLinksStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ export const useShareLinksStore = defineStore('admin_share_links', () => {
},
],
initValues: {},
formProps: {
onReset() {
router.replace({ query: {} })
shareLinkSearchFormValues.value.id = undefined
},
},
},
)

Expand Down
4 changes: 4 additions & 0 deletions apps/frontend-vue/src/stores/User/downloadTicketStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export const useDownloadTicketStore = defineStore('user_download_ticket', () =>
const { url, pwd } = parseBaiduShareLink(fileListSearchFormValues.value.surl)
if (url !== '') {
fileListSearchFormValues.value.surl = url
fileListSearchFormValues.value.dir = '/'
}
if (pwd !== '') {
fileListSearchFormValues.value.pwd = pwd
Expand All @@ -148,6 +149,9 @@ export const useDownloadTicketStore = defineStore('user_download_ticket', () =>
surl: '',
dir: '/',
},
formProps: {
hideResetButton: true,
},
title: '分享链接信息',
searchFormItemStyle: 'width: 100% !important;',
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bdwp-ts",
"version": "0.0.1",
"version": "0.0.2",
"scripts": {
"dev": "monorepo-commander dev apps/backend,apps/frontend-vue",
"typecheck": "bun run --workspaces typecheck",
Expand Down
Loading