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

zwh

上级 41e4d517
...@@ -4,7 +4,7 @@ switch (env) { ...@@ -4,7 +4,7 @@ switch (env) {
case 'production': case 'production':
// baseUrl = "http://192.168.101.205:8086"; // 徐/ // baseUrl = "http://192.168.101.205:8086"; // 徐/
// baseUrl = "http://192.168.102.97: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://223.4.69.30:8081"; // 阿里云环境
// baseUrl = "http://192.168.101.205:8086/activities" // baseUrl = "http://192.168.101.205:8086/activities"
break; break;
......
...@@ -18,17 +18,24 @@ const server = { ...@@ -18,17 +18,24 @@ const server = {
method: 'get' method: 'get'
}) })
}, },
getNum(data) { getNum(data) { // 购买数量获取
return axios(`/ac/nums?companyId=${data}`, { return axios(`/ac/nums?companyId=${data}`, {
data, data,
method: 'get' method: 'get'
}) })
}, },
getList(data) { getList(data) { // mac列表获取
return axios(`/ac/acCode?companyId=${data.companyId}&page=${data.page}&size=${data.size}&mac=${data.mac}`, { return axios(`/ac/acCode?companyId=${data.companyId}&page=${data.page}&size=${data.size}&mac=${data.mac}`, {
data, data,
method: 'get' method: 'get'
}) })
},
changePwsd(data){
return axios(`/users`,{
data,
method:'put'
})
} }
} }
......
...@@ -7,17 +7,17 @@ ...@@ -7,17 +7,17 @@
<div class="title-name">授权绑定</div> <div class="title-name">授权绑定</div>
</div> </div>
<div class="bind-input"> <div class="bind-input">
<div class="bind-name">序列号:</div> <div class="bind-name">MAC地址:</div>
<div class="bind-size"> <div class="bind-size">
<el-input placeholder="请输入序列号" v-model="serial"></el-input> <el-input placeholder="请输入MAC地址" v-model="serial"></el-input>
</div> </div>
</div> </div>
<div class="bind-input"> <div class="bind-input">
<div class="bind-name">激活码:</div> <div class="bind-name">授权码:</div>
<div class="bind-size2"> <div class="bind-size2">
<el-input placeholder="激活码" v-model="Activation"></el-input> <el-input placeholder="授权码" v-model="Activation" :disabled="true"></el-input>
</div> </div>
<div class="bind-btn" @click="getRandom">激活</div> <div class="bind-btn" @click="getRandom">生成授权码</div>
</div> </div>
</div> </div>
<div class="use-num same-padding"> <div class="use-num same-padding">
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
this.$server.acRandom(param).then((res) => { this.$server.acRandom(param).then((res) => {
if (res.status === 200) { if (res.status === 200) {
this.Activation = res.data.code; this.Activation = res.data.code;
this.getList()
} }
}); });
}, },
...@@ -226,12 +227,13 @@ export default { ...@@ -226,12 +227,13 @@ export default {
} }
} }
.bind-name { .bind-name {
width: 72px; width: 105px;
height: 25px; height: 25px;
font-size: 18px; font-size: 18px;
// font-family: AlibabaPuHuiTiR; text-align: end;
color: #747c93; color: #747c93;
line-height: 25px; line-height: 25px;
margin-right: 10px;
} }
.bind-size { .bind-size {
width: 600px; width: 600px;
......
...@@ -6,8 +6,19 @@ ...@@ -6,8 +6,19 @@
<div class="time">当前时间{{ time }}</div> <div class="time">当前时间{{ time }}</div>
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="header-box" @click="isShowList = true">
<div class="header-img"></div> <div class="header-img"></div>
<div class="username">管理员</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="blue-line"></div>
<div class="login-out" @click="logout">退出</div> <div class="login-out" @click="logout">退出</div>
</div> </div>
...@@ -39,6 +50,35 @@ ...@@ -39,6 +50,35 @@
<router-view></router-view> <router-view></router-view>
</div> </div>
</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> </div>
</template> </template>
...@@ -49,30 +89,36 @@ export default { ...@@ -49,30 +89,36 @@ export default {
data() { data() {
return { return {
nowRouter: "home", nowRouter: "home",
time:null, time: null,
timer:null, timer: null,
fullname: "",
isShowList: false,
dialogshow: false,
newpwsd: "",
newpwsd2: "",
oldpwsd: "",
}; };
}, },
watch: { watch: {
"$route.path": { "$route.path": {
handler(newName, oldName) { handler(newName, oldName) {
//     console.log(newName);
this.nowRouter = newName; this.nowRouter = newName;
}, },
immediate: true, immediate: true,
}, },
}, },
created() { created() {
if(!localStorage.getItem('token')){ this.fullname = localStorage.getItem("name");
this.$router.replace('/login') if (!localStorage.getItem("token")) {
return this.$router.replace("/login");
return;
} }
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.time = this.getTime() this.time = this.getTime();
}, 1000); }, 1000);
}, },
destroyed(){ destroyed() {
clearInterval(this.timer) clearInterval(this.timer);
}, },
methods: { methods: {
logout() { logout() {
...@@ -103,6 +149,60 @@ export default { ...@@ -103,6 +149,60 @@ export default {
clock += ss; clock += ss;
return clock; 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> </script>
...@@ -145,6 +245,13 @@ export default { ...@@ -145,6 +245,13 @@ export default {
align-items: center; align-items: center;
margin-right: 20px; margin-right: 20px;
height: 80px; height: 80px;
.header-box {
display: flex;
align-items: center;
&:hover {
cursor: pointer;
}
}
.header-img { .header-img {
width: 30px; width: 30px;
height: 30px; height: 30px;
...@@ -158,6 +265,26 @@ export default { ...@@ -158,6 +265,26 @@ export default {
font-family: "AlibabaPuHuiTi-Regular"; font-family: "AlibabaPuHuiTi-Regular";
color: #646464; color: #646464;
// line-height: 25px; // 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 { .blue-line {
width: 2px; width: 2px;
...@@ -245,4 +372,11 @@ export default { ...@@ -245,4 +372,11 @@ export default {
} }
} }
} }
.form {
.formItem {
.label {
margin: 10px 0;
}
}
}
</style> </style>
<template> <template>
<div class="layout"> <div class="layout">
<div class="theme-title">信创扫描助手</div> <div class="theme-title">信创扫描助手</div>
<div class="bg"> <div class="bg"></div>
</div>
<div class="login-left"> <div class="login-left">
<div class="login-title"> <div class="login-title">
<span style="font-size:56px;">信创&nbsp;</span><span>扫描助手</span> <span style="font-size: 56px">信创&nbsp;</span><span>扫描助手</span>
</div> </div>
<div class="split"></div> <div class="split"></div>
<div class="left-bottom"> <div class="left-bottom">
...@@ -22,10 +20,27 @@ ...@@ -22,10 +20,27 @@
<div class="grey-line">信创扫描助手管理平台</div> <div class="grey-line">信创扫描助手管理平台</div>
<ul class="mian-css"> <ul class="mian-css">
<li class="login-li"> <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> <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>
<li class="login-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> <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>
<li class="login-li"> <li class="login-li">
<button class="login-btn" @click="login">登录</button> <button class="login-btn" @click="login">登录</button>
...@@ -36,43 +51,50 @@ ...@@ -36,43 +51,50 @@
</template> </template>
<script> <script>
export default { export default {
name:"login", name: "login",
data() { data() {
return { return {
userNameLogin:'', userNameLogin: "",
passwordLogin:'' passwordLogin: "",
} };
}, },
methods: { methods: {
login(){ login() {
if(!this.userNameLogin){ if (!this.userNameLogin) {
this.$message.error('请输入用户名') this.$message.error("请输入用户名");
return return;
} }
if(!this.passwordLogin){ if (!this.passwordLogin) {
this.$message.error('请输入密码') this.$message.error("请输入密码");
return return;
} }
let data = { let data = {
"password": this.passwordLogin, password: this.passwordLogin,
"rememberMe": true, rememberMe: true,
"username": this.userNameLogin username: this.userNameLogin,
} };
this.$server.login(data).then(res=>{ this.$server
.login(data)
.then((res) => {
console.log(res); console.log(res);
if(res.status===200){ if (res.status === 200) {
localStorage.setItem('token',res.data.authorization) localStorage.setItem("token", res.data.authorization);
localStorage.setItem('id',res.data.companyId) localStorage.setItem("id", res.data.companyId);
this.$router.push('/home') localStorage.setItem("name", res.data.fullname);
this.$router.push("/home");
} }
}) })
} .catch((err) => {
this.$message.error("登录失败");
console.log(err);
});
}, },
} },
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.layout{ .layout {
width: 100%; width: 100%;
height: 100%; height: 100%;
// background-image: url("../assets/img/appBg.png"); // background-image: url("../assets/img/appBg.png");
...@@ -84,9 +106,9 @@ export default { ...@@ -84,9 +106,9 @@ export default {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
padding-top: 80px; padding-top: 80px;
.bg{ .bg {
width: 100%; width: 100%;
height:calc(100% - 80px); height: calc(100% - 80px);
position: absolute; position: absolute;
z-index: 0; z-index: 0;
top: 80px; top: 80px;
...@@ -95,8 +117,8 @@ export default { ...@@ -95,8 +117,8 @@ export default {
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
} }
.theme-title{ .theme-title {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 80px; height: 80px;
...@@ -106,12 +128,12 @@ export default { ...@@ -106,12 +128,12 @@ export default {
padding-left: 22px; padding-left: 22px;
font-size: 36px; font-size: 36px;
font-family: "DFPLiJinHeiW8"; font-family: "DFPLiJinHeiW8";
color: #1F295D; color: #1f295d;
line-height: 80px; line-height: 80px;
letter-spacing: 2px; letter-spacing: 2px;
background-color: #fff; background-color: #fff;
} }
.login-left{ .login-left {
z-index: 1; z-index: 1;
width: 380px; width: 380px;
height: 560px; height: 560px;
...@@ -120,7 +142,7 @@ export default { ...@@ -120,7 +142,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding-top: 112px; padding-top: 112px;
padding-left: 51px; padding-left: 51px;
.login-title{ .login-title {
// width: 186px; // width: 186px;
width: 100%; width: 100%;
height: 42px; height: 42px;
...@@ -132,7 +154,7 @@ export default { ...@@ -132,7 +154,7 @@ export default {
letter-spacing: 3px; letter-spacing: 3px;
color: #ffffff; color: #ffffff;
} }
.split{ .split {
width: 42px; width: 42px;
height: 3px; height: 3px;
background-color: #ffffff; background-color: #ffffff;
...@@ -140,20 +162,20 @@ export default { ...@@ -140,20 +162,20 @@ export default {
margin-bottom: 90px; margin-bottom: 90px;
margin-left: 5px; margin-left: 5px;
} }
.left-bottom{ .left-bottom {
width: 100%; width: 100%;
display: flex; display: flex;
height: 72px; height: 72px;
.img-logo{ .img-logo {
width: 41px; width: 41px;
height: 72px; height: 72px;
background-image: url('../assets/img/logo.png'); background-image: url("../assets/img/logo.png");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
margin-right: 28px; margin-right: 28px;
} }
} }
.login-resume{ .login-resume {
width: 100%; width: 100%;
height: 25px; height: 25px;
font-family: "AlibabaPuHuiTi-Regular"; font-family: "AlibabaPuHuiTi-Regular";
...@@ -165,18 +187,17 @@ export default { ...@@ -165,18 +187,17 @@ export default {
margin-bottom: 21px; margin-bottom: 21px;
color: #f3f3f3; color: #f3f3f3;
} }
} }
.login-content{ .login-content {
z-index: 1; z-index: 1;
width: 540px; width: 540px;
height: 560px; height: 560px;
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0px 2px 20px 0px box-shadow: 0px 2px 20px 0px rgba(6, 25, 72, 0.3);
rgba(6, 25, 72, 0.3);
border-radius: 0px 10px 10px 0px; border-radius: 0px 10px 10px 0px;
box-sizing: border-box; box-sizing: border-box;
padding: 80px 52px 0 52px; padding: 80px 52px 0 52px;
.pass-title{ .pass-title {
height: 24px; height: 24px;
font-size: 26px; font-size: 26px;
font-family: "AlibabaPuHuiTi-Medium"; font-family: "AlibabaPuHuiTi-Medium";
...@@ -185,9 +206,9 @@ export default { ...@@ -185,9 +206,9 @@ export default {
font-stretch: normal; font-stretch: normal;
line-height: 26px; line-height: 26px;
letter-spacing: 0px; letter-spacing: 0px;
color: #5D5C5C; color: #5d5c5c;
} }
.blue-line{ .blue-line {
width: 105px; width: 105px;
height: 3px; height: 3px;
background-color: #0e2c73; background-color: #0e2c73;
...@@ -199,7 +220,7 @@ export default { ...@@ -199,7 +220,7 @@ export default {
letter-spacing: 1px; letter-spacing: 1px;
// top: 1px; // top: 1px;
} }
.grey-line{ .grey-line {
margin-top: 12px; margin-top: 12px;
margin-bottom: 50px; margin-bottom: 50px;
// width: 163px; // width: 163px;
...@@ -208,10 +229,10 @@ export default { ...@@ -208,10 +229,10 @@ export default {
font-family: "AlibabaPuHuiTi-Regular"; font-family: "AlibabaPuHuiTi-Regular";
letter-spacing: 1px; letter-spacing: 1px;
font-weight: normal; font-weight: normal;
color: #A6A6A6; color: #a6a6a6;
line-height: 22px; line-height: 22px;
} }
.login-input{ .login-input {
width: 420px; width: 420px;
height: 56px; height: 56px;
font-family: "AlibabaPuHuiTi-Regular"; font-family: "AlibabaPuHuiTi-Regular";
...@@ -222,44 +243,44 @@ export default { ...@@ -222,44 +243,44 @@ export default {
line-height: 10px; line-height: 10px;
letter-spacing: 0px; letter-spacing: 0px;
border-radius: 5px; border-radius: 5px;
color: #A8ACBA; color: #a8acba;
background-color: #FCFDFF; background-color: #fcfdff;
margin-bottom: 44px; margin-bottom: 44px;
border: solid 1px #B9D3E8; border: solid 1px #b9d3e8;
// border: none; // border: none;
position: relative; position: relative;
// background-image: url("../assets/images/login-input.png") !important; // background-image: url("../assets/images/login-input.png") !important;
padding-left: 62px; padding-left: 62px;
} }
.login-li{ .login-li {
position: relative; position: relative;
.input-icon{ .input-icon {
position: absolute; position: absolute;
left: 22px; left: 22px;
top: 18px; top: 18px;
} }
.user-icon{ .user-icon {
width: 24px; width: 24px;
height: 22px; height: 22px;
background-image: url('../assets/img/user.png'); background-image: url("../assets/img/user.png");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.pwd-icon{ .pwd-icon {
width: 20px; width: 20px;
height: 22px; height: 22px;
background-image: url('../assets/img/pass.png'); background-image: url("../assets/img/pass.png");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
} }
.login-input:focus{ .login-input:focus {
background-color: #fff; background-color: #fff;
border: solid 1px #306fd7; border: solid 1px #306fd7;
} }
.login-btn{ .login-btn {
width: 420px; width: 420px;
background: #4658AD; background: #4658ad;
height: 56px; height: 56px;
// background-image: url(../assets/img/login.png); // background-image: url(../assets/img/login.png);
border: none; border: none;
...@@ -276,7 +297,7 @@ export default { ...@@ -276,7 +297,7 @@ export default {
border-radius: 5px; border-radius: 5px;
color: #ffffff; color: #ffffff;
} }
.login-btn:hover{ .login-btn:hover {
opacity: 0.8; opacity: 0.8;
// background-image: url(../assets/img/login-hover.png); // background-image: url(../assets/img/login-hover.png);
} }
...@@ -289,5 +310,5 @@ export default { ...@@ -289,5 +310,5 @@ export default {
// input:-ms-input-placeholder { // input:-ms-input-placeholder {
// color: #333333; // color: #333333;
// } // }
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论