修改登录

main
wangqiujuan0808 2024-10-14 15:23:05 +08:00
parent f3f55d2c88
commit dad69ea7f7
8 changed files with 93 additions and 66 deletions

View File

@ -4,18 +4,18 @@ import {
const infoApi = {
//
getSys() {
return postPBRequest("/info", null, 51000);
return postPBRequest("/system", null, 57000);
},
//
getNet(params) {
return postPBRequest("/net", params, 52000);
return postPBRequest("/system", params, 57001);
},
saveNet(params) {
return postPBRequest("/net", params, 52200);
return postPBRequest("/system", params, 57201);
},
//
reboot() {
return postPBRequest("/user", null, 50003);
return postPBRequest("/system", null, 57202);
},
// //
// getTc(params) {

View File

@ -4,7 +4,7 @@ import {
const myApi = {
//
loginStatus() {
return postPBRequest('/user', null, 50000);
return postPBRequest('/system', null, 50000);
},
//
login(params = {}) {
@ -12,11 +12,11 @@ const myApi = {
},
// 退
logout() {
return postPBRequest('/user', null, 50002);
return postPBRequest('/system', null, 50002);
},
//
editPass(params = {}) {
return postPBRequest('/user', params, 90201);
return postPBRequest('/system', params, 90201);
}
}
export default myApi;

View File

@ -53,17 +53,17 @@ export default {
rules: {
oldPass: [
{ 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" },
],
newPass: [
{ 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" },
],
confirmPass: [
{ 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" },
],
},
@ -96,11 +96,11 @@ export default {
}
const res = await myApi.editPass(param);
if (res.code == 0) {
ElMessage.success(res.message|| "请求成功");
ElMessage.success(res.data|| "请求成功");
//
ctx.emit("dialogSuccess");
} else {
ElMessage.error(res.message);
ElMessage.error(res.data);
}
} else {
}

View File

@ -2,9 +2,9 @@
<el-card class="content-div">
<div class="all-content">
<div class="time-div">
<span>2023年08月23日 星期三 09:57:11</span>
<el-button type="primary" size="large" @click="getTime"></el-button>
<!-- <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> -->
</div>
<div class="top-div">
@ -12,58 +12,60 @@
<legend class="box-ht">设备信息</legend>
<div>
<span class="name">型号</span>
<span class="value">{{ deviceData.basicinfo.model }}</span>
<span class="value">{{ deviceData.device_information && deviceData.device_information.model }}</span>
</div>
<div>
<span class="name">序列号</span>
<span class="value">{{ deviceData.basicinfo.sn }}</span>
<span class="value">{{ deviceData.device_information && deviceData.device_information.sn }}</span>
</div>
<div>
<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>
<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>
</fieldset>
<fieldset class="right-div box2">
<legend class="box-ht">内存信息</legend>
<legend class="box-ht">内存信息</legend>
<div id="echartDiv" class="echartDiv"></div>
</fieldset>
</div>
<div class="bottom-div">
<fieldset class="left-div1 box2">
<legend class="box-ht">磁盘信息</legend>
<div class="process-div">
<div v-for="(item, index) in deviceData.diskinfo" :key="index">
<div :id="'echartDiv' + index" class="echartDiv"></div>
</div>
<fieldset class="left-div1 box2">
<legend class="box-ht">磁盘信息</legend>
<div class="process-div">
<div v-for="(item, index) in deviceData.running_information && deviceData.running_information.diskinfo" :key="index">
<div :id="'echartDiv' + index" class="echartDiv"></div>
</div>
</fieldset>
<fieldset class="right-div1 box2">
<legend class="box-ht">网卡信息</legend>
<div v-for="(item, index) of deviceData.netinfo" :key="index" class="all-con">
<p class="title">网卡{{ item.name }}的使用情况</p>
<div class="data">
<span>
<span class="name">字节</span>
<span class="dataValue">
<span class="recv">{{ item.bytesRecv }}</span>
<span class="sent">{{ item.bytesSent }}</span>
</span>
</div>
</fieldset>
<fieldset class="right-div1 box2">
<legend class="box-ht">网卡信息</legend>
<div v-for="(item, index) of deviceData.running_information && deviceData.running_information.netinfo" :key="index" class="all-con">
<p class="title">网卡{{ item.name }}的使用情况</p>
<div class="data">
<span>
<span class="name">字节</span>
<span class="dataValue">
<span class="recv">{{ item.bytesRecv }}</span>
<span class="sent">{{ item.bytesSent }}</span>
</span>
<span>
<span class="name"></span>
<span class="dataValue">
<span class="recv">{{ item.packetsRecv }}</span>
<span class="sent">{{ item.packetsSent }}</span>
</span>
</span>
<span>
<span class="name"></span>
<span class="dataValue">
<span class="recv">{{ item.packetsRecv }}</span>
<span class="sent">{{ item.packetsSent }}</span>
</span>
</div>
</span>
</div>
</fieldset>
</div>
</fieldset>
</div>
</div>
</el-card>
@ -90,7 +92,7 @@ export default {
});
onMounted(async () => {
getSys();
getSys();
});
const getSys = async () => {
const res = await infoApi.getSys();
@ -106,15 +108,15 @@ export default {
let dom = document.getElementById("echartDiv");
let data = {
name: "内存使用比",
usedPercent: state.deviceData.meminfo.used_percent.toFixed(2),
used: state.deviceData.meminfo.used_percent.toFixed(2),
usedPercent: state.deviceData.running_information.meminfo.used_percent.toFixed(2),
used: state.deviceData.running_information.meminfo.used_percent.toFixed(2),
total: 100,
};
getEchart(dom, data);
state.deviceData.diskinfo.forEach((ele, index) => {
state.deviceData.running_information.diskinfo.forEach((ele, index) => {
let domItem = document.getElementById("echartDiv" + index);
let dataItem = {
name: ele.name.split("/")[2],
name: ele.path,
usedPercent: ele.used_percent.toFixed(2),
used: ele.used_percent.toFixed(2),
total: 100,
@ -199,6 +201,7 @@ export default {
flex-direction: column;
justify-content: space-between;
}
.time-div {
height: 8%;
width: 100%;
@ -208,24 +211,29 @@ export default {
align-items: center;
justify-content: flex-end;
padding: 0 15px;
>span {
padding: 0 15px;
font-size: 26px;
}
}
.top-div {
height: 39%;
width: 100%;
display: flex;
justify-content: space-between;
}
.bottom-div {
height: 49%;
width: 100%;
display: flex;
justify-content: space-between;
}
.left-div, .left-div1 {
.left-div,
.left-div1 {
height: 100%;
width: 65%;
border: 1px solid #006b3b;
@ -234,40 +242,47 @@ export default {
justify-content: space-around;
display: flex;
padding: 20px;
> div {
>div {
height: 40px;
line-height: 40px;
display: flex;
justify-content: space-between;
text-align: center;
}
.name {
width: 25%;
border: 1px solid #c3c3c3;
height: 100%;
font-size: 18px;
}
.value {
width: 73%;
border: 1px solid #c3c3c3;
font-size: 18px;
}
.process {
width: 73%;
padding: 15px 0;
}
.process-div {
height: 100%;
justify-content: space-around;
align-items: center;
> div {
>div {
width: 48%;
height: 100%;
}
}
}
.right-div, .right-div1 {
.right-div,
.right-div1 {
height: 100%;
width: 34%;
border: 1px solid #006b3b;
@ -276,18 +291,21 @@ export default {
border-radius: 10px;
display: flex;
padding: 10px;
> div {
>div {
height: 49%;
flex-direction: column;
justify-content: space-between;
display: flex;
align-items: center;
}
.all-con {
width: 100%;
height: 50%;
// border: 1px solid red;
}
.data {
padding: 5px 0;
width: 70%;
@ -295,21 +313,25 @@ export default {
display: flex;
justify-content: space-around;
flex-direction: column;
// border: 1px solid greenyellow;
>span {
height: 30px;
display: flex;
align-items: center;
// border: 1px solid red;
.name {
width: 20%;
font-size: 18px;
}
.dataValue {
width: 80%;
display: flex;
justify-content: space-between;
align-items: center;
span {
width: 40%;
border: 1px solid #c3c3c3;
@ -319,15 +341,18 @@ export default {
color: #098658;
font-size: 16px;
}
.recv {
background: #f8cecc;
}
.sent {
background: #dae8fc;
}
}
}
}
.title {
// border: 1px solid red;
width: 100%;
@ -339,12 +364,14 @@ export default {
margin-bottom: 5px;
}
}
.left-div1, .right-div1 {
.left-div1,
.right-div1 {
width: 49.5%;
}
.echartDiv {
width: 70% !important;
height: 100% !important;
margin: 0 auto;
}
</style>
}</style>

View File

@ -187,7 +187,7 @@ export default {
if (valid) {
const res = await infoApi.saveNet(state.formData);
if (res.code == 0) {
ElMessage.success(res.message || "请求成功");
ElMessage.success(res.data + ',保存网络后会重启' || "请求成功,保存网络后会重启");
getNet();
} else {
ElMessage.error(res.message);

View File

@ -93,7 +93,7 @@ export default {
store.commit("setUserInfo", userInfo);
getLoginStatus();
} else {
ElMessage.error(res.message);
ElMessage.error(res.data);
}
})
} else {

View File

@ -266,13 +266,13 @@ export default {
}
const tableRowClassName = ({ row, rowIndex }) => {
if(row.status == 1) {
if(row.driver_status == 1) {
return ''
}
if(row.status == 2) {
if(row.driver_status == 2) {
return 'green'
}
if(row.status == 3) {
if(row.driver_status == 3) {
return 'red'
}

View File

@ -37,8 +37,8 @@ export default ({ mode }) => defineConfig({
'/api': {
// target: 'http://cdcm_test_api.shikicc.com:58909',
// target: 'http://frp.shikicc.com:58951',
target: 'https://cdcm_api2.shikicc.com',
// target: 'https://cdcm_api.shikicc.com',
// target: 'https://cdcm_api2.shikicc.com',
target: 'https://cdcm_api.shikicc.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '/api')
}