2023-02-06 内容调整,提高密码安全性及界面内容

This commit is contained in:
2023-02-06 15:30:25 +08:00
parent 4826c68fb2
commit 366078f4b9
9 changed files with 489 additions and 350 deletions

4
ReadMe.md Normal file
View File

@ -0,0 +1,4 @@
2023-02-06
Xin-Laucher包更新后下载的框架内容初始化登录账号密码已修改
旧账号密码: admin/111111
新账号密码: admin/CRTECH@2023laucher

Binary file not shown.

View File

@ -1,4 +1,4 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<head>
<title>X·in管理端 - 修改密码</title>
<script type="text/javascript" src="themes/js/vue.min.js"></script>
@ -8,6 +8,7 @@
<script type="text/javascript" src="themes/js/moment.js"></script>
<link rel="stylesheet" href="themes/css/index.css" type="text/css">
</head>
<style>
.header {
height: 60px;
@ -27,30 +28,10 @@
background-size: 90%;
background-image: url('themes/img/xin.png');
}
.el-form {
width: 480px;
margin: auto;
margin-top: 40px;
}
.admin {
display: flex;
align-items: center;
border: 1px solid #DCDFE6;
background-color: #fff;
border-radius: 4px;
height: 40px;
margin-bottom: 20px;
}
.iconinfo {
display: block;
width: 40px;
text-align: center;
font-size: 14px;
font-weight: 600;
color: #999;
height: 40px;
line-height: 40px;
margin: 40px auto auto;
}
#app {
@ -72,6 +53,7 @@
width: 80%;
margin: 40px auto;
}
.title {
height: 60px;
width: 100%;
@ -81,12 +63,13 @@
align-items: center;
justify-content: center;
}
.system {
font-size: 20px;
font-weight: 600;
}
</style>
<body>
<body>
<div id="app">
<div class="header">
@ -100,13 +83,16 @@
</div>
<el-form :model="from" id="passLogin" :rules="rules" ref="user" label-width="80px" @keyup.enter.native="login">
<el-form-item label="原密码" class="demo-dynamic" prop="pass">
<el-input v-model="from.pass" size="small" placeholder="请输入原密码" type="password" show-password ></el-input>
<el-input v-model="from.pass" size="small" placeholder="请输入原密码" type="password"
show-password></el-input>
</el-form-item>
<el-form-item label="新密码" class="demo-dynamic" prop="editpass">
<el-input size="small" v-model="from.editpass" placeholder="请输入要修改的密码" type="password" show-password></el-input>
<el-form-item label="新密码" class="demo-dynamic" prop="editPass">
<el-input size="small" v-model="from.editPass" placeholder="请输入要修改的密码" type="password"
show-password></el-input>
</el-form-item>
<el-form-item label="确认密码" class="demo-dynamic" prop="checkpass">
<el-input size="small" v-model="from.checkpass" placeholder="请确认改改的密码" type="password" show-password></el-input>
<el-form-item label="确认密码" class="demo-dynamic" prop="checkPass">
<el-input size="small" v-model="from.checkPass" placeholder="请确认改改的密码" type="password"
show-password></el-input>
</el-form-item>
<el-form-item>
<div style="text-align: center;">
@ -117,26 +103,54 @@
</div>
</div>
</body>
<script>
new Vue({
el: '#app',
data() {
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
if (this.from.checkPass !== '') {
this.$refs.user.validateField('checkPass');
}
callback();
}
};
const validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.from.editPass) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
from: {
pass: '',
editpass:'',
checkpass:''
editPass: '',
checkPass: ''
},
rules: {
pass: [
{required: true, message: '请输入原密码', trigger: 'blur'},
],
editpass: [
editPass: [
{required: true, message: '请输入要修改的密码', trigger: 'blur'},
{
pattern: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,16}$/g,
message: '密码必须包含大小写字母及数字允许特殊字符长度6-16'
},
{validator: validatePass, trigger: 'blur'}
],
checkpass: [
{required: true, message: '请确认改改的密码', trigger: 'blur'},
],
checkPass: [
{required: true, message: '请再次输入修改的密码', trigger: 'blur'},
{validator: validatePass2, trigger: 'blur'}
]
}
}
},
@ -144,7 +158,7 @@
edit(user) {
this.$refs[user].validate((valid) => {
if (valid) {
if(this.from.editpass == this.from.checkpass){
if (this.from.editPass === this.from.checkPass) {
const that = this;
axios.post('/xinadmin/edit', this.from, {
headers: {
@ -152,13 +166,13 @@
}
}).then(function (res) {
console.log(res)
if (res.data.state == "success") {
if (res.data.state === "success") {
that.$message.success('修改成功');
setTimeout(() => { //设置延迟执行
location.href = "login.jsp";
}, 2000);
} else {
that.$message.error("密码错误");
that.$message.error(res.data.mes??"密码错误");
}
}).catch(function (error) {
console.log(error)

View File

@ -1,4 +1,4 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
@ -12,12 +12,17 @@
<link rel="stylesheet" href="themes/css/index.css" type="text/css">
<link rel="stylesheet" href="themes/css/main.css" type="text/css">
</head>
<body>
<div id="app">
<div class="header">
<div class="logo">
<div class="logo" style="float: left">
<div class="logo-image"></div>
</div>
<div style="float: right;margin-right: 20px;margin-top: 15px;">
<el-button type="primary" @click="openShow">修改密码</el-button>
</div>
</div>
<div class="card-main">
@ -32,7 +37,7 @@
<div class="company-lint">
<div class="company-name">
<div class="company-logo">
<img src="themes/img/logo.png">
<img src="themes/img/logo.png" alt="超然X-in智慧管理平台">
</div>
<div style="margin-left: 20px;">{{companyName}}</div>
</div>
@ -65,9 +70,9 @@
</div>
<div class="pubg">
<div class="applist">
<div class="app" v-for="(item,i) in single.applist" @click="showDetail(item)">
<div class="app" v-for="(item,i) in single.appList" @click="showDetail(item)">
<div class="app-det">
<img :src="item.logo ? item.logo : 'themes/img/mk.png'">
<img :src="item.logo ? item.logo : 'themes/img/mk.png'" :alt="item.name">
</div>
<div class="app-name">{{item.name}}</div>
<div class="app-des">版本:{{item.version}}</div>
@ -83,7 +88,33 @@
</div>
</div>
<el-dialog title="授权码" :visible.sync="dialogCodeVisible">
<el-dialog title="修改密码" :visible.sync="showPassChange" width="500px" @close="closeShow"
:close-on-click-modal="false">
<el-form :model="from" id="passLogin" :rules="rules" ref="user"
label-width="80px" @keyup.enter.native="login">
<el-form-item label="原密码" class="demo-dynamic" prop="pass">
<el-input v-model="from.pass" size="small" placeholder="请输入原密码" type="password"
show-password clearable></el-input>
</el-form-item>
<el-form-item label="新密码" class="demo-dynamic" prop="editPass">
<el-input size="small" v-model="from.editPass" placeholder="请输入要修改的密码" type="password"
show-password clearable></el-input>
</el-form-item>
<el-form-item label="确认密码" class="demo-dynamic" prop="checkPass">
<el-input size="small" v-model="from.checkPass" placeholder="请确认改改的密码" type="password"
show-password clearable></el-input>
</el-form-item>
<el-form-item>
<div style="text-align: center;">
<el-button @click="closeShow">取 消</el-button>
<el-button type="primary" @click="edit('user')">确认修改</el-button>
</div>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog title="授权码" :visible.sync="dialogCodeVisible" :close-on-click-modal="false">
<div class="demo-input-suffix">
<el-button style="float: right; margin-top: -25px" icon="el-icon-document-copy" @click="copy()" type="text">
复制授权码
@ -94,7 +125,7 @@
</div>
</el-dialog>
<el-dialog title="授权文件修改" :visible.sync="dialogTableVisible">
<el-dialog title="授权文件修改" :visible.sync="dialogTableVisible" :close-on-click-modal="false">
<div slot="header">
<span>上传授权文件</span>
</div>
@ -120,6 +151,7 @@
</div>
</el-dialog>
</div>
<script>
Vue.filter("dateFilter", function (date, formatPattern) {
return moment(date).format(formatPattern || "YYYY-MM-DD HH:mm:ss");
@ -127,6 +159,27 @@
const home = new Vue({
el: '#app',
data() {
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
if (this.from.checkPass !== '') {
this.$refs.user.validateField('checkPass');
}
callback();
}
};
const validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.from.editPass) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
single: [],
dialogCodeVisible: false,
@ -137,7 +190,31 @@
companyName: '',
companyAddress: '',
companyIntroduce: ''
companyIntroduce: '',
showPassChange: false,
from: {
pass: '',
editPass: '',
checkPass: ''
},
rules: {
pass: [
{required: true, message: '请输入原密码', trigger: 'blur'},
],
editPass: [
{required: true, message: '请输入要修改的密码', trigger: 'blur'},
{
pattern: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,16}$/g,
message: '密码必须包含大小写字母及数字允许特殊字符长度6-16'
},
{validator: validatePass, trigger: 'blur'}
],
checkPass: [
{required: true, message: '请再次输入修改的密码', trigger: 'blur'},
{validator: validatePass2, trigger: 'blur'}
]
}
}
},
created: function () {
@ -182,8 +259,8 @@
uploadfile() {
this.$refs.upload.submit()
},
Success(response, file, fileList) {
if (response.state == "success") {
Success(response) {
if (response.state === "success") {
this.dialogTableVisible = false;
this.$notify({
title: '成功',
@ -197,7 +274,7 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
axios.get('/xinadmin/adminstarter', {}).then(function (res) {
axios.get('/xinadmin/adminstarter', {}).then(function () {
that.$notify({
title: '重启中',
duration: 2000,
@ -228,7 +305,7 @@
showDetail(item) {
this.rightDialogVisible = true;
this.rightDialogTitle = item.name + "授权参数详情";
let ary = new Array();
let ary = [];
let data = item.params;
if (data != null) {
for (let i in data) {
@ -236,15 +313,15 @@
let value = data[i].value;
let valueType = data[i].valueType;
if (valueType == "number") {
if (value == -1)
if (valueType === "number") {
if (value === -1)
value = "未限制数量";
else
value = "当前允许最大数量为: " + value + " , 请勿超出限制";
} else if (valueType == "boolean") {
if (value == data[i].falseDefault)
} else if (valueType === "boolean") {
if (value === data[i].falseDefault)
value = "未拥有此功能(或权限)";
else if (value == data[i].trueDefault)
else if (value === data[i].trueDefault)
value = "已拥有此功能(或权限)";
}
@ -262,6 +339,45 @@
this.rightDialogVisible = false;
this.rightDialogTitle = '';
this.tableData = [];
},
openShow() {
this.showPassChange = true
},
closeShow() {
this.form = {
pass: '',
editPass: '',
checkPass: ''
}
this.showPassChange = false
},
edit(user) {
this.$refs[user].validate((valid) => {
if (valid) {
if (this.from.editPass === this.from.checkPass) {
const that = this;
axios.post('/xinadmin/edit', this.from, {
headers: {
'token': sessionStorage.getItem("token")
}
}).then(function (res) {
if (res.data.state === "success") {
that.$message.success('修改成功');
setTimeout(() => { //设置延迟执行
location.href = "login.jsp";
}, 2000);
} else {
that.$message.error(res.data.mes??"密码错误");
}
}).catch(function (error) {
console.log(error)
})
} else {
this.$message.error("两次密码不一致")
}
}
});
}
}
})

View File

@ -1,4 +1,4 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<head>
<meta charset="UTF-8">
<title>授权中心</title>
@ -18,23 +18,27 @@
</div>
</div>
<div class="no-license">
<el-card class="box-card" shadow="never" style="width:640px;margin: 10px auto 0px auto;">
<el-card class="box-card" shadow="never" style="width:640px;margin: 10px auto 0 auto;">
<div slot="header" class="clearfix">
<span>本机授权码</span>
<el-button style="float: right; padding: 3px 0;" icon="el-icon-document-copy" @click="copy()" type="text">复制授权码</el-button>
<el-button style="float: right; padding: 3px 0;" icon="el-icon-document-copy" @click="copy()"
type="text">复制授权码
</el-button>
</div>
<span class="tip">请联系您的商务经理或客服经理并将下方框体内的本机授权码发送给Ta以获取授权文件</span>
<div class="demo-input-suffix">
<el-input type="textarea" ref="copy" autosize="true" v-model="code" resize="none" readonly="true"></el-input>
<el-input type="textarea" ref="copy" autosize="true" v-model="code" resize="none"
readonly="true"></el-input>
</div>
</el-card>
<el-card class="box-card" shadow="never" style="width:640px;margin: 10px auto 0px auto;">
<el-card class="box-card" shadow="never" style="width:640px;margin: 10px auto 0 auto;">
<div slot="header">
<span>上传授权文件</span>
</div>
<span class="tip"></span>
<div align="center">
<el-upload class="upload-demo" accept enctype="multipart/form-data" drag action="/xinadmin/upload" multiple="false" show-file-list="false"
<el-upload class="upload-demo" accept enctype="multipart/form-data" drag action="/xinadmin/upload"
multiple="false" show-file-list="false"
drag="true" auto-upload="true" limit="1" :on-success="Success">
<i class="el-icon-upload" style="height: 10px;"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
@ -44,6 +48,7 @@
</el-card>
</div>
</div>
<script>
Vue.filter("dateFilter", function (date, formatPattern) {
return moment(date).format(formatPattern || "YYYY-MM-DD HH:mm:ss");
@ -77,11 +82,11 @@
document.execCommand('Copy')
this.$message.success('已复制到剪贴板')
},
uploadfile(){
uploadFile() {
this.$refs.upload.submit()
},
Success(response, file, fileList) {
if(response.state == "success"){
Success(response) {
if (response.state === "success") {
this.dialogTableVisible = false;
this.$notify({
title: '成功',
@ -90,7 +95,7 @@
type: 'success'
});
const that = this;
axios.get('/xinadmin/adminstarter', {}).then(function (res) {
axios.get('/xinadmin/adminstarter', {}).then(function () {
that.$notify({
title: '重启中',
duration: 2000,

View File

@ -1,4 +1,4 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<head>
<title>X·in管理端</title>
<script type="text/javascript" src="themes/js/vue.min.js"></script>
@ -30,8 +30,7 @@
.el-form {
width: 480px;
margin: auto;
margin-top: 40px;
margin: 40px auto auto;
}
.el-input__inner {
@ -49,7 +48,7 @@
margin-bottom: 20px;
}
.iconinfo {
.iconInfo {
display: block;
width: 40px;
text-align: center;
@ -95,7 +94,7 @@
font-weight: 600;
}
</style>
<body>
<body>
<div id="app">
<div class="header">
@ -109,11 +108,11 @@
</div>
<el-form id="passLogin" ref="user" label-width="80px" @keyup.enter.native="login">
<div class="admin">
<i class="el-icon-user-solid iconinfo"></i>
<i class="el-icon-user-solid iconInfo"></i>
<el-input v-model="user.name" ref="name" placeholder="请输入用户名" clearable></el-input>
</div>
<div class="admin">
<i class="el-icon-key iconinfo"></i>
<i class="el-icon-key iconInfo"></i>
<el-input placeholder="请输入密码" ref="pass" v-model="user.pass" type="password" show-password></el-input>
</div>
<div>
@ -129,6 +128,7 @@
</div>
</div>
</body>
<script>
new Vue({
el: '#app',
@ -149,7 +149,7 @@
this.$message.error("用户名不能为空");
this.$refs.name.select()
return false;
} else if (this.user.pass == "") {
} else if (this.user.pass === "") {
this.$refs.pass.select()
this.$message.error("密码不能为空");
return false;
@ -161,15 +161,15 @@
}
axios.post('/xinadmin/login', data).then(function (res) {
console.log(res.data)
if (res.data.state == "success") {
if (res.data.state === "success") {
sessionStorage.setItem("token", res.data.token);
if (res.data.edit == 0) {
if (res.data.edit === 0) {
location.href = "editpass.jsp";
} else {
location.href = "home.jsp";
}
} else {
that.$message.error(res.data.mes);
that.$message.error(res.data.mes??res.data.mes);
}
})
},

Binary file not shown.

Binary file not shown.