Commit a5424937 by 田爽

登录加密,退出接口,轮播图文件格式

parent 0b65a66c
......@@ -18,8 +18,9 @@
<script src="./static/plugins/ueditor-1.4.3.3/ueditor.all.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>
<% } %>
<script src="https://cdn.jsdelivr.net/npm/jsencrypt@3.0.0-beta.1/bin/jsencrypt.min.js"></script>
</head>
<body>
<div id="app"></div>
</body>
</html>
\ No newline at end of file
</html>
......@@ -69,14 +69,19 @@
}
},
submit () {
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANOf6KgVV4tc+QGyoFWMPGNpYSitenD8sqiei5KliOExO0Cq+bE1LaaFpvNPgg4H/600YsCa0Yn7P/DwbugTwe0CAwEAAQ=='
const encrypt = new JSEncrypt()
encrypt.setPublicKey(publicKey);
const userName = encrypt.encrypt(this.dataForm.userName);
const password = encrypt.encrypt(this.dataForm.password);
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/office/sys/login'),
method: 'post',
data: this.$http.adornData({
'username': this.dataForm.userName,
'password': this.dataForm.password
'username': userName,
'password': password
})
}).then(({data}) => {
if (data && data.code === 0) {
......
......@@ -97,24 +97,24 @@
},
// 退出
logoutHandle () {
clearLoginInfo()
this.$router.push({ name: 'login' })
// this.$confirm(`确定进行[退出]操作?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// this.$http({
// url: this.$http.adornUrl('/sys/logout'),
// method: 'post',
// data: this.$http.adornData()
// }).then(({data}) => {
// if (data && data.code === 0) {
// clearLoginInfo()
// this.$router.push({ name: 'login' })
// }
// })
// }).catch(() => {})
// clearLoginInfo()
// this.$router.push({ name: 'login' })
this.$confirm(`确定进行[退出]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/sys/logout'),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
clearLoginInfo()
this.$router.push({ name: 'login' })
}
})
}).catch(() => {})
}
}
}
......@@ -133,4 +133,4 @@
.site-navbar{
background-color: rgba(0, 40, 77, 1);
}
</style>
\ No newline at end of file
</style>
......@@ -98,7 +98,7 @@
</el-row>
<p v-show="showInfo">{{dataForm.brief}}</p>
</el-form-item>
<el-form-item label="图片:" prop="picIndexPath" class="setdes setdes3 pic">
<el-upload
v-show="!showInfo"
......@@ -333,11 +333,14 @@ export default {
this.imgUrl = new FormData()
const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png'
const isGIF = file.type === 'image/gif'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
if (!isGIF) {
this.$message.error('上传图片只能是 JPG, PNG, GIF 格式!')
return
}
}
}
if (!isLt2M) {
......@@ -383,4 +386,4 @@ export default {
color: #e6a23c;
cursor: pointer;
}
</style>
\ No newline at end of file
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment