提交 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>
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论