2023-02-06 内容调整,提高密码安全性及界面内容
This commit is contained in:
4
ReadMe.md
Normal file
4
ReadMe.md
Normal file
@ -0,0 +1,4 @@
|
||||
2023-02-06
|
||||
Xin-Laucher包更新后,下载的框架内容初始化登录账号密码已修改
|
||||
旧账号密码: admin/111111
|
||||
新账号密码: admin/CRTECH@2023laucher
|
||||
BIN
xin-launcher.zip
BIN
xin-launcher.zip
Binary file not shown.
Binary file not shown.
@ -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,18 +8,19 @@
|
||||
<script type="text/javascript" src="themes/js/moment.js"></script>
|
||||
<link rel="stylesheet" href="themes/css/index.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<style>
|
||||
.header{
|
||||
.header {
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header .logo{
|
||||
.header .logo {
|
||||
height: 60px;
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
.header .logo-image{
|
||||
.header .logo-image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-repeat: no-repeat;
|
||||
@ -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;
|
||||
.el-form {
|
||||
width: 480px;
|
||||
margin: 40px auto auto;
|
||||
}
|
||||
|
||||
#app {
|
||||
@ -72,7 +53,8 @@
|
||||
width: 80%;
|
||||
margin: 40px auto;
|
||||
}
|
||||
.title{
|
||||
|
||||
.title {
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
@ -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,58 +103,86 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
from: {
|
||||
pass: '',
|
||||
editpass:'',
|
||||
checkpass:''
|
||||
},
|
||||
rules: {
|
||||
pass: [
|
||||
{required: true, message: '请输入原密码', trigger: 'blur'},
|
||||
],
|
||||
editpass: [
|
||||
{required: true, message: '请输入要修改的密码', trigger: 'blur'},
|
||||
],
|
||||
checkpass: [
|
||||
{required: true, message: '请确认改改的密码', trigger: 'blur'},
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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) {
|
||||
console.log(res)
|
||||
if (res.data.state == "success") {
|
||||
that.$message.success('修改成功');
|
||||
setTimeout(()=>{ //设置延迟执行
|
||||
location.href = "login.jsp";
|
||||
},2000);
|
||||
}else{
|
||||
that.$message.error("密码错误");
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
})
|
||||
}else{
|
||||
this.$message.error("两次密码不一致")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
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: ''
|
||||
},
|
||||
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'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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) {
|
||||
console.log(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("两次密码不一致")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -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>
|
||||
@ -46,10 +51,10 @@
|
||||
@click="dialogCodeVisible = true">查看</el-link></span></div>
|
||||
<div class="des">授权文件:<span style="color: green">正常</span>
|
||||
<span>
|
||||
<el-link type="primary" :underline="false"
|
||||
style=" font-size: 12px;margin-left: 8px;"
|
||||
@click="dialogTableVisible = true">更换授权文件</el-link>
|
||||
</span>
|
||||
<el-link type="primary" :underline="false"
|
||||
style=" font-size: 12px;margin-left: 8px;"
|
||||
@click="dialogTableVisible = true">更换授权文件</el-link>
|
||||
</span>
|
||||
</div>
|
||||
</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,151 +151,236 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
Vue.filter("dateFilter", function (date, formatPattern) {
|
||||
return moment(date).format(formatPattern || "YYYY-MM-DD HH:mm:ss");
|
||||
});
|
||||
const home = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
single: [],
|
||||
dialogCodeVisible: false,
|
||||
dialogTableVisible: false,
|
||||
rightDialogVisible: false,
|
||||
rightDialogTitle: '',
|
||||
tableData: [],
|
||||
|
||||
companyName: '',
|
||||
companyAddress: '',
|
||||
companyIntroduce: ''
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.checkLogin();
|
||||
this.singlecode();
|
||||
},
|
||||
//绑定方法
|
||||
methods: {
|
||||
singlecode() {
|
||||
const that = this;
|
||||
axios.get('/xinadmin/single', {}).then(function (res) {
|
||||
if (res.data) {
|
||||
if (res.data.license) {
|
||||
that.single = res.data;
|
||||
that.companyName = res.data.company.name;
|
||||
that.companyAddress = res.data.company.address;
|
||||
that.companyIntroduce = res.data.company.introduce;
|
||||
} else {
|
||||
location.href = "index.jsp"
|
||||
}
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
checkLogin() {
|
||||
const token = sessionStorage.getItem("token");
|
||||
if (token == null) {
|
||||
location.href = "login.jsp"
|
||||
} else {
|
||||
const str = new Date().getTime()
|
||||
if ((+token + (2 * 60 * 60 * 1000) < str)) {
|
||||
location.href = "login.jsp"
|
||||
}
|
||||
}
|
||||
},
|
||||
copy() {
|
||||
this.$refs.copy.select()
|
||||
document.execCommand('Copy')
|
||||
this.$message.success('已复制到剪贴板')
|
||||
},
|
||||
uploadfile() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
Success(response, file, fileList) {
|
||||
if (response.state == "success") {
|
||||
this.dialogTableVisible = false;
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
duration: 2000,
|
||||
message: '校验通过',
|
||||
type: 'success'
|
||||
});
|
||||
const that = this;
|
||||
this.$confirm('授权文件已更新,是否立即重启相关应用?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.get('/xinadmin/adminstarter', {}).then(function (res) {
|
||||
that.$notify({
|
||||
title: '重启中',
|
||||
duration: 2000,
|
||||
message: '正在重启相关应用,请稍侯....',
|
||||
type: 'info'
|
||||
});
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
})
|
||||
}).catch(() => {
|
||||
that.$notify({
|
||||
title: '警告',
|
||||
duration: 2000,
|
||||
message: '应用尚未重启,授权尚未生效,请稍后手动重启',
|
||||
type: 'warning'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '上传失败',
|
||||
message: response.error
|
||||
});
|
||||
}
|
||||
},
|
||||
showDetail(item) {
|
||||
this.rightDialogVisible = true;
|
||||
this.rightDialogTitle = item.name + "授权参数详情";
|
||||
let ary = new Array();
|
||||
let data = item.params;
|
||||
if (data != null) {
|
||||
for (let i in data) {
|
||||
let desc = data[i].name;
|
||||
let value = data[i].value;
|
||||
let valueType = data[i].valueType;
|
||||
|
||||
if (valueType == "number") {
|
||||
if (value == -1)
|
||||
value = "未限制数量";
|
||||
else
|
||||
value = "当前允许最大数量为: " + value + " , 请勿超出限制";
|
||||
} else if (valueType == "boolean") {
|
||||
if (value == data[i].falseDefault)
|
||||
value = "未拥有此功能(或权限)";
|
||||
else if (value == data[i].trueDefault)
|
||||
value = "已拥有此功能(或权限)";
|
||||
}
|
||||
|
||||
let param = {
|
||||
code: i,
|
||||
description: desc,
|
||||
value: value,
|
||||
};
|
||||
ary.push(param);
|
||||
}
|
||||
}
|
||||
this.tableData = ary;
|
||||
},
|
||||
closeDetail() {
|
||||
this.rightDialogVisible = false;
|
||||
this.rightDialogTitle = '';
|
||||
this.tableData = [];
|
||||
}
|
||||
Vue.filter("dateFilter", function (date, formatPattern) {
|
||||
return moment(date).format(formatPattern || "YYYY-MM-DD HH:mm:ss");
|
||||
});
|
||||
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,
|
||||
dialogTableVisible: false,
|
||||
rightDialogVisible: false,
|
||||
rightDialogTitle: '',
|
||||
tableData: [],
|
||||
|
||||
companyName: '',
|
||||
companyAddress: '',
|
||||
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 () {
|
||||
this.checkLogin();
|
||||
this.singlecode();
|
||||
},
|
||||
//绑定方法
|
||||
methods: {
|
||||
singlecode() {
|
||||
const that = this;
|
||||
axios.get('/xinadmin/single', {}).then(function (res) {
|
||||
if (res.data) {
|
||||
if (res.data.license) {
|
||||
that.single = res.data;
|
||||
that.companyName = res.data.company.name;
|
||||
that.companyAddress = res.data.company.address;
|
||||
that.companyIntroduce = res.data.company.introduce;
|
||||
} else {
|
||||
location.href = "index.jsp"
|
||||
}
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
checkLogin() {
|
||||
const token = sessionStorage.getItem("token");
|
||||
if (token == null) {
|
||||
location.href = "login.jsp"
|
||||
} else {
|
||||
const str = new Date().getTime()
|
||||
if ((+token + (2 * 60 * 60 * 1000) < str)) {
|
||||
location.href = "login.jsp"
|
||||
}
|
||||
}
|
||||
},
|
||||
copy() {
|
||||
this.$refs.copy.select()
|
||||
document.execCommand('Copy')
|
||||
this.$message.success('已复制到剪贴板')
|
||||
},
|
||||
uploadfile() {
|
||||
this.$refs.upload.submit()
|
||||
},
|
||||
Success(response) {
|
||||
if (response.state === "success") {
|
||||
this.dialogTableVisible = false;
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
duration: 2000,
|
||||
message: '校验通过',
|
||||
type: 'success'
|
||||
});
|
||||
const that = this;
|
||||
this.$confirm('授权文件已更新,是否立即重启相关应用?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.get('/xinadmin/adminstarter', {}).then(function () {
|
||||
that.$notify({
|
||||
title: '重启中',
|
||||
duration: 2000,
|
||||
message: '正在重启相关应用,请稍侯....',
|
||||
type: 'info'
|
||||
});
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
})
|
||||
}).catch(() => {
|
||||
that.$notify({
|
||||
title: '警告',
|
||||
duration: 2000,
|
||||
message: '应用尚未重启,授权尚未生效,请稍后手动重启',
|
||||
type: 'warning'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '上传失败',
|
||||
message: response.error
|
||||
});
|
||||
}
|
||||
},
|
||||
showDetail(item) {
|
||||
this.rightDialogVisible = true;
|
||||
this.rightDialogTitle = item.name + "授权参数详情";
|
||||
let ary = [];
|
||||
let data = item.params;
|
||||
if (data != null) {
|
||||
for (let i in data) {
|
||||
let desc = data[i].name;
|
||||
let value = data[i].value;
|
||||
let valueType = data[i].valueType;
|
||||
|
||||
if (valueType === "number") {
|
||||
if (value === -1)
|
||||
value = "未限制数量";
|
||||
else
|
||||
value = "当前允许最大数量为: " + value + " , 请勿超出限制";
|
||||
} else if (valueType === "boolean") {
|
||||
if (value === data[i].falseDefault)
|
||||
value = "未拥有此功能(或权限)";
|
||||
else if (value === data[i].trueDefault)
|
||||
value = "已拥有此功能(或权限)";
|
||||
}
|
||||
|
||||
let param = {
|
||||
code: i,
|
||||
description: desc,
|
||||
value: value,
|
||||
};
|
||||
ary.push(param);
|
||||
}
|
||||
}
|
||||
this.tableData = ary;
|
||||
},
|
||||
closeDetail() {
|
||||
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("两次密码不一致")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,62 +1,67 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>授权中心</title>
|
||||
<script type="text/javascript" src="themes/js/vue.min.js"></script>
|
||||
<script type="text/javascript" src="themes/js/index.js"></script>
|
||||
<script type="text/javascript" src="themes/js/axios.min.js"></script>
|
||||
<script type="text/javascript" src="themes/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="themes/js/moment.js"></script>
|
||||
<link rel="stylesheet" href="themes/css/index.css" type="text/css">
|
||||
<link rel="stylesheet" href="themes/css/main.css" type="text/css">
|
||||
<meta charset="UTF-8">
|
||||
<title>授权中心</title>
|
||||
<script type="text/javascript" src="themes/js/vue.min.js"></script>
|
||||
<script type="text/javascript" src="themes/js/index.js"></script>
|
||||
<script type="text/javascript" src="themes/js/axios.min.js"></script>
|
||||
<script type="text/javascript" src="themes/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="themes/js/moment.js"></script>
|
||||
<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-image"></div>
|
||||
<div class="header">
|
||||
<div class="logo">
|
||||
<div class="logo-image"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-license">
|
||||
<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>
|
||||
</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>
|
||||
</div>
|
||||
</el-card>
|
||||
<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"
|
||||
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>
|
||||
<div class="el-upload__tip" slot="tip">请将您获得的授权文件(LICENSE)传入系统进行校验</div>
|
||||
</el-upload>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-license">
|
||||
<el-card class="box-card" shadow="never" style="width:640px;margin: 10px auto 0px 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>
|
||||
</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>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card" shadow="never" style="width:640px;margin: 10px auto 0px 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"
|
||||
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>
|
||||
<div class="el-upload__tip" slot="tip">请将您获得的授权文件(LICENSE)传入系统进行校验</div>
|
||||
</el-upload>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
Vue.filter("dateFilter", function (date, formatPattern) {
|
||||
return moment(date).format(formatPattern || "YYYY-MM-DD HH:mm:ss");
|
||||
});
|
||||
new Vue({
|
||||
el: '#app',
|
||||
beforeCreate:function(){
|
||||
beforeCreate: function () {
|
||||
const that = this;
|
||||
axios.get('/xinadmin/code', {}).then(function (res) {
|
||||
if (res.data) {
|
||||
if(res.data.license){
|
||||
if (res.data.license) {
|
||||
location.href = "login.jsp"
|
||||
}else{
|
||||
} else {
|
||||
that.code = res.data.code
|
||||
}
|
||||
|
||||
@ -77,23 +82,23 @@
|
||||
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: '成功',
|
||||
duration:2000,
|
||||
duration: 2000,
|
||||
message: '上传成功',
|
||||
type: 'success'
|
||||
});
|
||||
const that = this;
|
||||
axios.get('/xinadmin/adminstarter', {}).then(function (res) {
|
||||
axios.get('/xinadmin/adminstarter', {}).then(function () {
|
||||
that.$notify({
|
||||
title: '重启中',
|
||||
duration:2000,
|
||||
duration: 2000,
|
||||
message: '正在重启相关应用,请稍侯....',
|
||||
type: 'info'
|
||||
});
|
||||
@ -104,7 +109,7 @@
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '上传失败',
|
||||
message: response.error
|
||||
|
||||
@ -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,15 +108,15 @@
|
||||
</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>
|
||||
<el-checkbox label="记住密码" name="type" style="float: left" ></el-checkbox>
|
||||
<el-checkbox label="记住密码" name="type" style="float: left"></el-checkbox>
|
||||
<div style="float: left;margin-left: 400px;margin-top: -30px;">
|
||||
<el-button type="text">忘记密码?</el-button>
|
||||
</div>
|
||||
@ -129,59 +128,60 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
name: '',
|
||||
pass: ''
|
||||
},
|
||||
}
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
user: {
|
||||
name: '',
|
||||
pass: ''
|
||||
},
|
||||
created: function () {
|
||||
// this.checkLogin();
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
if (!this.user.name) {
|
||||
this.$message.error("用户名不能为空");
|
||||
this.$refs.name.select()
|
||||
return false;
|
||||
} else if (this.user.pass == "") {
|
||||
this.$refs.pass.select()
|
||||
this.$message.error("密码不能为空");
|
||||
return false;
|
||||
}
|
||||
const that = this;
|
||||
const data = {
|
||||
name: this.user.name,
|
||||
pass: this.user.pass
|
||||
}
|
||||
axios.post('/xinadmin/login', data).then(function (res) {
|
||||
console.log(res.data)
|
||||
if (res.data.state == "success") {
|
||||
sessionStorage.setItem("token", res.data.token);
|
||||
if (res.data.edit == 0) {
|
||||
location.href = "editpass.jsp";
|
||||
} else {
|
||||
location.href = "home.jsp";
|
||||
}
|
||||
} else {
|
||||
that.$message.error(res.data.mes);
|
||||
}
|
||||
})
|
||||
},
|
||||
checkLogin() {
|
||||
const token = sessionStorage.getItem("token");
|
||||
const str = new Date().getTime()
|
||||
if (token) {
|
||||
if ((+token + (2 * 60 * 60 * 1000) > str)) {
|
||||
location.href = "home.jsp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
// this.checkLogin();
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
if (!this.user.name) {
|
||||
this.$message.error("用户名不能为空");
|
||||
this.$refs.name.select()
|
||||
return false;
|
||||
} else if (this.user.pass === "") {
|
||||
this.$refs.pass.select()
|
||||
this.$message.error("密码不能为空");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
const that = this;
|
||||
const data = {
|
||||
name: this.user.name,
|
||||
pass: this.user.pass
|
||||
}
|
||||
axios.post('/xinadmin/login', data).then(function (res) {
|
||||
console.log(res.data)
|
||||
if (res.data.state === "success") {
|
||||
sessionStorage.setItem("token", res.data.token);
|
||||
if (res.data.edit === 0) {
|
||||
location.href = "editpass.jsp";
|
||||
} else {
|
||||
location.href = "home.jsp";
|
||||
}
|
||||
} else {
|
||||
that.$message.error(res.data.mes??res.data.mes);
|
||||
}
|
||||
})
|
||||
},
|
||||
checkLogin() {
|
||||
const token = sessionStorage.getItem("token");
|
||||
const str = new Date().getTime()
|
||||
if (token) {
|
||||
if ((+token + (2 * 60 * 60 * 1000) > str)) {
|
||||
location.href = "home.jsp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user