Commit a5424937 by 田爽

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

parent 0b65a66c
...@@ -18,8 +18,9 @@ ...@@ -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/ueditor.all.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.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> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -69,14 +69,19 @@ ...@@ -69,14 +69,19 @@
} }
}, },
submit () { 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) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl('/office/sys/login'), url: this.$http.adornUrl('/office/sys/login'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'username': this.dataForm.userName, 'username': userName,
'password': this.dataForm.password 'password': password
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
......
...@@ -97,24 +97,24 @@ ...@@ -97,24 +97,24 @@
}, },
// 退出 // 退出
logoutHandle () { logoutHandle () {
clearLoginInfo() // clearLoginInfo()
this.$router.push({ name: 'login' }) // this.$router.push({ name: 'login' })
// this.$confirm(`确定进行[退出]操作?`, '提示', { this.$confirm(`确定进行[退出]操作?`, '提示', {
// confirmButtonText: '确定', confirmButtonText: '确定',
// cancelButtonText: '取消', cancelButtonText: '取消',
// type: 'warning' type: 'warning'
// }).then(() => { }).then(() => {
// this.$http({ this.$http({
// url: this.$http.adornUrl('/sys/logout'), url: this.$http.adornUrl('/office/sys/logout'),
// method: 'post', method: 'post',
// data: this.$http.adornData() data: this.$http.adornData()
// }).then(({data}) => { }).then(({data}) => {
// if (data && data.code === 0) { if (data && data.code === 0) {
// clearLoginInfo() clearLoginInfo()
// this.$router.push({ name: 'login' }) this.$router.push({ name: 'login' })
// } }
// }) })
// }).catch(() => {}) }).catch(() => {})
} }
} }
} }
...@@ -133,4 +133,4 @@ ...@@ -133,4 +133,4 @@
.site-navbar{ .site-navbar{
background-color: rgba(0, 40, 77, 1); background-color: rgba(0, 40, 77, 1);
} }
</style> </style>
\ No newline at end of file
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</el-row> </el-row>
<p v-show="showInfo">{{dataForm.brief}}</p> <p v-show="showInfo">{{dataForm.brief}}</p>
</el-form-item> </el-form-item>
<el-form-item label="图片:" prop="picIndexPath" class="setdes setdes3 pic"> <el-form-item label="图片:" prop="picIndexPath" class="setdes setdes3 pic">
<el-upload <el-upload
v-show="!showInfo" v-show="!showInfo"
...@@ -333,11 +333,14 @@ export default { ...@@ -333,11 +333,14 @@ export default {
this.imgUrl = new FormData() this.imgUrl = new FormData()
const isJPG = file.type === 'image/jpeg' const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png' const isPNG = file.type === 'image/png'
const isGIF = file.type === 'image/gif'
const isLt2M = file.size / 1024 / 1024 < 2 const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG) { if (!isJPG) {
if (!isPNG) { if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!') if (!isGIF) {
return this.$message.error('上传图片只能是 JPG, PNG, GIF 格式!')
return
}
} }
} }
if (!isLt2M) { if (!isLt2M) {
...@@ -383,4 +386,4 @@ export default { ...@@ -383,4 +386,4 @@ export default {
color: #e6a23c; color: #e6a23c;
cursor: pointer; cursor: pointer;
} }
</style> </style>
\ No newline at end of file
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