v1.3.260115 增加教学数据清除API
This commit is contained in:
2
dist/server.js
vendored
2
dist/server.js
vendored
File diff suppressed because one or more lines are too long
377
dsxapi/connection_maps/connectionMap.json
Normal file
377
dsxapi/connection_maps/connectionMap.json
Normal file
@@ -0,0 +1,377 @@
|
|||||||
|
{
|
||||||
|
"pass": {
|
||||||
|
"main-permanent": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "remote-channel",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"remote-channel": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "main-channel",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"main-channel": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "remote-permanent",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"main-cfp-sm-out": {
|
||||||
|
"type": "fiber",
|
||||||
|
"connectedTo": "remote-cfp-in",
|
||||||
|
"fiberstatus": "ref-pass"
|
||||||
|
},
|
||||||
|
"main-cfp-mm-out": {
|
||||||
|
"type": "fiber",
|
||||||
|
"connectedTo": "remote-cfp-in",
|
||||||
|
"fiberstatus": "ref-pass"
|
||||||
|
},
|
||||||
|
"remote-cfp-sm-out": {
|
||||||
|
"type": "fiber",
|
||||||
|
"connectedTo": "main-cfp-in",
|
||||||
|
"fiberstatus": "ref-pass"
|
||||||
|
},
|
||||||
|
"remote-cfp-mm-out": {
|
||||||
|
"type": "fiber",
|
||||||
|
"connectedTo": "main-cfp-in",
|
||||||
|
"fiberstatus": "ref-pass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Office": {
|
||||||
|
"Room1-TO-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "Rack1-1A-1",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "return-loss-fail"
|
||||||
|
},
|
||||||
|
"Room1-TO-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "Rack1-1A-2",
|
||||||
|
"wiremapstatus": "open",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room2-TO-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "Rack1-1A-3",
|
||||||
|
"wiremapstatus": "short",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room2-TO-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "Rack1-1A-4",
|
||||||
|
"wiremapstatus": "cross",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room3-TO-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "Rack1-1A-5",
|
||||||
|
"wiremapstatus": "reversed",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room3-TO-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "Rack1-1A-6",
|
||||||
|
"wiremapstatus": "miswire",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room4-CAM": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "Rack1-1A-7",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "return-loss-fail"
|
||||||
|
},
|
||||||
|
"Rack1-1B-1": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "Rack1-1B-5",
|
||||||
|
"fiberstatus": "sm-pass"
|
||||||
|
},
|
||||||
|
"Rack1-1B-2": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "Rack1-1B-6",
|
||||||
|
"fiberstatus": "connector-fail-start"
|
||||||
|
},
|
||||||
|
"Rack1-1B-3": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "Rack1-1B-7",
|
||||||
|
"fiberstatus": "connector-fail-end"
|
||||||
|
},
|
||||||
|
"Rack1-1B-4": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "Rack1-1B-8",
|
||||||
|
"fiberstatus": "bend"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Industry": {
|
||||||
|
"Device1-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-m12",
|
||||||
|
"connectedTo": "Cabinet-A1",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Device1-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-m12",
|
||||||
|
"connectedTo": "Cabinet-A2",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Device2-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-m12",
|
||||||
|
"connectedTo": "Cabinet-A3",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Device2-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-m12",
|
||||||
|
"connectedTo": "Cabinet-A4",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Device3-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-2p",
|
||||||
|
"connectedTo": "Cabinet-R1",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Device3-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-2p",
|
||||||
|
"connectedTo": "Cabinet-R2",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Device4-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-2p",
|
||||||
|
"connectedTo": "Cabinet-R3",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Device4-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-2p",
|
||||||
|
"connectedTo": "Cabinet-R4",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"DataCenter": {
|
||||||
|
"CA-1A-1-port1": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "CB-1A-1-port1",
|
||||||
|
"fiberstatus": "mm-pass"
|
||||||
|
},
|
||||||
|
"CA-1A-1-port2": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "CB-1A-1-port2",
|
||||||
|
"fiberstatus": "mm-pass"
|
||||||
|
},
|
||||||
|
"CA-1A-1-port3": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "CB-1A-1-port3",
|
||||||
|
"fiberstatus": "mm-pass"
|
||||||
|
},
|
||||||
|
"CA-1A-1-port4": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "CB-1A-1-port4",
|
||||||
|
"fiberstatus": "mm-pass"
|
||||||
|
},
|
||||||
|
"CA-1A-1-port5": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "CB-1A-1-port6",
|
||||||
|
"fiberstatus": "mm-pass"
|
||||||
|
},
|
||||||
|
"CA-1A-1-port6": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "CB-1A-1-port6",
|
||||||
|
"fiberstatus": "mm-pass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"SkillCompetition": {
|
||||||
|
"Room1-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "1A-1",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room1-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "1A-2",
|
||||||
|
"wiremapstatus": "open",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room2-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "1A-11",
|
||||||
|
"wiremapstatus": "short",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room2-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "1A-12",
|
||||||
|
"wiremapstatus": "cross",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room3-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "1B-5",
|
||||||
|
"wiremapstatus": "reversed",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room3-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"connectedTo": "1B-6",
|
||||||
|
"wiremapstatus": "miswire",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WorldSkill": {
|
||||||
|
"Room1-TO-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "1F-RackA-1A-1",
|
||||||
|
"wiremapstatus": "short2",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room1-TO-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "1F-RackA-1A-2",
|
||||||
|
"wiremapstatus": "short",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room3-TO-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "1F-RackA-1A-5",
|
||||||
|
"wiremapstatus": "cross",
|
||||||
|
"performancestatus": "next-fail"
|
||||||
|
},
|
||||||
|
"Room3-TO-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "1F-RackA-1A-6",
|
||||||
|
"wiremapstatus": "reversed",
|
||||||
|
"performancestatus": "pass"
|
||||||
|
},
|
||||||
|
"Room4-CAM": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "t568b",
|
||||||
|
"connectedTo": "1F-RackA-1A-12",
|
||||||
|
"wiremapstatus": "pass",
|
||||||
|
"performancestatus": "mptl-nextfail"
|
||||||
|
},
|
||||||
|
"2F-RackA-1A-1": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "1F-RackA-1B-1",
|
||||||
|
"fiberstatus": "sm-fail"
|
||||||
|
},
|
||||||
|
"2F-RackA-1A-2": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "1F-RackA-1B-2",
|
||||||
|
"fiberstatus": "sm-pass"
|
||||||
|
},
|
||||||
|
"2F-RackA-1A-3": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "1F-RackA-1B-3",
|
||||||
|
"fiberstatus": "sm-pass"
|
||||||
|
},
|
||||||
|
"2F-RackA-1A-4": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "1F-RackA-1B-4",
|
||||||
|
"fiberstatus": "sm-pass"
|
||||||
|
},
|
||||||
|
"2F-RackA-1A-5": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "1F-RackA-1B-6",
|
||||||
|
"fiberstatus": "sm-pass"
|
||||||
|
},
|
||||||
|
"2F-RackA-1A-6": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "olts",
|
||||||
|
"connectedTo": "1F-RackA-1B-5",
|
||||||
|
"fiberstatus": "sm-pass"
|
||||||
|
},
|
||||||
|
"1F-RackA-1C-1": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "x",
|
||||||
|
"fiberstatus": "sm-pass"
|
||||||
|
},
|
||||||
|
"1F-RackA-1C-2": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "x",
|
||||||
|
"fiberstatus": "connector-fail-start"
|
||||||
|
},
|
||||||
|
"1F-RackA-1C-3": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "x",
|
||||||
|
"fiberstatus": "splice-fail"
|
||||||
|
},
|
||||||
|
"1F-RackA-1C-4": {
|
||||||
|
"type": "fiber",
|
||||||
|
"apitype": "otdr",
|
||||||
|
"connectedTo": "x",
|
||||||
|
"fiberstatus": "bend"
|
||||||
|
},
|
||||||
|
"RMA-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-m12",
|
||||||
|
"connectedTo": "PLC-Rack-1A-1",
|
||||||
|
"wiremapstatus": "pass-2pair",
|
||||||
|
"performancestatus": "workshop-m12-pass-30m"
|
||||||
|
},
|
||||||
|
"RMA-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-m12",
|
||||||
|
"connectedTo": "PLC-Rack-1A-2",
|
||||||
|
"wiremapstatus": "sopen",
|
||||||
|
"performancestatus": "workshop-m12-pass-30m"
|
||||||
|
},
|
||||||
|
"PLC-Rack-1B-1": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-2p",
|
||||||
|
"connectedTo": "1F-RackA-1A-1",
|
||||||
|
"wiremapstatus": "pass-2pair",
|
||||||
|
"performancestatus": "workshop-2p-pass-80m"
|
||||||
|
},
|
||||||
|
"PLC-Rack-1B-2": {
|
||||||
|
"type": "copper",
|
||||||
|
"apitype": "workshop-2p",
|
||||||
|
"connectedTo": "1F-RackA-1A-2",
|
||||||
|
"wiremapstatus": "pass-2pair",
|
||||||
|
"performancestatus": "workshop-2p-pass-80m"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"CopperAnalyzer": {}
|
||||||
|
}
|
||||||
@@ -55,74 +55,74 @@ const initialConnectionMap = {
|
|||||||
"Room1-TO-1": {
|
"Room1-TO-1": {
|
||||||
type: "copper",
|
type: "copper",
|
||||||
apitype:"t568b",
|
apitype:"t568b",
|
||||||
connectedTo: "1A-1",
|
connectedTo: "Rack1-1A-1",
|
||||||
wiremapstatus: "pass",
|
wiremapstatus: "pass",
|
||||||
performancestatus: "pass"
|
performancestatus: "pass"
|
||||||
},
|
},
|
||||||
"Room1-TO-2": {
|
"Room1-TO-2": {
|
||||||
type: "copper",
|
type: "copper",
|
||||||
apitype:"t568b",
|
apitype:"t568b",
|
||||||
connectedTo: "1A-2",
|
connectedTo: "Rack1-1A-2",
|
||||||
wiremapstatus: "open",
|
wiremapstatus: "open",
|
||||||
performancestatus: "pass"
|
performancestatus: "pass"
|
||||||
},
|
},
|
||||||
"Room2-TO-1": {
|
"Room2-TO-1": {
|
||||||
type: "copper",
|
type: "copper",
|
||||||
apitype:"t568b",
|
apitype:"t568b",
|
||||||
connectedTo: "1A-3",
|
connectedTo: "Rack1-1A-3",
|
||||||
wiremapstatus: "short",
|
wiremapstatus: "short",
|
||||||
performancestatus: "pass"
|
performancestatus: "pass"
|
||||||
},
|
},
|
||||||
"Room2-TO-2": {
|
"Room2-TO-2": {
|
||||||
type: "copper",
|
type: "copper",
|
||||||
apitype:"t568b",
|
apitype:"t568b",
|
||||||
connectedTo: "1A-4",
|
connectedTo: "Rack1-1A-4",
|
||||||
wiremapstatus: "cross",
|
wiremapstatus: "cross",
|
||||||
performancestatus: "pass"
|
performancestatus: "pass"
|
||||||
},
|
},
|
||||||
"Room3-TO-1": {
|
"Room3-TO-1": {
|
||||||
type: "copper",
|
type: "copper",
|
||||||
apitype:"t568b",
|
apitype:"t568b",
|
||||||
connectedTo: "1A-5",
|
connectedTo: "Rack1-1A-5",
|
||||||
wiremapstatus: "reversed",
|
wiremapstatus: "reversed",
|
||||||
performancestatus: "pass"
|
performancestatus: "pass"
|
||||||
},
|
},
|
||||||
"Room3-TO-2": {
|
"Room3-TO-2": {
|
||||||
type: "copper",
|
type: "copper",
|
||||||
apitype:"t568b",
|
apitype:"t568b",
|
||||||
connectedTo: "1A-6",
|
connectedTo: "Rack1-1A-6",
|
||||||
wiremapstatus: "miswire",
|
wiremapstatus: "miswire",
|
||||||
performancestatus: "pass"
|
performancestatus: "pass"
|
||||||
},
|
},
|
||||||
"Room4-CAM": {
|
"Room4-CAM": {
|
||||||
type: "copper",
|
type: "copper",
|
||||||
apitype:"t568b",
|
apitype:"t568b",
|
||||||
connectedTo: "1A-7",
|
connectedTo: "Rack1-1A-7",
|
||||||
wiremapstatus: "pass",
|
wiremapstatus: "pass",
|
||||||
performancestatus: "return-loss-fail"
|
performancestatus: "return-loss-fail"
|
||||||
},
|
},
|
||||||
"1B-1": {
|
"Rack1-1B-1": {
|
||||||
type: "fiber",
|
type: "fiber",
|
||||||
apitype:"olts",
|
apitype:"otdr",
|
||||||
connectedTo: "1B-5",
|
connectedTo: "Rack1-1B-5",
|
||||||
fiberstatus: "sm-pass"
|
fiberstatus: "sm-pass"
|
||||||
},
|
},
|
||||||
"1B-2": {
|
"Rack1-1B-2": {
|
||||||
type: "fiber",
|
type: "fiber",
|
||||||
apitype:"olts",
|
apitype:"otdr",
|
||||||
connectedTo: "1B-6",
|
connectedTo: "Rack1-1B-6",
|
||||||
fiberstatus: "connector-fail-start"
|
fiberstatus: "connector-fail-start"
|
||||||
},
|
},
|
||||||
"1B-3": {
|
"Rack1-1B-3": {
|
||||||
type: "fiber",
|
type: "fiber",
|
||||||
apitype:"olts",
|
apitype:"otdr",
|
||||||
connectedTo: "1B-7",
|
connectedTo: "Rack1-1B-7",
|
||||||
fiberstatus: "splice-fail"
|
fiberstatus: "splice-fail"
|
||||||
},
|
},
|
||||||
"1B-4": {
|
"Rack1-1B-4": {
|
||||||
type: "fiber",
|
type: "fiber",
|
||||||
apitype:"olts",
|
apitype:"otdr",
|
||||||
connectedTo: "1B-8",
|
connectedTo: "Rack1-1B-8",
|
||||||
fiberstatus: "bend"
|
fiberstatus: "bend"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -796,6 +796,51 @@ app.get('/api/teaching/data', (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.post('/api/teaching/clear', (req, res) => {
|
||||||
|
const { scenario, org, fingerprint } = req.body;
|
||||||
|
if (!scenario) {
|
||||||
|
return res.status(400).json({ error: '缺少scenario参数' });
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (!fs.existsSync(teachingDir)) {
|
||||||
|
return res.json({ success: true });
|
||||||
|
}
|
||||||
|
const filePath = path.join(teachingDir, `${scenario}.json`);
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
return res.json({ success: true });
|
||||||
|
}
|
||||||
|
if (!org && !fingerprint) {
|
||||||
|
fs.unlinkSync(filePath);
|
||||||
|
return res.json({ success: true });
|
||||||
|
}
|
||||||
|
const content = fs.readFileSync(filePath, 'utf8');
|
||||||
|
const store = JSON.parse(content || '{}');
|
||||||
|
if (fingerprint) {
|
||||||
|
const entry = store[fingerprint];
|
||||||
|
if (!entry) {
|
||||||
|
return res.json({ success: true });
|
||||||
|
}
|
||||||
|
if (org && String(entry.org || '').toLowerCase() !== String(org).toLowerCase()) {
|
||||||
|
return res.json({ success: true });
|
||||||
|
}
|
||||||
|
delete store[fingerprint];
|
||||||
|
fs.writeFileSync(filePath, JSON.stringify(store, null, 2));
|
||||||
|
return res.json({ success: true });
|
||||||
|
}
|
||||||
|
if (org) {
|
||||||
|
const filtered = Object.fromEntries(
|
||||||
|
Object.entries(store).filter(([_, v]) => String((v && v.org) || '').toLowerCase() !== String(org).toLowerCase())
|
||||||
|
);
|
||||||
|
fs.writeFileSync(filePath, JSON.stringify(filtered, null, 2));
|
||||||
|
return res.json({ success: true });
|
||||||
|
}
|
||||||
|
res.json({ success: true });
|
||||||
|
} catch (error) {
|
||||||
|
console.error('清除教学数据失败:', error);
|
||||||
|
res.status(500).json({ error: '服务器内部错误' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// -----------------**************--------------------------***************--------------
|
// -----------------**************--------------------------***************--------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# Database configuration
|
# Database configuration
|
||||||
DB_HOST=192.168.5.131
|
# DB_HOST=192.168.5.131
|
||||||
# DB_HOST=est_mysql
|
DB_HOST=est_mysql
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_USER=root
|
DB_USER=root
|
||||||
DB_PASSWORD=MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDQMYcjqnrMnr9G
|
DB_PASSWORD=MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDQMYcjqnrMnr9G
|
||||||
DB_NAME=login
|
DB_NAME=login
|
||||||
|
|
||||||
# SurveyKing_DB_NAME
|
# SurveyKing_DB_NAME
|
||||||
SurveyKing_DB_HOST=192.168.5.131
|
#SurveyKing_DB_HOST=192.168.5.131
|
||||||
# SurveyKing_DB_HOST=est_mysql
|
SurveyKing_DB_HOST=est_mysql
|
||||||
SurveyKing_DB_PORT=3306
|
SurveyKing_DB_PORT=3306
|
||||||
SurveyKing_DB_USER=root
|
SurveyKing_DB_USER=root
|
||||||
SurveyKing_DB_PASSWORD=MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDQMYcjqnrMnr9G
|
SurveyKing_DB_PASSWORD=MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDQMYcjqnrMnr9G
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user