add:上传页面新增banner

This commit is contained in:
lan
2022-12-19 15:21:24 +08:00
parent 141008639a
commit 1c938948fd
5 changed files with 27 additions and 2 deletions
+8
View File
@@ -81,6 +81,14 @@ async def index():
return HTMLResponse(index_html) return HTMLResponse(index_html)
@app.get('/banner')
async def banner():
return {
'detail': 'banner',
'data': settings.UPLOAD_BANNERS.split(',')
}
@app.get('/select') @app.get('/select')
async def get_file(code: str, ip: str = Depends(error_ip_limit), s: AsyncSession = Depends(get_session)): async def get_file(code: str, ip: str = Depends(error_ip_limit), s: AsyncSession = Depends(get_session)):
# 查出数据库记录 # 查出数据库记录
+2
View File
@@ -41,5 +41,7 @@ TITLE = config('TITLE', cast=str, default="文件快递柜")
DESCRIPTION = config('DESCRIPTION', cast=str, default="FileCodeBox,文件快递柜,口令传送箱,匿名口令分享文本,文件等文件") DESCRIPTION = config('DESCRIPTION', cast=str, default="FileCodeBox,文件快递柜,口令传送箱,匿名口令分享文本,文件等文件")
# 网站关键词 # 网站关键词
KEYWORDS = config('KEYWORDS', cast=str, default="FileCodeBox,文件快递柜,口令传送箱,匿名口令分享文本,文件等文件") KEYWORDS = config('KEYWORDS', cast=str, default="FileCodeBox,文件快递柜,口令传送箱,匿名口令分享文本,文件等文件")
# 上传页Banner图片
UPLOAD_BANNERS = config('UPLOAD_BANNERS', cast=str, default=["/static/banners/img_1.png", "/static/banners/img_2.png"])
# 存储引擎 # 存储引擎
STORAGE_ENGINE = config('STORAGE_ENGINE', cast=str, default="filesystem") STORAGE_ENGINE = config('STORAGE_ENGINE', cast=str, default="filesystem")
Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

+17 -2
View File
@@ -87,9 +87,18 @@
</el-col> </el-col>
</el-card> </el-card>
</el-row> </el-row>
<el-row v-else style="width:400px;height: 596px;margin: 6vh auto 0 auto"> <el-row v-else style="width:400px;margin: 6vh auto 0 auto">
<el-col :span="24"> <el-col :span="24">
<el-card style="padding-top: 20px"> <el-card :body-style="{ padding: '0px 0px 20px 0px' }">
<div class="block" style="margin-bottom: 1rem">
<el-carousel height="150px">
<el-carousel-item v-for="item in banners" :key="item">
<a href="" target="_blank">
<img class="image" style="width: 400px" :src="item" alt="1">
</a>
</el-carousel-item>
</el-carousel>
</div>
<el-row> <el-row>
<el-input style="width: 190px" placeholder="数量" v-model="uploadData.value" <el-input style="width: 190px" placeholder="数量" v-model="uploadData.value"
class="input-with-select"> class="input-with-select">
@@ -133,6 +142,7 @@
placeholder="请输入内容,使用按钮存入" placeholder="请输入内容,使用按钮存入"
v-model="uploadData.text"> v-model="uploadData.text">
</el-input> </el-input>
<div class="el-upload__tip"> <div class="el-upload__tip">
<el-button round @click="pageNum=0"> <el-button round @click="pageNum=0">
<div class="el-icon-back"></div> <div class="el-icon-back"></div>
@@ -224,6 +234,7 @@
inputDisable: false, inputDisable: false,
fileSizeLimit: '{{fileSizeLimit}}', fileSizeLimit: '{{fileSizeLimit}}',
pwd: localStorage.getItem('pwd') || '', pwd: localStorage.getItem('pwd') || '',
banners: [],
uploadData: { uploadData: {
style: '2', style: '2',
type: '1', type: '1',
@@ -265,6 +276,10 @@
} }
} }
}); });
// 获取Banner
axios.get('/banner').then(res => {
this.banners = res.data.data
})
}, },
watch: { watch: {
code: function (code) { code: function (code) {