提交 7c61f4a9 authored 作者: zwh's avatar zwh

zwh

上级 41e4d517
......@@ -4,7 +4,7 @@ switch (env) {
case 'production':
// baseUrl = "http://192.168.101.205:8086"; // 徐/
// baseUrl = "http://192.168.102.97:8086"; // 陈
baseUrl = "http://123.60.41.254:9779"; // 李总
baseUrl = "http://192.168.102.114:9779"; // 李总
// baseUrl = "http://223.4.69.30:8081"; // 阿里云环境
// baseUrl = "http://192.168.101.205:8086/activities"
break;
......
......@@ -18,17 +18,24 @@ const server = {
method: 'get'
})
},
getNum(data) {
getNum(data) { // 购买数量获取
return axios(`/ac/nums?companyId=${data}`, {
data,
method: 'get'
})
},
getList(data) {
getList(data) { // mac列表获取
return axios(`/ac/acCode?companyId=${data.companyId}&page=${data.page}&size=${data.size}&mac=${data.mac}`, {
data,
method: 'get'
})
},
changePwsd(data){
return axios(`/users`,{
data,
method:'put'
})
}
}
......
......@@ -7,17 +7,17 @@
<div class="title-name">授权绑定</div>
</div>
<div class="bind-input">
<div class="bind-name">序列号:</div>
<div class="bind-name">MAC地址:</div>
<div class="bind-size">
<el-input placeholder="请输入序列号" v-model="serial"></el-input>
<el-input placeholder="请输入MAC地址" v-model="serial"></el-input>
</div>
</div>
<div class="bind-input">
<div class="bind-name">激活码:</div>
<div class="bind-name">授权码:</div>
<div class="bind-size2">
<el-input placeholder="激活码" v-model="Activation"></el-input>
<el-input placeholder="授权码" v-model="Activation" :disabled="true"></el-input>
</div>
<div class="bind-btn" @click="getRandom">激活</div>
<div class="bind-btn" @click="getRandom">生成授权码</div>
</div>
</div>
<div class="use-num same-padding">
......@@ -112,6 +112,7 @@ export default {
this.$server.acRandom(param).then((res) => {
if (res.status === 200) {
this.Activation = res.data.code;
this.getList()
}
});
},
......@@ -226,12 +227,13 @@ export default {
}
}
.bind-name {
width: 72px;
width: 105px;
height: 25px;
font-size: 18px;
// font-family: AlibabaPuHuiTiR;
text-align: end;
color: #747c93;
line-height: 25px;
margin-right: 10px;
}
.bind-size {
width: 600px;
......
......@@ -6,8 +6,19 @@
<div class="time">当前时间{{ time }}</div>
</div>
<div class="header-right">
<div class="header-img"></div>
<div class="username">管理员</div>
<div class="header-box" @click="isShowList = true">
<div class="header-img"></div>
<div class="username">
{{ fullname }}
<div
class="list"
v-if="isShowList"
@mouseleave="isShowList = false"
>
<div class="item" @click="dialogshow = true">修改密码</div>
</div>
</div>
</div>
<div class="blue-line"></div>
<div class="login-out" @click="logout">退出</div>
</div>
......@@ -39,6 +50,35 @@
<router-view></router-view>
</div>
</div>
<!-- 弹窗 -->
<el-dialog
title="修改密码"
:visible.sync="dialogshow"
width="30%"
:before-close="closeD"
>
<div class="form">
<div class="formItem">
<div class="label">原密码:</div>
<el-input
v-model="oldpwsd"
placeholder="请输入原密码"
></el-input>
</div>
<div class="formItem">
<div class="label">新密码:</div>
<el-input v-model="newpwsd" placeholder="请输入新密码" type="password"></el-input>
</div>
<div class="formItem">
<div class="label">再次输入新密码:</div>
<el-input v-model="newpwsd2" placeholder="请重新输入密码" type="password"></el-input>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogshow = false">取 消</el-button>
<el-button type="primary" @click="updatePwsd">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
......@@ -49,30 +89,36 @@ export default {
data() {
return {
nowRouter: "home",
time:null,
timer:null,
time: null,
timer: null,
fullname: "",
isShowList: false,
dialogshow: false,
newpwsd: "",
newpwsd2: "",
oldpwsd: "",
};
},
watch: {
"$route.path": {
handler(newName, oldName) {
//     console.log(newName);
this.nowRouter = newName;
},
immediate: true,
},
},
created() {
if(!localStorage.getItem('token')){
this.$router.replace('/login')
return
this.fullname = localStorage.getItem("name");
if (!localStorage.getItem("token")) {
this.$router.replace("/login");
return;
}
this.timer = setInterval(() => {
this.time = this.getTime()
this.time = this.getTime();
}, 1000);
},
destroyed(){
clearInterval(this.timer)
destroyed() {
clearInterval(this.timer);
},
methods: {
logout() {
......@@ -103,6 +149,60 @@ export default {
clock += ss;
return clock;
},
updatePwsd() {
let data = {
password: this.oldpwsd,
rememberMe: true,
username: localStorage.getItem("username"),
};
// 原密码校验
this.$server
.login(data)
.then((res) => {
// debugger
if (res.status === 200) {
let obj = {
enabled: true,
fullName: res.data.fullName,
password: this.newpwsd2,
userName: res.data.fullname,
};
localStorage.setItem('token',res.data.authorization)
if (this.newpwsd === this.newpwsd2) {
this.$server
.changePwsd(obj)
.then((res) => {
this.dialogshow = false;
if (res.status === 200) {
this.$message({
message: "密码修改成功",
type: "success",
});
this.oldpwsd = "";
this.newpwsd2 = "";
this.newpwsd = "";
}
})
.catch((err) => {
this.$message.error("密码修改失败");
console.log(err);
});
}else{
this.$message.error("两次密码不一致");
}
}
})
.catch((err) => {
this.$message.error("原密码错误");
console.log(err);
});
},
closeD() {
this.oldpwsd = "";
this.newpwsd2 = "";
this.newpwsd = "";
this.dialogshow = false
},
},
};
</script>
......@@ -145,6 +245,13 @@ export default {
align-items: center;
margin-right: 20px;
height: 80px;
.header-box {
display: flex;
align-items: center;
&:hover {
cursor: pointer;
}
}
.header-img {
width: 30px;
height: 30px;
......@@ -158,6 +265,26 @@ export default {
font-family: "AlibabaPuHuiTi-Regular";
color: #646464;
// line-height: 25px;
position: relative;
.list {
top: 65px;
left: -40px;
position: absolute;
background: #fff;
box-shadow: 0px 2px 6px 0px rgba(128, 139, 151, 0.3);
z-index: 10;
border-radius: 4px;
.item {
width: 100px;
text-align: center;
line-height: 40px;
&:hover {
cursor: pointer;
color: #fff;
background: #4176f0;
}
}
}
}
.blue-line {
width: 2px;
......@@ -245,4 +372,11 @@ export default {
}
}
}
.form {
.formItem {
.label {
margin: 10px 0;
}
}
}
</style>
<template>
<div class="layout">
<div class="theme-title">信创扫描助手</div>
<div class="bg">
</div>
<div class="login-left">
<div class="login-title">
<span style="font-size:56px;">信创&nbsp;</span><span>扫描助手</span>
</div>
<div class="split"></div>
<div class="left-bottom">
<div class="img-logo"></div>
<div class="logo-name">
<div class="login-resume">泰源信创适配实验室</div>
<div class="login-resume">0571-813000657</div>
</div>
</div>
</div>
<div class="login-content">
<div class="pass-title">欢迎登录</div>
<div class="grey-line">信创扫描助手管理平台</div>
<ul class="mian-css">
<li class="login-li">
<input class="login-input" v-model="userNameLogin" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');" type="text" placeholder="用户名"/><i class="user-icon input-icon"></i>
</li>
<li class="login-li">
<input class="login-input" v-model="passwordLogin" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');" type="password" placeholder="密码" @keyup.enter="login"/><i class="pwd-icon input-icon"></i>
</li>
<li class="login-li">
<button class="login-btn" @click="login">登录</button>
</li>
</ul>
<div class="layout">
<div class="theme-title">信创扫描助手</div>
<div class="bg"></div>
<div class="login-left">
<div class="login-title">
<span style="font-size: 56px">信创&nbsp;</span><span>扫描助手</span>
</div>
<div class="split"></div>
<div class="left-bottom">
<div class="img-logo"></div>
<div class="logo-name">
<div class="login-resume">泰源信创适配实验室</div>
<div class="login-resume">0571-813000657</div>
</div>
</div>
</div>
<div class="login-content">
<div class="pass-title">欢迎登录</div>
<div class="grey-line">信创扫描助手管理平台</div>
<ul class="mian-css">
<li class="login-li">
<input
class="login-input"
v-model="userNameLogin"
autocomplete="off"
readonly
onfocus="this.removeAttribute('readonly');"
type="text"
placeholder="用户名"
/><i class="user-icon input-icon"></i>
</li>
<li class="login-li">
<input
class="login-input"
v-model="passwordLogin"
autocomplete="off"
readonly
onfocus="this.removeAttribute('readonly');"
type="password"
placeholder="密码"
@keyup.enter="login"
/><i class="pwd-icon input-icon"></i>
</li>
<li class="login-li">
<button class="login-btn" @click="login">登录</button>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
name:"login",
data() {
return {
userNameLogin:'',
passwordLogin:''
}
},
methods: {
login(){
if(!this.userNameLogin){
this.$message.error('请输入用户名')
return
}
if(!this.passwordLogin){
this.$message.error('请输入密码')
return
}
let data = {
"password": this.passwordLogin,
"rememberMe": true,
"username": this.userNameLogin
}
name: "login",
data() {
return {
userNameLogin: "",
passwordLogin: "",
};
},
methods: {
login() {
if (!this.userNameLogin) {
this.$message.error("请输入用户名");
return;
}
if (!this.passwordLogin) {
this.$message.error("请输入密码");
return;
}
let data = {
password: this.passwordLogin,
rememberMe: true,
username: this.userNameLogin,
};
this.$server.login(data).then(res=>{
console.log(res);
if(res.status===200){
localStorage.setItem('token',res.data.authorization)
localStorage.setItem('id',res.data.companyId)
this.$router.push('/home')
}
})
}
this.$server
.login(data)
.then((res) => {
console.log(res);
if (res.status === 200) {
localStorage.setItem("token", res.data.authorization);
localStorage.setItem("id", res.data.companyId);
localStorage.setItem("name", res.data.fullname);
this.$router.push("/home");
}
})
.catch((err) => {
this.$message.error("登录失败");
console.log(err);
});
},
}
},
};
</script>
<style lang="less" scoped>
.layout{
width: 100%;
height: 100%;
// background-image: url("../assets/img/appBg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
box-sizing: border-box;
padding-top: 80px;
.bg{
width: 100%;
height:calc(100% - 80px);
position: absolute;
z-index: 0;
top: 80px;
left: 0;
background-image: url("../assets/img/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
}
.layout {
width: 100%;
height: 100%;
// background-image: url("../assets/img/appBg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
box-sizing: border-box;
padding-top: 80px;
.bg {
width: 100%;
height: calc(100% - 80px);
position: absolute;
z-index: 0;
top: 80px;
left: 0;
background-image: url("../assets/img/bg.png");
background-repeat: no-repeat;
background-size: 100% 100%;
}
}
.theme-title {
position: absolute;
width: 100%;
height: 80px;
box-sizing: border-box;
top: 0;
left: 0;
padding-left: 22px;
font-size: 36px;
font-family: "DFPLiJinHeiW8";
color: #1f295d;
line-height: 80px;
letter-spacing: 2px;
background-color: #fff;
}
.login-left {
z-index: 1;
width: 380px;
height: 560px;
background: rgba(96, 98, 111, 0.8);
border-radius: 10px 0px 0px 10px;
box-sizing: border-box;
padding-top: 112px;
padding-left: 51px;
.login-title {
// width: 186px;
width: 100%;
height: 42px;
font-family: "Alibaba-PuHuiTi-Light";
font-size: 28px;
font-weight: normal;
font-stretch: normal;
line-height: 26px;
letter-spacing: 3px;
color: #ffffff;
}
.split {
width: 42px;
height: 3px;
background-color: #ffffff;
margin-top: 28px;
margin-bottom: 90px;
margin-left: 5px;
}
.left-bottom {
width: 100%;
display: flex;
height: 72px;
.img-logo {
width: 41px;
height: 72px;
background-image: url("../assets/img/logo.png");
background-size: 100% 100%;
background-repeat: no-repeat;
margin-right: 28px;
}
.theme-title{
position: absolute;
width: 100%;
height: 80px;
box-sizing: border-box;
top: 0;
left: 0;
padding-left: 22px;
font-size: 36px;
font-family: "DFPLiJinHeiW8";
color: #1F295D;
line-height: 80px;
letter-spacing: 2px;
background-color: #fff;
}
.login-resume {
width: 100%;
height: 25px;
font-family: "AlibabaPuHuiTi-Regular";
font-size: 18px;
font-weight: normal;
font-stretch: normal;
line-height: 25px;
letter-spacing: 1px;
margin-bottom: 21px;
color: #f3f3f3;
}
}
.login-content {
z-index: 1;
width: 540px;
height: 560px;
background-color: #ffffff;
box-shadow: 0px 2px 20px 0px rgba(6, 25, 72, 0.3);
border-radius: 0px 10px 10px 0px;
box-sizing: border-box;
padding: 80px 52px 0 52px;
.pass-title {
height: 24px;
font-size: 26px;
font-family: "AlibabaPuHuiTi-Medium";
font-size: 26px;
font-weight: normal;
font-stretch: normal;
line-height: 26px;
letter-spacing: 0px;
color: #5d5c5c;
}
.blue-line {
width: 105px;
height: 3px;
background-color: #0e2c73;
border-radius: 1px;
z-index: 1;
left: 0;
top: -1px;
position: absolute;
letter-spacing: 1px;
// top: 1px;
}
.grey-line {
margin-top: 12px;
margin-bottom: 50px;
// width: 163px;
height: 22px;
font-size: 16px;
font-family: "AlibabaPuHuiTi-Regular";
letter-spacing: 1px;
font-weight: normal;
color: #a6a6a6;
line-height: 22px;
}
.login-input {
width: 420px;
height: 56px;
font-family: "AlibabaPuHuiTi-Regular";
box-sizing: border-box;
font-size: 18px;
font-weight: normal;
font-stretch: normal;
line-height: 10px;
letter-spacing: 0px;
border-radius: 5px;
color: #a8acba;
background-color: #fcfdff;
margin-bottom: 44px;
border: solid 1px #b9d3e8;
// border: none;
position: relative;
// background-image: url("../assets/images/login-input.png") !important;
padding-left: 62px;
}
.login-li {
position: relative;
.input-icon {
position: absolute;
left: 22px;
top: 18px;
}
.login-left{
z-index: 1;
width: 380px;
height: 560px;
background: rgba(96, 98, 111, 0.8);
border-radius: 10px 0px 0px 10px;
box-sizing: border-box;
padding-top: 112px;
padding-left: 51px;
.login-title{
// width: 186px;
width: 100%;
height: 42px;
font-family: "Alibaba-PuHuiTi-Light";
font-size: 28px;
font-weight: normal;
font-stretch: normal;
line-height: 26px;
letter-spacing: 3px;
color: #ffffff;
}
.split{
width: 42px;
height: 3px;
background-color: #ffffff;
margin-top: 28px;
margin-bottom: 90px;
margin-left: 5px;
}
.left-bottom{
width: 100%;
display: flex;
height: 72px;
.img-logo{
width: 41px;
height: 72px;
background-image: url('../assets/img/logo.png');
background-size: 100% 100%;
background-repeat: no-repeat;
margin-right: 28px;
}
}
.login-resume{
width: 100%;
height: 25px;
font-family: "AlibabaPuHuiTi-Regular";
font-size: 18px;
font-weight: normal;
font-stretch: normal;
line-height: 25px;
letter-spacing: 1px;
margin-bottom: 21px;
color: #f3f3f3;
}
.user-icon {
width: 24px;
height: 22px;
background-image: url("../assets/img/user.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
.login-content{
z-index: 1;
width: 540px;
height: 560px;
background-color: #ffffff;
box-shadow: 0px 2px 20px 0px
rgba(6, 25, 72, 0.3);
border-radius: 0px 10px 10px 0px;
box-sizing: border-box;
padding: 80px 52px 0 52px;
.pass-title{
height: 24px;
font-size: 26px;
font-family: "AlibabaPuHuiTi-Medium";
font-size: 26px;
font-weight: normal;
font-stretch: normal;
line-height: 26px;
letter-spacing: 0px;
color: #5D5C5C;
}
.blue-line{
width: 105px;
height: 3px;
background-color: #0e2c73;
border-radius: 1px;
z-index: 1;
left: 0;
top: -1px;
position: absolute;
letter-spacing: 1px;
// top: 1px;
}
.grey-line{
margin-top: 12px;
margin-bottom: 50px;
// width: 163px;
height: 22px;
font-size: 16px;
font-family: "AlibabaPuHuiTi-Regular";
letter-spacing: 1px;
font-weight: normal;
color: #A6A6A6;
line-height: 22px;
}
.login-input{
width: 420px;
height: 56px;
font-family: "AlibabaPuHuiTi-Regular";
box-sizing: border-box;
font-size: 18px;
font-weight: normal;
font-stretch: normal;
line-height: 10px;
letter-spacing: 0px;
border-radius: 5px;
color: #A8ACBA;
background-color: #FCFDFF;
margin-bottom: 44px;
border: solid 1px #B9D3E8;
// border: none;
position: relative;
// background-image: url("../assets/images/login-input.png") !important;
padding-left: 62px;
}
.login-li{
position: relative;
.input-icon{
position: absolute;
left: 22px;
top: 18px;
}
.user-icon{
width: 24px;
height: 22px;
background-image: url('../assets/img/user.png');
background-size: 100% 100%;
background-repeat: no-repeat;
}
.pwd-icon{
width: 20px;
height: 22px;
background-image: url('../assets/img/pass.png');
background-size: 100% 100%;
background-repeat: no-repeat;
}
}
.login-input:focus{
background-color: #fff;
border: solid 1px #306fd7;
}
.login-btn{
width: 420px;
background: #4658AD;
height: 56px;
// background-image: url(../assets/img/login.png);
border: none;
font-family: "AlibabaPuHuiTi-Regular";
font-size: 22px;
font-weight: normal;
font-stretch: normal;
line-height: 56px;
letter-spacing: 7px;
cursor: pointer;
box-sizing: border-box;
margin-top: 10px;
padding-bottom: 8px;
border-radius: 5px;
color: #ffffff;
}
.login-btn:hover{
opacity: 0.8;
// background-image: url(../assets/img/login-hover.png);
}
// input::-webkit-input-placeholder {
// color: #333333;
// }
// input:-moz-placeholder {
// color: #333333;
// }
// input:-ms-input-placeholder {
// color: #333333;
// }
.pwd-icon {
width: 20px;
height: 22px;
background-image: url("../assets/img/pass.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
}
.login-input:focus {
background-color: #fff;
border: solid 1px #306fd7;
}
.login-btn {
width: 420px;
background: #4658ad;
height: 56px;
// background-image: url(../assets/img/login.png);
border: none;
font-family: "AlibabaPuHuiTi-Regular";
font-size: 22px;
font-weight: normal;
font-stretch: normal;
line-height: 56px;
letter-spacing: 7px;
cursor: pointer;
box-sizing: border-box;
margin-top: 10px;
padding-bottom: 8px;
border-radius: 5px;
color: #ffffff;
}
.login-btn:hover {
opacity: 0.8;
// background-image: url(../assets/img/login-hover.png);
}
// input::-webkit-input-placeholder {
// color: #333333;
// }
// input:-moz-placeholder {
// color: #333333;
// }
// input:-ms-input-placeholder {
// color: #333333;
// }
}
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论