This commit is contained in:
lvyuankang 2024-08-22 15:24:15 +08:00
parent 2fb04cbc52
commit bd62ff705d
5 changed files with 15 additions and 8 deletions

View File

@ -49,6 +49,8 @@ export async function deleteAllFIleLog(path){
let filenames = fs.listFileSync(path, options);
console.info("listFile succeed",JSON.stringify(filenames));
for (let i = 0; i < filenames.length; i++) {
console.info("listFile succeed",JSON.stringify(filenames[i]));
if(isSevenDaysAgo(filenames[i])){
fs.rmdir(path+filenames[i], (err) => {
if (err) {
@ -65,10 +67,11 @@ export async function deleteAllFIleLog(path){
function isSevenDaysAgo(date) {
const today = new Date(); // 当前日期
const target = new Date(date); // 需要判断的日期
console.info("listFile succeed1",JSON.stringify(target));
const diff = today.getTime() - target.getTime(); // 计算两个日期之间的毫秒数差异
const diffDays = diff / (1000 * 60 * 60 * 24); // 将毫秒转换为天数
console.info("listFile succeed2",JSON.stringify(diffDays));
// 如果差异天数正好是7则原日期是当前日期的前七天
return diffDays > 7;
}

View File

@ -303,9 +303,9 @@ export default class UdpClientByCenter {
if (strachArr[0] != '#DN_GD') {
return
}
console.log(`${TAG} udp222 on message array buffer:${str}`);
strachArr[28] = globalThis.chuankoMsg || strachArr[28]
console.log(`${TAG} udp222 on message array buffer:${str}`);
// this.stashFn(str)
const newArr = JSON.parse(JSON.stringify(strachArr))
@ -316,6 +316,7 @@ export default class UdpClientByCenter {
if(strachArr[83]!='4'){
this.chafenFlag++
if(this.chafenFlag>=15&&!globalThis.dialogOpen){
getUDP(globalThis.context,true)
globalThis.title='差分状态异常'
globalThis.type='3'
AppStorage.SetOrCreate('errorMsg', 1);

View File

@ -97,7 +97,7 @@ export const CandidateData: Array<User> = [
{
sfzmhm: '3423231995014700005',
xm: '测试学员5',
lsh: '0000000000004',
lsh: '0000000000005',
ksy1: '考试员2',
id: '002',
kszp: '',
@ -120,7 +120,7 @@ export const CandidateData: Array<User> = [
{
sfzmhm: '342323199501470016',
xm: '测试学员6',
lsh: '0000000000005',
lsh: '0000000000006',
ksy1: '考试员1',
id: '001',
kszp: '',
@ -212,7 +212,7 @@ export const CandidateData: Array<User> = [
{
sfzmhm: '34232319950147000010',
xm: '测试学员10',
lsh: '002',
lsh: '0000000000009',
ksy1: '考试员2',
id: '0000000000010',
kszp: '',

View File

@ -12,6 +12,7 @@ import { GlobalConfig } from '../config';
@Entry
@Component
struct Index {
@State textList1: string[] = ['差分服务器Ip','响应端口','中心服务器IP','响应端口', '子网掩码','默认网关','dns','后置机IP ', '响应端口','前置机IP','本地端口']
// @State textList2: string[] = []
@State ratio: number = 1700 / 960

View File

@ -132,6 +132,7 @@ struct UserInfo {
// this.openDeviceByIDCard()
const routerParam = router.getParams() || { type: 0 };
console.log('routerParam', JSON.stringify(routerParam))
if (!globalThis.singlePlay) {
// @ts-ignore
if (routerParam.type != 1) {
@ -147,8 +148,8 @@ struct UserInfo {
this.getCurrentStudent(res.sfzmhm)
}
})
} else if (user && (user.kssycs == '0' || user.kssycs == '')) {
}
else if (user && (user.kssycs == '0' || user.kssycs == '')) {
console.log('datadatadatadata')
this.list = this.list.filter(res => {
return res.sfzmhm != user.sfzmhm
@ -226,7 +227,7 @@ struct UserInfo {
this.stopDeviceById()
// globalThis.statue=4
router.pushUrl({
url: examSubject == 3 ? 'pages/c' : 'pages/Judge',
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
params: {
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf,
@ -460,6 +461,7 @@ struct UserInfo {
return
}
await upDateTableByArray('USER', [])
await upDateTableByArray('USERLIST', [])
this.type = '2'
this.errorDialog.open()
this.updateTimeLimit = true