Commit cd5236d8 authored by xiaoye's avatar xiaoye

fix

parent f761ec37
Pipeline #38961 passed with stages
in 3 minutes
...@@ -458,7 +458,7 @@ ...@@ -458,7 +458,7 @@
let del_list : Array<Participant> = []; let del_list : Array<Participant> = [];
// @ts-ignore // @ts-ignore
res.tempFiles.forEach(i => { res.tempFiles.forEach(i => {
const p = participant.array.filter(p => p.name == i.name.replace(/\.[^/.]+$/, "")); const p = participant.array.filter(p => p.name == i.baseName.replace(/\.[^/.]+$/, ""));
del_list.push(...p); del_list.push(...p);
}); });
...@@ -469,7 +469,7 @@ ...@@ -469,7 +469,7 @@
await tournament.search(); await tournament.search();
} }
}; };
await UniApp.selectFile(['.ydk'], f); await UniApp.selectFile(['.ydk', '.txt'], f);
}, },
copy : () : void => { copy : () : void => {
if (!tournament.this) return; if (!tournament.this) return;
......
...@@ -5,6 +5,7 @@ import { Base64 } from 'js-base64'; ...@@ -5,6 +5,7 @@ import { Base64 } from 'js-base64';
class Participant { class Participant {
id : number; id : number;
name : string; name : string;
baseName : string;
qq : string | undefined; qq : string | undefined;
quit : boolean; quit : boolean;
tournamentId : number; tournamentId : number;
...@@ -15,6 +16,7 @@ class Participant { ...@@ -15,6 +16,7 @@ class Participant {
constructor(obj: ParticipantObject) { constructor(obj: ParticipantObject) {
const name = obj.name.split(/[\+\uFF0B]/); const name = obj.name.split(/[\+\uFF0B]/);
this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name; this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name;
this.baseName = obj.name;
this.qq = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[0] : undefined; this.qq = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[0] : undefined;
this.tournamentId = obj.tournamentId; this.tournamentId = obj.tournamentId;
this.id = obj.id; this.id = obj.id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment