Skip to content

Commit

Permalink
fix:issue #103
Browse files Browse the repository at this point in the history
  • Loading branch information
vastsa committed Oct 26, 2023
1 parent 206c37f commit f6cbec5
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 93 deletions.
2 changes: 1 addition & 1 deletion apps/admin/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


async def admin_required(authorization: Union[str, None] = Header(default=None), request: Request = None):
is_admin = authorization == settings.admin_token
is_admin = authorization == str(settings.admin_token)
if request.url.path.startswith('/share/'):
if not settings.openUpload and not is_admin:
raise HTTPException(status_code=403, detail='本站未开启游客上传,如需上传请先登录后台')
Expand Down
2 changes: 2 additions & 0 deletions fcb-fronted/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ declare module 'vue' {
CardTools: typeof import('./src/components/CardTools.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCol: typeof import('element-plus/es')['ElCol']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDialog: typeof import('element-plus/es')['ElDialog']
Expand Down
1 change: 1 addition & 0 deletions fcb-fronted/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.card {
max-width: 400px;
min-width: 398px;
height: 100%;
background-color: #F8FBFE;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
Expand Down
88 changes: 44 additions & 44 deletions fcb-fronted/src/locals/en.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
export default {
send: {
'mzsm':'Disclaimers',
'alert':'According to the relevant provisions of the Cybersecurity Law of the People\'s Republic of China, the Criminal Law of the People\'s Republic of China, the Law on Public Security Administration Punishments of the People\'s Republic of China, and other relevant regulations, the dissemination or storage of illegal or irregular content may be subject to corresponding penalties, and those who commit serious offenses will bear criminal responsibility. Please refrain from uploading illegal files. This website firmly cooperates with relevant departments to ensure the security and harmony of online content, and to create a green cyber environment.',
'prompt1': 'Drag and drop text or files here, or ',
'prompt2': 'Days <7 or limited times (deleted after 24h)',
'prompt3': 'Please enter the text you want to send',
'share': 'Share',
'textShare': 'Text Share',
'clickUpload': 'Click to upload',
'pleaseInputExpireValue': 'Please enter expiration value',
'expireStyle': 'Expiration style',
'expireData': {
'day': 'Days',
'hour': 'Hours',
'forever': 'Forever',
'minute': 'Minutes',
'count': 'Times'
mzsm:'Disclaimers',
alert:'According to the relevant provisions of the Cybersecurity Law of the People\'s Republic of China, the Criminal Law of the People\'s Republic of China, the Law on Public Security Administration Punishments of the People\'s Republic of China, and other relevant regulations, the dissemination or storage of illegal or irregular content may be subject to corresponding penalties, and those who commit serious offenses will bear criminal responsibility. Please refrain from uploading illegal files. This website firmly cooperates with relevant departments to ensure the security and harmony of online content, and to create a green cyber environment.',
prompt1: 'Drag and drop text or files here, or ',
prompt2: 'Days <7 or limited times (deleted after 24h)',
prompt3: 'Please enter the text you want to send',
share: 'Share',
textShare: 'Text Share',
clickUpload: 'Click to upload',
pleaseInputExpireValue: 'Please enter expiration value',
expireStyle: 'Expiration style',
expireData: {
day: 'Days',
hour: 'Hours',
forever: 'Forever',
minute: 'Minutes',
count: 'Times'
},
'expireValue': {
'day': 'Days',
'hour': 'Hours',
'minute': 'Minutes',
'count': 'Times'
expireValue: {
day: 'Days',
hour: 'Hours',
minute: 'Minutes',
count: 'Times'
},
'fileType': {
'file': 'File',
'text': 'Text'
fileType: {
file: 'File',
text: 'Text'
}
},
fileBox: {
Expand All @@ -42,8 +42,8 @@ export default {
},
admin:{
about:{
'source1':'This project is open source on Github: ',
'source2':'FileCodeBox'
source1:'This project is open source on Github: ',
source2:'FileCodeBox'
},
settings: {
name: 'Website Name',
Expand All @@ -54,16 +54,16 @@ export default {
uploadSize: 'File Size',
uploadSizeNote: 'Maximum file size, unit: (bit), 1mb = 1 * 1024 * 1024',
openUpload: {
'title': 'Enable Upload',
'open': 'Enable Guest Upload',
'close': 'Disable Guest Upload',
'note': 'After disabling, login to the backend is required for uploading.',
title: 'Enable Upload',
open: 'Enable Guest Upload',
close: 'Disable Guest Upload',
note: 'After disabling, login to the backend is required for uploading.',
},
file_storage: {
'title': 'Storage Engine',
'local': 'Local Storage',
's3': 'S3 Storage',
'note': 'FileCodeBox needs to be restarted after updating.',
title: 'Storage Engine',
local: 'Local Storage',
s3: 'S3 Storage',
note: 'FileCodeBox needs to be restarted after updating.',
},
mei: 'Every',
minute: 'Minutes',
Expand All @@ -88,18 +88,18 @@ export default {
delete: 'Delete',
},
menu: {
'fileManage': 'File Management',
'systemSetting': 'System Settings',
'about': 'About Us',
'color': 'Color Mode',
'signout': 'Sign Out',
fileManage: 'File Management',
systemSetting: 'System Settings',
about: 'About Us',
color: 'Color Mode',
signout: 'Sign Out',
},
login: {
'managePassword': 'Admin Password',
'passwordNotEmpty': 'Password cannot be empty',
'login': 'Login',
'loginSuccess': 'Login successful',
'loginError': 'Login failed',
managePassword: 'Admin Password',
passwordNotEmpty: 'Password cannot be empty',
login: 'Login',
loginSuccess: 'Login successful',
loginError: 'Login failed',
}
}
}
88 changes: 44 additions & 44 deletions fcb-fronted/src/locals/zh.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
export default {
send: {
'mzsm':'免责声明',
'alert': '根据《中华人民共和国网络安全法》、《中华人民共和国刑法》、《中华人民共和国治安管理处罚法》等相关规定。 传播或存储违法、违规内容,会受到相关处罚,严重者将承担刑事责任。请勿上传非法文件,本站坚决配合相关部门,确保网络内容的安全,和谐,打造绿色网络环境。',
'prompt1': '将文字、文件拖、粘贴到此处,或 ',
'prompt2': '天数<7或限制次数(24h后删除)',
'prompt3': '请输入您要寄出的文本',
'share': '分享',
'textShare': '文本分享',
'clickUpload': '点击上传',
'pleaseInputExpireValue': '请输入有效期',
'expireStyle': '过期方式',
'expireData': {
'day': '天数',
'hour': '小时',
'forever': '永久',
'minute': '分钟',
'count': '次数'
mzsm:'免责声明',
alert: '根据《中华人民共和国网络安全法》、《中华人民共和国刑法》、《中华人民共和国治安管理处罚法》等相关规定。 传播或存储违法、违规内容,会受到相关处罚,严重者将承担刑事责任。请勿上传非法文件,本站坚决配合相关部门,确保网络内容的安全,和谐,打造绿色网络环境。',
prompt1: '将文字、文件拖、粘贴到此处,或 ',
prompt2: '天数<7或限制次数(24h后删除)',
prompt3: '请输入您要寄出的文本,支持MarkDown格式',
share: '分享',
textShare: '文本分享',
clickUpload: '点击上传',
pleaseInputExpireValue: '请输入有效期',
expireStyle: '过期方式',
expireData: {
day: '天数',
hour: '小时',
forever: '永久',
minute: '分钟',
count: '次数'
},
'expireValue': {
'day': '天',
'hour': '时',
'minute': '分',
'count': '次'
expireValue: {
day: '天',
hour: '时',
minute: '分',
count: '次'
},
'fileType': {
'file': '文件',
'text': '文本'
fileType: {
file: '文件',
text: '文本'
}
},
fileBox: {
Expand All @@ -42,8 +42,8 @@ export default {
},
admin: {
about: {
'source1': '本项目开源于Github:',
'source2': 'FileCodeBox'
source1: '本项目开源于Github:',
source2: 'FileCodeBox'
},
settings: {
name: '网站名称',
Expand All @@ -54,16 +54,16 @@ export default {
uploadSize: '文件大小',
uploadSizeNote: '最大文件大小,单位:(Bytes),1mb=1 * 1024 * 1024',
openUpload: {
'title': '开启上传',
'open': '开启游客上传',
'close': '关闭游客上传',
'note': '关闭之后需要登录后台方可上传',
title: '开启上传',
open: '开启游客上传',
close: '关闭游客上传',
note: '关闭之后需要登录后台方可上传',
},
file_storage: {
'title': '存储引擎',
'local': '本地存储',
's3': 'S3存储',
'note': '更新后需要重启FileCodeBox',
title: '存储引擎',
local: '本地存储',
s3: 'S3存储',
note: '更新后需要重启FileCodeBox',
},
mei: '每',
minute: '分钟',
Expand All @@ -88,18 +88,18 @@ export default {
delete: '删除',
},
menu: {
'fileManage': '文件管理',
'systemSetting': '系统设置',
'about': '关于我们',
'color': '颜色模式',
'signout': '退出登录',
fileManage: '文件管理',
systemSetting: '系统设置',
about: '关于我们',
color: '颜色模式',
signout: '退出登录',
},
login: {
'managePassword': '管理密码',
'passwordNotEmpty': '密码不能为空',
'login': '登 录',
'loginSuccess': '登录成功',
'loginError': '登录失败',
managePassword: '管理密码',
passwordNotEmpty: '密码不能为空',
login: '登 录',
loginSuccess: '登录成功',
loginError: '登录失败',
}
}
};
13 changes: 9 additions & 4 deletions fcb-fronted/src/views/Share/SendView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const shareData = ref({

<template>
<main>
<el-card class="card" style="padding: 1rem;position: relative" :body-style="{ padding: '0px 0px 20px 0px' }">
<card-tools/>
<div style="display: flex;margin-top: 1rem">
<el-card class="card" style="position: relative" :body-style="{ padding: '0' }">
<card-tools style="padding: 1rem"/>
<div style="display: flex;margin: 1rem">
<div>
<el-input
v-model="shareData.expireValue"
Expand Down Expand Up @@ -52,10 +52,15 @@ const shareData = ref({
</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 1rem">
<div style="margin: 1rem">
<upload-file :shareData="shareData" v-if="shareData.targetType=='file'"/>
<upload-text :shareData="shareData" v-else-if="shareData.targetType=='text'"/>
</div>
<el-carousel height="319px">
<el-carousel-item v-for="item in 4" :key="item">
<div style="height: 100%;width: 100%;background: #0a0a0a"></div>
</el-carousel-item>
</el-carousel>
</el-card>
</main>
</template>

0 comments on commit f6cbec5

Please sign in to comment.