diff --git a/apps/admin/depends.py b/apps/admin/depends.py index 93dcbd812..8e9e590b7 100644 --- a/apps/admin/depends.py +++ b/apps/admin/depends.py @@ -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='本站未开启游客上传,如需上传请先登录后台') diff --git a/fcb-fronted/components.d.ts b/fcb-fronted/components.d.ts index e807682da..946540dfb 100644 --- a/fcb-fronted/components.d.ts +++ b/fcb-fronted/components.d.ts @@ -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'] diff --git a/fcb-fronted/src/assets/main.css b/fcb-fronted/src/assets/main.css index de9b3e834..efbe675b6 100644 --- a/fcb-fronted/src/assets/main.css +++ b/fcb-fronted/src/assets/main.css @@ -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); diff --git a/fcb-fronted/src/locals/en.ts b/fcb-fronted/src/locals/en.ts index e45c0ce84..e53795148 100644 --- a/fcb-fronted/src/locals/en.ts +++ b/fcb-fronted/src/locals/en.ts @@ -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: { @@ -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', @@ -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', @@ -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', } } } diff --git a/fcb-fronted/src/locals/zh.ts b/fcb-fronted/src/locals/zh.ts index e2a3f5e67..1dd9a0e79 100644 --- a/fcb-fronted/src/locals/zh.ts +++ b/fcb-fronted/src/locals/zh.ts @@ -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: { @@ -42,8 +42,8 @@ export default { }, admin: { about: { - 'source1': '本项目开源于Github:', - 'source2': 'FileCodeBox' + source1: '本项目开源于Github:', + source2: 'FileCodeBox' }, settings: { name: '网站名称', @@ -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: '分钟', @@ -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: '登录失败', } } }; \ No newline at end of file diff --git a/fcb-fronted/src/views/Share/SendView.vue b/fcb-fronted/src/views/Share/SendView.vue index 0202076c0..a483a36e9 100644 --- a/fcb-fronted/src/views/Share/SendView.vue +++ b/fcb-fronted/src/views/Share/SendView.vue @@ -16,9 +16,9 @@ const shareData = ref({ \ No newline at end of file