fix:issue #103
This commit is contained in:
@@ -10,7 +10,7 @@ from core.settings import settings
|
|||||||
|
|
||||||
|
|
||||||
async def admin_required(authorization: Union[str, None] = Header(default=None), request: Request = None):
|
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 request.url.path.startswith('/share/'):
|
||||||
if not settings.openUpload and not is_admin:
|
if not settings.openUpload and not is_admin:
|
||||||
raise HTTPException(status_code=403, detail='本站未开启游客上传,如需上传请先登录后台')
|
raise HTTPException(status_code=403, detail='本站未开启游客上传,如需上传请先登录后台')
|
||||||
|
|||||||
Vendored
+2
@@ -10,6 +10,8 @@ declare module 'vue' {
|
|||||||
CardTools: typeof import('./src/components/CardTools.vue')['default']
|
CardTools: typeof import('./src/components/CardTools.vue')['default']
|
||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
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']
|
ElCol: typeof import('element-plus/es')['ElCol']
|
||||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
.card {
|
.card {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
|
min-width: 398px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #F8FBFE;
|
background-color: #F8FBFE;
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
export default {
|
export default {
|
||||||
send: {
|
send: {
|
||||||
'mzsm':'Disclaimers',
|
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.',
|
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 ',
|
prompt1: 'Drag and drop text or files here, or ',
|
||||||
'prompt2': 'Days <7 or limited times (deleted after 24h)',
|
prompt2: 'Days <7 or limited times (deleted after 24h)',
|
||||||
'prompt3': 'Please enter the text you want to send',
|
prompt3: 'Please enter the text you want to send',
|
||||||
'share': 'Share',
|
share: 'Share',
|
||||||
'textShare': 'Text Share',
|
textShare: 'Text Share',
|
||||||
'clickUpload': 'Click to upload',
|
clickUpload: 'Click to upload',
|
||||||
'pleaseInputExpireValue': 'Please enter expiration value',
|
pleaseInputExpireValue: 'Please enter expiration value',
|
||||||
'expireStyle': 'Expiration style',
|
expireStyle: 'Expiration style',
|
||||||
'expireData': {
|
expireData: {
|
||||||
'day': 'Days',
|
day: 'Days',
|
||||||
'hour': 'Hours',
|
hour: 'Hours',
|
||||||
'forever': 'Forever',
|
forever: 'Forever',
|
||||||
'minute': 'Minutes',
|
minute: 'Minutes',
|
||||||
'count': 'Times'
|
count: 'Times'
|
||||||
},
|
},
|
||||||
'expireValue': {
|
expireValue: {
|
||||||
'day': 'Days',
|
day: 'Days',
|
||||||
'hour': 'Hours',
|
hour: 'Hours',
|
||||||
'minute': 'Minutes',
|
minute: 'Minutes',
|
||||||
'count': 'Times'
|
count: 'Times'
|
||||||
},
|
},
|
||||||
'fileType': {
|
fileType: {
|
||||||
'file': 'File',
|
file: 'File',
|
||||||
'text': 'Text'
|
text: 'Text'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fileBox: {
|
fileBox: {
|
||||||
@@ -42,8 +42,8 @@ export default {
|
|||||||
},
|
},
|
||||||
admin:{
|
admin:{
|
||||||
about:{
|
about:{
|
||||||
'source1':'This project is open source on Github: ',
|
source1:'This project is open source on Github: ',
|
||||||
'source2':'FileCodeBox'
|
source2:'FileCodeBox'
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
name: 'Website Name',
|
name: 'Website Name',
|
||||||
@@ -54,16 +54,16 @@ export default {
|
|||||||
uploadSize: 'File Size',
|
uploadSize: 'File Size',
|
||||||
uploadSizeNote: 'Maximum file size, unit: (bit), 1mb = 1 * 1024 * 1024',
|
uploadSizeNote: 'Maximum file size, unit: (bit), 1mb = 1 * 1024 * 1024',
|
||||||
openUpload: {
|
openUpload: {
|
||||||
'title': 'Enable Upload',
|
title: 'Enable Upload',
|
||||||
'open': 'Enable Guest Upload',
|
open: 'Enable Guest Upload',
|
||||||
'close': 'Disable Guest Upload',
|
close: 'Disable Guest Upload',
|
||||||
'note': 'After disabling, login to the backend is required for uploading.',
|
note: 'After disabling, login to the backend is required for uploading.',
|
||||||
},
|
},
|
||||||
file_storage: {
|
file_storage: {
|
||||||
'title': 'Storage Engine',
|
title: 'Storage Engine',
|
||||||
'local': 'Local Storage',
|
local: 'Local Storage',
|
||||||
's3': 'S3 Storage',
|
s3: 'S3 Storage',
|
||||||
'note': 'FileCodeBox needs to be restarted after updating.',
|
note: 'FileCodeBox needs to be restarted after updating.',
|
||||||
},
|
},
|
||||||
mei: 'Every',
|
mei: 'Every',
|
||||||
minute: 'Minutes',
|
minute: 'Minutes',
|
||||||
@@ -88,18 +88,18 @@ export default {
|
|||||||
delete: 'Delete',
|
delete: 'Delete',
|
||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
'fileManage': 'File Management',
|
fileManage: 'File Management',
|
||||||
'systemSetting': 'System Settings',
|
systemSetting: 'System Settings',
|
||||||
'about': 'About Us',
|
about: 'About Us',
|
||||||
'color': 'Color Mode',
|
color: 'Color Mode',
|
||||||
'signout': 'Sign Out',
|
signout: 'Sign Out',
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
'managePassword': 'Admin Password',
|
managePassword: 'Admin Password',
|
||||||
'passwordNotEmpty': 'Password cannot be empty',
|
passwordNotEmpty: 'Password cannot be empty',
|
||||||
'login': 'Login',
|
login: 'Login',
|
||||||
'loginSuccess': 'Login successful',
|
loginSuccess: 'Login successful',
|
||||||
'loginError': 'Login failed',
|
loginError: 'Login failed',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
export default {
|
export default {
|
||||||
send: {
|
send: {
|
||||||
'mzsm':'免责声明',
|
mzsm:'免责声明',
|
||||||
'alert': '根据《中华人民共和国网络安全法》、《中华人民共和国刑法》、《中华人民共和国治安管理处罚法》等相关规定。 传播或存储违法、违规内容,会受到相关处罚,严重者将承担刑事责任。请勿上传非法文件,本站坚决配合相关部门,确保网络内容的安全,和谐,打造绿色网络环境。',
|
alert: '根据《中华人民共和国网络安全法》、《中华人民共和国刑法》、《中华人民共和国治安管理处罚法》等相关规定。 传播或存储违法、违规内容,会受到相关处罚,严重者将承担刑事责任。请勿上传非法文件,本站坚决配合相关部门,确保网络内容的安全,和谐,打造绿色网络环境。',
|
||||||
'prompt1': '将文字、文件拖、粘贴到此处,或 ',
|
prompt1: '将文字、文件拖、粘贴到此处,或 ',
|
||||||
'prompt2': '天数<7或限制次数(24h后删除)',
|
prompt2: '天数<7或限制次数(24h后删除)',
|
||||||
'prompt3': '请输入您要寄出的文本',
|
prompt3: '请输入您要寄出的文本,支持MarkDown格式',
|
||||||
'share': '分享',
|
share: '分享',
|
||||||
'textShare': '文本分享',
|
textShare: '文本分享',
|
||||||
'clickUpload': '点击上传',
|
clickUpload: '点击上传',
|
||||||
'pleaseInputExpireValue': '请输入有效期',
|
pleaseInputExpireValue: '请输入有效期',
|
||||||
'expireStyle': '过期方式',
|
expireStyle: '过期方式',
|
||||||
'expireData': {
|
expireData: {
|
||||||
'day': '天数',
|
day: '天数',
|
||||||
'hour': '小时',
|
hour: '小时',
|
||||||
'forever': '永久',
|
forever: '永久',
|
||||||
'minute': '分钟',
|
minute: '分钟',
|
||||||
'count': '次数'
|
count: '次数'
|
||||||
},
|
},
|
||||||
'expireValue': {
|
expireValue: {
|
||||||
'day': '天',
|
day: '天',
|
||||||
'hour': '时',
|
hour: '时',
|
||||||
'minute': '分',
|
minute: '分',
|
||||||
'count': '次'
|
count: '次'
|
||||||
},
|
},
|
||||||
'fileType': {
|
fileType: {
|
||||||
'file': '文件',
|
file: '文件',
|
||||||
'text': '文本'
|
text: '文本'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fileBox: {
|
fileBox: {
|
||||||
@@ -42,8 +42,8 @@ export default {
|
|||||||
},
|
},
|
||||||
admin: {
|
admin: {
|
||||||
about: {
|
about: {
|
||||||
'source1': '本项目开源于Github:',
|
source1: '本项目开源于Github:',
|
||||||
'source2': 'FileCodeBox'
|
source2: 'FileCodeBox'
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
name: '网站名称',
|
name: '网站名称',
|
||||||
@@ -54,16 +54,16 @@ export default {
|
|||||||
uploadSize: '文件大小',
|
uploadSize: '文件大小',
|
||||||
uploadSizeNote: '最大文件大小,单位:(Bytes),1mb=1 * 1024 * 1024',
|
uploadSizeNote: '最大文件大小,单位:(Bytes),1mb=1 * 1024 * 1024',
|
||||||
openUpload: {
|
openUpload: {
|
||||||
'title': '开启上传',
|
title: '开启上传',
|
||||||
'open': '开启游客上传',
|
open: '开启游客上传',
|
||||||
'close': '关闭游客上传',
|
close: '关闭游客上传',
|
||||||
'note': '关闭之后需要登录后台方可上传',
|
note: '关闭之后需要登录后台方可上传',
|
||||||
},
|
},
|
||||||
file_storage: {
|
file_storage: {
|
||||||
'title': '存储引擎',
|
title: '存储引擎',
|
||||||
'local': '本地存储',
|
local: '本地存储',
|
||||||
's3': 'S3存储',
|
s3: 'S3存储',
|
||||||
'note': '更新后需要重启FileCodeBox',
|
note: '更新后需要重启FileCodeBox',
|
||||||
},
|
},
|
||||||
mei: '每',
|
mei: '每',
|
||||||
minute: '分钟',
|
minute: '分钟',
|
||||||
@@ -88,18 +88,18 @@ export default {
|
|||||||
delete: '删除',
|
delete: '删除',
|
||||||
},
|
},
|
||||||
menu: {
|
menu: {
|
||||||
'fileManage': '文件管理',
|
fileManage: '文件管理',
|
||||||
'systemSetting': '系统设置',
|
systemSetting: '系统设置',
|
||||||
'about': '关于我们',
|
about: '关于我们',
|
||||||
'color': '颜色模式',
|
color: '颜色模式',
|
||||||
'signout': '退出登录',
|
signout: '退出登录',
|
||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
'managePassword': '管理密码',
|
managePassword: '管理密码',
|
||||||
'passwordNotEmpty': '密码不能为空',
|
passwordNotEmpty: '密码不能为空',
|
||||||
'login': '登 录',
|
login: '登 录',
|
||||||
'loginSuccess': '登录成功',
|
loginSuccess: '登录成功',
|
||||||
'loginError': '登录失败',
|
loginError: '登录失败',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -16,9 +16,9 @@ const shareData = ref({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main>
|
<main>
|
||||||
<el-card class="card" style="padding: 1rem;position: relative" :body-style="{ padding: '0px 0px 20px 0px' }">
|
<el-card class="card" style="position: relative" :body-style="{ padding: '0' }">
|
||||||
<card-tools/>
|
<card-tools style="padding: 1rem"/>
|
||||||
<div style="display: flex;margin-top: 1rem">
|
<div style="display: flex;margin: 1rem">
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="shareData.expireValue"
|
v-model="shareData.expireValue"
|
||||||
@@ -52,10 +52,15 @@ const shareData = ref({
|
|||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 1rem">
|
<div style="margin: 1rem">
|
||||||
<upload-file :shareData="shareData" v-if="shareData.targetType=='file'"/>
|
<upload-file :shareData="shareData" v-if="shareData.targetType=='file'"/>
|
||||||
<upload-text :shareData="shareData" v-else-if="shareData.targetType=='text'"/>
|
<upload-text :shareData="shareData" v-else-if="shareData.targetType=='text'"/>
|
||||||
</div>
|
</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>
|
</el-card>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
Reference in New Issue
Block a user