Commit 9d7c3ec9 by 潘建波

提交修改个人密码

1 parent ff0930a2
No preview for this file type
......@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) {
case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = "http://192.168.9.62:20080"; // 测试环境url
baseUrl = "http://192.168.9.149:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
......
......@@ -14,7 +14,7 @@ export default {
return api.post(`${baseUrl}/api/v1/auth/users/${id}`, params)
},
resetPwd(params,id) {
return api.post(`${baseUrl}/api/v1/devconf_fx/users/${id}/reset`, params)
return api.post(`${baseUrl}/api/v1/auth/users/${id}/password`, params)
},
delUser(params,id){
return api.delete(`${baseUrl}/api/v1/auth/users/${id}`, params)
......
......@@ -39,7 +39,14 @@ export const constantRouterMap = [
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: resolve => require(["../views/Show.vue"], resolve)
}
},{
path: "/resetpass",
name: "resetpassword",
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: resolve => require(["../views/Resetpassword.vue"], resolve)
},
];
export const asyncRouterMap = [
{
......
......@@ -14,7 +14,7 @@
></span>
<div class="headRight">
<span>{{ curdate }}</span>
<img src="../../assets/img/home/user.png" alt="" />
<img @click="resetpass" src="../../assets/img/home/user.png" alt="" />
<span class="exit" @click="logout()"
>退出<i class="el-icon-arrow-down"></i
></span>
......@@ -129,6 +129,9 @@ export default {
this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken");
this.$router.push("/login").catch(err => {err});
},
resetpass(){
this.$router.push("/resetpass").catch(err => {err});
}
},
created() {
......
<template>
<div class="passform-box">
<div class="re-header">重置密码</div>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
class="passform"
>
<div class="passformitem">
<el-form-item label="旧密码" prop="oldpassword">
<el-input v-model="ruleForm.oldpassword" type="password"></el-input>
</el-form-item>
</div>
<div class="passformitem">
<el-form-item label="新密码" prop="newpassword">
<el-input v-model="ruleForm.newpassword" type="password"></el-input>
</el-form-item>
</div>
<div class="passformitem">
<el-form-item label="密码确认" prop="checknewpassword">
<el-input
v-model="ruleForm.checknewpassword"
type="password"
></el-input>
</el-form-item>
</div>
<el-form-item>
<el-button @click="back('ruleForm')">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')"
>提交</el-button
>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
data() {
var validatePass = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入密码"));
} else {
if (this.ruleForm.checkPass !== "") {
this.$refs.ruleForm.validateField("checkPass");
}
callback();
}
};
var validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.ruleForm.newpassword) {
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
return {
ruleForm: {
oldpassword: "",
newpassword: "",
checknewpassword: ""
},
rules: {
oldpassword: [
{ required: true, message: "请输入旧密码", trigger: "blur" }
],
newpassword: [
{ validator: validatePass, trigger: "blur" },
{ required: true, message: "", trigger: "blur" }
],
checknewpassword: [
{ validator: validatePass2, trigger: "blur" },
{ required: true, message: "", trigger: "blur" }
]
}
};
},
methods: {
submitForm(formName) {
let data = {
old_pwd: this.ruleForm.oldpassword,
new_pwd: this.ruleForm.newpassword
};
this.$refs[formName].validate(valid => {
if (valid) {
let user_unid = sessionStorage.getItem("user_unid");
this.$api.ops.resetPwd(data, user_unid).then(res => {
this.$router.push("/login");
});
} else {
console.log("error submit!!");
return false;
}
});
},
back() {
this.$router.back(-1);
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
}
};
</script>
<style>
.passform {
margin: 20px;
width: 400px;
}
.passformitem {
margin-bottom: 20px;
}
.passform-box{
width: 400px;
}
.re-header{
margin-left: 60px;
margin-top: 20px;
}
</style>
......@@ -161,6 +161,9 @@
<script>
import { SVG } from "@svgdotjs/svg.js";
var draw = null;
var childgroup = null;
var levalgroup = null;
var levalinecolor = "#333";
export default {
data() {
return {
......@@ -222,9 +225,7 @@ export default {
};
this.curDevData = dev;
this.$api.device.getSubdev(this.parentData, obj).then(res => {
for (var i = 0; i < 10; i++) {
this.slaveData.push(res.list_data);
}
this.slaveData = res.list_data;
this.createdLeval(ev, this.slaveData);
});
},
......@@ -266,13 +267,14 @@ export default {
var _this = this;
var nested = draw
.nested()
.size(120, 40)
.size(130, 40)
.move(50, 50)
.data("sdv", data);
var rect = nested
.rect(120, 40)
.attr({ fill: "#f06" })
.radius(5);
.rect(130, 40)
.attr({ fill: "#123e6c", opacity: 0.6 })
.stroke({ color: "#333", opacity: 0.5, width: 1 })
.radius(3);
var text = nested.text(function(add) {
add
.tspan(`${data.device_name}`)
......@@ -286,32 +288,38 @@ export default {
});
},
createdChild(data) {
if (childgroup) {
childgroup.clear();
}
childgroup = draw.group();
var _this = this;
data.map((ele, index) => {
let point = {
x: 200,
y: 70 * (index + 1) + 50
y: 65 * (index + 1) + 70
};
var polyline = draw
var polyline = childgroup
.polyline([
[110, 90],
[110, point.y - 45],
[110, point.y + 20],
[200, point.y + 20]
])
.stroke({ width: 1, color: "red" });
.stroke({ width: 1, color: "#ddd" });
polyline.fill("none").stroke({
width: 2,
color: "red"
width: 1,
color: "#333"
});
ele.color = this.setsubcolor(index);
var nested = draw
.nested()
.size(120, 40)
.size(130, 40)
.move(point.x, point.y)
.data("childsdv", ele);
var rect = nested
.rect(120, 40)
.attr({ fill: "#f06" })
.radius(5);
.rect(130, 40)
.stroke({ color: "#333", opacity: 0.5, width: 1 })
.attr({ fill: `rgb(${_this.setsubcolor(index)})`, opacity: 0.6 })
.radius(3);
var text = nested.text(function(add) {
add
.tspan(`${ele.device_name}`)
......@@ -319,15 +327,23 @@ export default {
.fill({ color: "#fff" }),
add.tspan(`${ele.in_ip}`).newLine();
});
childgroup.add(nested);
nested.click(function() {
let data = this.data("childsdv");
this.curDevData = data;
_this.getleval(this, data);
levalinecolor = data.color;
});
});
},
createdLeval(ev, data) {
let num = Math.ceil(data.length/6);
for(let i = 0; i < num; i++){
if (levalgroup) {
levalgroup.clear();
}
var polyline = "";
levalgroup = draw.group();
let num = Math.ceil(data.length / 6);
for (let i = 0; i <= num; i++) {
var laveData = this.setslaveData(data, i);
//当前点击节点信息
let linepoint = {
......@@ -335,45 +351,65 @@ export default {
y: ev.y() + 20
};
var _this = this;
console.log(laveData);
laveData.map((ele, index) => {
let point = {
x: 330 * i + 430,
y: linepoint.y + i * 70 + 30
x: 250 * i + 430,
y: linepoint.y + index * 65 + 30
};
if (index == 0) {
if (index == 0 && i == num - 1) {
var line = draw
.polyline([
[linepoint.x, linepoint.y],
[400, point.y - (index == 0 ? 30 : 58)]
[point.x - 50, point.y - (index == 0 ? 30 : 58)]
])
.stroke({ width: 1, color: "red" });
line.fill("none").stroke({
width: 2,
color: "green"
width: 1,
color: `rgb(${levalinecolor})`
});
levalgroup.add(line);
}
if (linepoint.y < 200) {
var polyline = draw
if (linepoint.y < 500) {
polyline = draw
.polyline([
[400, linepoint.y],
[400, point.y + 20],
[450, point.y + 20]
[point.x - 50, linepoint.y],
[point.x - 50, point.y + 20],
[point.x + 50, point.y + 20]
])
.stroke({ width: 1, color: "red" });
.stroke({ width: 1, color: `rgb(${levalinecolor})` });
polyline.fill("none").stroke({
width: 2,
color: "red"
width: 1,
color: `rgb(${levalinecolor})`
});
levalgroup.add(polyline);
} else {
point = {
x: 250 * i + 430,
y: linepoint.y - index * 70 - 90
};
polyline = draw
.polyline([
[point.x - 50, linepoint.y],
[point.x - 50, point.y + 20],
[point.x + 50, point.y + 20]
])
.stroke({ width: 1, color: `rgb(${levalinecolor})` });
polyline.fill("none").stroke({
width: 1,
color: `rgb(${levalinecolor})`
});
levalgroup.add(polyline);
}
var nested = draw
.nested()
.size(120, 40)
.size(130, 40)
.move(point.x, point.y)
.data("childsdv", ele);
var rect = nested
.rect(120, 40)
.attr({ fill: "#f06" })
.radius(5);
.rect(130, 40)
.attr({ fill: `rgb(${_this.setsubcolor(index)})` })
.radius(3);
var text = nested.text(function(add) {
add
.tspan(`${ele.device_name}`)
......@@ -381,14 +417,14 @@ export default {
.fill({ color: "#fff" }),
add.tspan(`${ele.in_ip}`).newLine();
});
levalgroup.add(nested);
//事件点击
nested.click(function() {
let data = this.data("childsdv");
_this.getleval(this, data);
this.curDevData = data;
});
});
}
}
},
setslaveData(data, index) {
return data.slice(index * 6, 6 * (index + 1));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!