修改登录
parent
f3f55d2c88
commit
dad69ea7f7
|
@ -4,18 +4,18 @@ import {
|
||||||
const infoApi = {
|
const infoApi = {
|
||||||
// 获取设备信息
|
// 获取设备信息
|
||||||
getSys() {
|
getSys() {
|
||||||
return postPBRequest("/info", null, 51000);
|
return postPBRequest("/system", null, 57000);
|
||||||
},
|
},
|
||||||
// 获取网络信息
|
// 获取网络信息
|
||||||
getNet(params) {
|
getNet(params) {
|
||||||
return postPBRequest("/net", params, 52000);
|
return postPBRequest("/system", params, 57001);
|
||||||
},
|
},
|
||||||
saveNet(params) {
|
saveNet(params) {
|
||||||
return postPBRequest("/net", params, 52200);
|
return postPBRequest("/system", params, 57201);
|
||||||
},
|
},
|
||||||
// 重启设备
|
// 重启设备
|
||||||
reboot() {
|
reboot() {
|
||||||
return postPBRequest("/user", null, 50003);
|
return postPBRequest("/system", null, 57202);
|
||||||
},
|
},
|
||||||
// // 透传列表
|
// // 透传列表
|
||||||
// getTc(params) {
|
// getTc(params) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
const myApi = {
|
const myApi = {
|
||||||
// 登录状态查询
|
// 登录状态查询
|
||||||
loginStatus() {
|
loginStatus() {
|
||||||
return postPBRequest('/user', null, 50000);
|
return postPBRequest('/system', null, 50000);
|
||||||
},
|
},
|
||||||
// 登录
|
// 登录
|
||||||
login(params = {}) {
|
login(params = {}) {
|
||||||
|
@ -12,11 +12,11 @@ const myApi = {
|
||||||
},
|
},
|
||||||
// 退出登陆
|
// 退出登陆
|
||||||
logout() {
|
logout() {
|
||||||
return postPBRequest('/user', null, 50002);
|
return postPBRequest('/system', null, 50002);
|
||||||
},
|
},
|
||||||
// 修改密码
|
// 修改密码
|
||||||
editPass(params = {}) {
|
editPass(params = {}) {
|
||||||
return postPBRequest('/user', params, 90201);
|
return postPBRequest('/system', params, 90201);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default myApi;
|
export default myApi;
|
|
@ -53,17 +53,17 @@ export default {
|
||||||
rules: {
|
rules: {
|
||||||
oldPass: [
|
oldPass: [
|
||||||
{ required: true, message: "请输入密码", trigger: "blur" },
|
{ required: true, message: "请输入密码", trigger: "blur" },
|
||||||
{ min: 6, max: 18, message: "长度在6到18个字符", trigger: "blur" },
|
{ min: 2, max: 18, message: "长度在2到18个字符", trigger: "blur" },
|
||||||
{ required: true, validator: checkPass, trigger: "blur" },
|
{ required: true, validator: checkPass, trigger: "blur" },
|
||||||
],
|
],
|
||||||
newPass: [
|
newPass: [
|
||||||
{ required: true, message: "请输入密码", trigger: "blur" },
|
{ required: true, message: "请输入密码", trigger: "blur" },
|
||||||
{ min: 6, max: 18, message: "长度在6到18个字符", trigger: "blur" },
|
{ min: 5, max: 20, message: "长度在5到20个字符", trigger: "blur" },
|
||||||
{ required: true, validator: checkPass, trigger: "blur" },
|
{ required: true, validator: checkPass, trigger: "blur" },
|
||||||
],
|
],
|
||||||
confirmPass: [
|
confirmPass: [
|
||||||
{ required: true, message: "请输入密码", trigger: "blur" },
|
{ required: true, message: "请输入密码", trigger: "blur" },
|
||||||
{ min: 6, max: 18, message: "长度在6到18个字符", trigger: "blur" },
|
{ min: 5, max: 20, message: "长度在5到20个字符", trigger: "blur" },
|
||||||
{ required: true, validator: validatePassCheck, trigger: "blur" },
|
{ required: true, validator: validatePassCheck, trigger: "blur" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -96,11 +96,11 @@ export default {
|
||||||
}
|
}
|
||||||
const res = await myApi.editPass(param);
|
const res = await myApi.editPass(param);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
ElMessage.success(res.message|| "请求成功");
|
ElMessage.success(res.data|| "请求成功");
|
||||||
// 关闭弹框
|
// 关闭弹框
|
||||||
ctx.emit("dialogSuccess");
|
ctx.emit("dialogSuccess");
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.message);
|
ElMessage.error(res.data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<el-card class="content-div">
|
<el-card class="content-div">
|
||||||
<div class="all-content">
|
<div class="all-content">
|
||||||
<div class="time-div">
|
<div class="time-div">
|
||||||
<span>2023年08月23日 星期三 09:57:11</span>
|
<!-- <span>2023年08月23日 星期三 09:57:11</span>
|
||||||
<el-button type="primary" size="large" @click="getTime">时间校对</el-button>
|
|
||||||
<el-button type="primary" size="large" @click="getTime">时间校对</el-button>
|
<el-button type="primary" size="large" @click="getTime">时间校对</el-button>
|
||||||
|
<el-button type="primary" size="large" @click="getTime">时间校对</el-button> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="top-div">
|
<div class="top-div">
|
||||||
|
@ -12,58 +12,60 @@
|
||||||
<legend class="box-ht">设备信息</legend>
|
<legend class="box-ht">设备信息</legend>
|
||||||
<div>
|
<div>
|
||||||
<span class="name">型号</span>
|
<span class="name">型号</span>
|
||||||
<span class="value">{{ deviceData.basicinfo.model }}</span>
|
<span class="value">{{ deviceData.device_information && deviceData.device_information.model }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="name">序列号</span>
|
<span class="name">序列号</span>
|
||||||
<span class="value">{{ deviceData.basicinfo.sn }}</span>
|
<span class="value">{{ deviceData.device_information && deviceData.device_information.sn }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="name">开机时间</span>
|
<span class="name">开机时间</span>
|
||||||
<span class="value">{{ deviceData.hostinfo.boottime }}</span>
|
<span class="value">{{ deviceData.running_information && deviceData.running_information.hostinfo &&
|
||||||
|
deviceData.running_information.hostinfo.boottime }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="name">运行时长</span>
|
<span class="name">运行时长</span>
|
||||||
<span class="value">{{ deviceData.hostinfo.uptime }}</span>
|
<span class="value">{{ deviceData.running_information && deviceData.running_information.hostinfo &&
|
||||||
|
deviceData.running_information.hostinfo.uptime }}</span>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="right-div box2">
|
<fieldset class="right-div box2">
|
||||||
<legend class="box-ht">内存信息</legend>
|
<legend class="box-ht">内存信息</legend>
|
||||||
<div id="echartDiv" class="echartDiv"></div>
|
<div id="echartDiv" class="echartDiv"></div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-div">
|
<div class="bottom-div">
|
||||||
<fieldset class="left-div1 box2">
|
<fieldset class="left-div1 box2">
|
||||||
<legend class="box-ht">磁盘信息</legend>
|
<legend class="box-ht">磁盘信息</legend>
|
||||||
<div class="process-div">
|
<div class="process-div">
|
||||||
<div v-for="(item, index) in deviceData.diskinfo" :key="index">
|
<div v-for="(item, index) in deviceData.running_information && deviceData.running_information.diskinfo" :key="index">
|
||||||
<div :id="'echartDiv' + index" class="echartDiv"></div>
|
<div :id="'echartDiv' + index" class="echartDiv"></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</div>
|
||||||
|
</fieldset>
|
||||||
<fieldset class="right-div1 box2">
|
|
||||||
<legend class="box-ht">网卡信息</legend>
|
<fieldset class="right-div1 box2">
|
||||||
<div v-for="(item, index) of deviceData.netinfo" :key="index" class="all-con">
|
<legend class="box-ht">网卡信息</legend>
|
||||||
<p class="title">网卡{{ item.name }}的使用情况</p>
|
<div v-for="(item, index) of deviceData.running_information && deviceData.running_information.netinfo" :key="index" class="all-con">
|
||||||
<div class="data">
|
<p class="title">网卡{{ item.name }}的使用情况</p>
|
||||||
<span>
|
<div class="data">
|
||||||
<span class="name">字节</span>
|
<span>
|
||||||
<span class="dataValue">
|
<span class="name">字节</span>
|
||||||
<span class="recv">{{ item.bytesRecv }}↓</span>
|
<span class="dataValue">
|
||||||
<span class="sent">{{ item.bytesSent }}↑</span>
|
<span class="recv">{{ item.bytesRecv }}↓</span>
|
||||||
</span>
|
<span class="sent">{{ item.bytesSent }}↑</span>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
</span>
|
||||||
<span class="name">包</span>
|
<span>
|
||||||
<span class="dataValue">
|
<span class="name">包</span>
|
||||||
<span class="recv">{{ item.packetsRecv }}↓</span>
|
<span class="dataValue">
|
||||||
<span class="sent">{{ item.packetsSent }}↑</span>
|
<span class="recv">{{ item.packetsRecv }}↓</span>
|
||||||
</span>
|
<span class="sent">{{ item.packetsSent }}↑</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</div>
|
||||||
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -90,7 +92,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
getSys();
|
getSys();
|
||||||
});
|
});
|
||||||
const getSys = async () => {
|
const getSys = async () => {
|
||||||
const res = await infoApi.getSys();
|
const res = await infoApi.getSys();
|
||||||
|
@ -106,15 +108,15 @@ export default {
|
||||||
let dom = document.getElementById("echartDiv");
|
let dom = document.getElementById("echartDiv");
|
||||||
let data = {
|
let data = {
|
||||||
name: "内存使用比",
|
name: "内存使用比",
|
||||||
usedPercent: state.deviceData.meminfo.used_percent.toFixed(2),
|
usedPercent: state.deviceData.running_information.meminfo.used_percent.toFixed(2),
|
||||||
used: state.deviceData.meminfo.used_percent.toFixed(2),
|
used: state.deviceData.running_information.meminfo.used_percent.toFixed(2),
|
||||||
total: 100,
|
total: 100,
|
||||||
};
|
};
|
||||||
getEchart(dom, data);
|
getEchart(dom, data);
|
||||||
state.deviceData.diskinfo.forEach((ele, index) => {
|
state.deviceData.running_information.diskinfo.forEach((ele, index) => {
|
||||||
let domItem = document.getElementById("echartDiv" + index);
|
let domItem = document.getElementById("echartDiv" + index);
|
||||||
let dataItem = {
|
let dataItem = {
|
||||||
name: ele.name.split("/")[2],
|
name: ele.path,
|
||||||
usedPercent: ele.used_percent.toFixed(2),
|
usedPercent: ele.used_percent.toFixed(2),
|
||||||
used: ele.used_percent.toFixed(2),
|
used: ele.used_percent.toFixed(2),
|
||||||
total: 100,
|
total: 100,
|
||||||
|
@ -199,6 +201,7 @@ export default {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-div {
|
.time-div {
|
||||||
height: 8%;
|
height: 8%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -208,24 +211,29 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
|
|
||||||
>span {
|
>span {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-div {
|
.top-div {
|
||||||
height: 39%;
|
height: 39%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom-div {
|
.bottom-div {
|
||||||
height: 49%;
|
height: 49%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.left-div, .left-div1 {
|
|
||||||
|
.left-div,
|
||||||
|
.left-div1 {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 65%;
|
width: 65%;
|
||||||
border: 1px solid #006b3b;
|
border: 1px solid #006b3b;
|
||||||
|
@ -234,40 +242,47 @@ export default {
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
> div {
|
|
||||||
|
>div {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
width: 25%;
|
width: 25%;
|
||||||
border: 1px solid #c3c3c3;
|
border: 1px solid #c3c3c3;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
width: 73%;
|
width: 73%;
|
||||||
border: 1px solid #c3c3c3;
|
border: 1px solid #c3c3c3;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.process {
|
.process {
|
||||||
width: 73%;
|
width: 73%;
|
||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.process-div {
|
.process-div {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
> div {
|
|
||||||
|
>div {
|
||||||
width: 48%;
|
width: 48%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-div, .right-div1 {
|
.right-div,
|
||||||
|
.right-div1 {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 34%;
|
width: 34%;
|
||||||
border: 1px solid #006b3b;
|
border: 1px solid #006b3b;
|
||||||
|
@ -276,18 +291,21 @@ export default {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
> div {
|
|
||||||
|
>div {
|
||||||
height: 49%;
|
height: 49%;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.all-con {
|
.all-con {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50%;
|
height: 50%;
|
||||||
// border: 1px solid red;
|
// border: 1px solid red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.data {
|
.data {
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
width: 70%;
|
width: 70%;
|
||||||
|
@ -295,21 +313,25 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
// border: 1px solid greenyellow;
|
// border: 1px solid greenyellow;
|
||||||
>span {
|
>span {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
// border: 1px solid red;
|
// border: 1px solid red;
|
||||||
.name {
|
.name {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dataValue {
|
.dataValue {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
width: 40%;
|
width: 40%;
|
||||||
border: 1px solid #c3c3c3;
|
border: 1px solid #c3c3c3;
|
||||||
|
@ -319,15 +341,18 @@ export default {
|
||||||
color: #098658;
|
color: #098658;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recv {
|
.recv {
|
||||||
background: #f8cecc;
|
background: #f8cecc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sent {
|
.sent {
|
||||||
background: #dae8fc;
|
background: #dae8fc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
// border: 1px solid red;
|
// border: 1px solid red;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -339,12 +364,14 @@ export default {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.left-div1, .right-div1 {
|
|
||||||
|
.left-div1,
|
||||||
|
.right-div1 {
|
||||||
width: 49.5%;
|
width: 49.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.echartDiv {
|
.echartDiv {
|
||||||
width: 70% !important;
|
width: 70% !important;
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}</style>
|
||||||
</style>
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const res = await infoApi.saveNet(state.formData);
|
const res = await infoApi.saveNet(state.formData);
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
ElMessage.success(res.message || "请求成功");
|
ElMessage.success(res.data + ',保存网络后会重启' || "请求成功,保存网络后会重启");
|
||||||
getNet();
|
getNet();
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.message);
|
ElMessage.error(res.message);
|
||||||
|
|
|
@ -93,7 +93,7 @@ export default {
|
||||||
store.commit("setUserInfo", userInfo);
|
store.commit("setUserInfo", userInfo);
|
||||||
getLoginStatus();
|
getLoginStatus();
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.message);
|
ElMessage.error(res.data);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -266,13 +266,13 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const tableRowClassName = ({ row, rowIndex }) => {
|
const tableRowClassName = ({ row, rowIndex }) => {
|
||||||
if(row.status == 1) {
|
if(row.driver_status == 1) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
if(row.status == 2) {
|
if(row.driver_status == 2) {
|
||||||
return 'green'
|
return 'green'
|
||||||
}
|
}
|
||||||
if(row.status == 3) {
|
if(row.driver_status == 3) {
|
||||||
return 'red'
|
return 'red'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,8 @@ export default ({ mode }) => defineConfig({
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'http://cdcm_test_api.shikicc.com:58909',
|
// target: 'http://cdcm_test_api.shikicc.com:58909',
|
||||||
// target: 'http://frp.shikicc.com:58951',
|
// target: 'http://frp.shikicc.com:58951',
|
||||||
target: 'https://cdcm_api2.shikicc.com',
|
// target: 'https://cdcm_api2.shikicc.com',
|
||||||
// target: 'https://cdcm_api.shikicc.com',
|
target: 'https://cdcm_api.shikicc.com',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/api/, '/api')
|
rewrite: path => path.replace(/^\/api/, '/api')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue