修改登陆页
parent
66d7a01ca2
commit
a477b94ab6
|
@ -64,15 +64,13 @@ class Logo(Resource):
|
|||
try:
|
||||
b64img = base64.b64encode(img.read()).decode('utf-8')
|
||||
consul_kv.put_kv(consul_kv_path,b64img)
|
||||
return {"code": 20000, "data": "导入成功!"}
|
||||
return {"code": 20000, "data": "LOGO设置成功!"}
|
||||
except Exception as e:
|
||||
logger.error(f"【logo】导入失败,{e}\n{traceback.format_exc()}")
|
||||
return {"code": 50000, "data": "导入失败!"}
|
||||
return {"code": 50000, "data": "LOGO导入失败!"}
|
||||
def get(self, logo_opt):
|
||||
if logo_opt == 'logo':
|
||||
isbig = consul_kv.get_value('ConsulManager/img/isbig')
|
||||
if isbig == {}:
|
||||
isbig = True
|
||||
if isbig:
|
||||
consul_kv_path = 'ConsulManager/img/biglogo'
|
||||
else:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
export PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||
tsspath="/opt/tensuns"
|
||||
uuid=`uuidgen`
|
||||
adminpwd=`uuidgen|awk -F- '{print $1}'`
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 144 KiB |
|
@ -46,7 +46,7 @@ Object.keys(filters).forEach(key => {
|
|||
})
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.VER = 'v1.0.0'
|
||||
Vue.prototype.VER = 'v1.0.1'
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = {
|
||||
|
||||
title: '后羿 - TenSunS',
|
||||
title: 'TenSunS',
|
||||
|
||||
/**
|
||||
* @type {boolean} true | false
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
module.exports = {
|
||||
|
||||
title: '后羿 - TenSunS',
|
||||
|
||||
/**
|
||||
* @type {boolean} true | false
|
||||
* @description Whether fix the header
|
||||
*/
|
||||
fixedHeader: false,
|
||||
|
||||
/**
|
||||
* @type {boolean} true | false
|
||||
* @description Whether show the logo in sidebar
|
||||
*/
|
||||
sidebarLogo: false
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-alert type="success" center close-text="朕知道了">
|
||||
图片大小不能超过512KB,建议使用<el-link type="primary" href="https://tinypng.com/" target="_blank">TinyPNG</el-link>在线压缩图片
|
||||
图片大小不能超过380KB,建议使用<el-link type="primary" href="https://tinypng.com/" target="_blank">TinyPNG</el-link>在线压缩图片
|
||||
</el-alert>
|
||||
<el-row>
|
||||
<el-col :span="8" align='center'><div class="grid-content bg-purple">
|
||||
|
@ -154,24 +154,36 @@ export default {
|
|||
},
|
||||
handleAvatarSuccess1(res, file) {
|
||||
this.imageUrl1 = URL.createObjectURL(file.raw)
|
||||
this.$message.success('LOGO设置成功!')
|
||||
if (res.code === 20000) {
|
||||
this.$message.success(res.data)
|
||||
} else {
|
||||
this.$message.error(res.data)
|
||||
}
|
||||
},
|
||||
handleAvatarSuccess2(res, file) {
|
||||
this.imageUrl2 = URL.createObjectURL(file.raw)
|
||||
this.$message.success('LOGO设置成功!')
|
||||
if (res.code === 20000) {
|
||||
this.$message.success(res.data)
|
||||
} else {
|
||||
this.$message.error(res.data)
|
||||
}
|
||||
},
|
||||
handleAvatarSuccess3(res, file) {
|
||||
this.imageUrl3 = URL.createObjectURL(file.raw)
|
||||
this.$message.success('LOGO设置成功!')
|
||||
if (res.code === 20000) {
|
||||
this.$message.success(res.data)
|
||||
} else {
|
||||
this.$message.error(res.data)
|
||||
}
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png'
|
||||
const isLt2M = file.size / 1024 < 512
|
||||
const isLt2M = file.size / 1024 < 380
|
||||
if (!isJPG) {
|
||||
this.$message.error('上传LOGO图片只能是 JPG/PNG 格式!')
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传LOGO图片大小不能超过 512KB!')
|
||||
this.$message.error('上传LOGO图片大小不能超过 380KB!')
|
||||
}
|
||||
return isJPG && isLt2M
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<div class="login-container" :style="{ 'background-image': 'url(' + loginbgimg + ')' }">
|
||||
<div v-if="isbig" class="title-container" style="text-align:center">
|
||||
<div v-if="isbig" class="title-container" style="text-align:center; padding: 160px 70px 0;">
|
||||
<br><br>
|
||||
<img :src="loginlogo" width="720" :height=height>
|
||||
<br><br>
|
||||
</div>
|
||||
<div v-else class="title-container" style="text-align:center; padding: 160px 70px 0;">
|
||||
<img :src="loginlogo" width="100" height="100"><br><br><br><br>
|
||||
<h3 style="font-size:45px" class="title">{{ logintitle }}</h3><br>
|
||||
<div v-else class="title-container" style="text-align:center; padding: 260px 70px 0;">
|
||||
<img :src="loginlogo" width="100" height="100"><br><br><br>
|
||||
<h1 style="font-size:40px" class="title">{{ logintitle }}</h1>
|
||||
</div>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left" style="padding: 10px 100px 0;">
|
||||
<el-form-item prop="username">
|
||||
|
@ -17,7 +17,7 @@
|
|||
<el-input
|
||||
ref="username"
|
||||
v-model="loginForm.username"
|
||||
placeholder="Username"
|
||||
placeholder="用户名"
|
||||
name="username"
|
||||
type="text"
|
||||
tabindex="1"
|
||||
|
@ -34,7 +34,7 @@
|
|||
ref="password"
|
||||
v-model="loginForm.password"
|
||||
:type="passwordType"
|
||||
placeholder="Password"
|
||||
placeholder="密码"
|
||||
name="password"
|
||||
tabindex="2"
|
||||
auto-complete="on"
|
||||
|
@ -45,7 +45,7 @@
|
|||
</span>
|
||||
</el-form-item>
|
||||
<!-- <el-checkbox v-model="loginForm.Ldapchecked" label="启动ldap验证" border class="ldap" /> -->
|
||||
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登 录</el-button>
|
||||
<el-button :loading="loading" type="primary" round class="login-button" @click.native.prevent="handleLogin">登 录</el-button>
|
||||
</el-form>
|
||||
<div align="center" class="title-container">
|
||||
<span style="font-size:12px" class="title">{{ VER }}</span>
|
||||
|
@ -93,7 +93,7 @@ export default {
|
|||
passwordType: 'password',
|
||||
loginlogo: '',
|
||||
loginbgimg: '',
|
||||
logintitle: 'T e n S u n S',
|
||||
logintitle: 'Welcome to TenSunS',
|
||||
isbig: true,
|
||||
height: '330',
|
||||
redirect: undefined
|
||||
|
@ -219,12 +219,25 @@ $cursor: #fff;
|
|||
}
|
||||
}
|
||||
|
||||
.login-button {
|
||||
width:60%;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-bottom:15px;
|
||||
border: 0px solid rgba(255, 255, 255, 0);
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.el-form-item {
|
||||
border: 2px solid rgba(255, 255, 255, 0.3);
|
||||
border: 0px solid rgba(255, 255, 255, 0);
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 5px;
|
||||
color: #454545;
|
||||
}
|
||||
.el-form-item__content {
|
||||
line-height: 33px;
|
||||
position: relative;
|
||||
font-size: 14px
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Reference in New Issue