This commit is contained in:
zt
2025-03-25 10:26:59 +08:00
parent 8aa9e7b9ad
commit b35695c4ee
7 changed files with 160 additions and 23 deletions

View File

@ -167,13 +167,21 @@
userIds: [],
loading: false,
listStatusText: "请先选择主题",
userId: "1893247598219890699",
userId: "",
checkAll: false,
isIndeterminate: false,
uploadFile: null,
};
},
mounted() {
const protocol = window.location.protocol;
const host = window.location.host;
this.baseUrl = `${protocol}//${host}`; // 动态获取基础 URL
// 获取 URL 中的 userId 参数
const urlParams = new URLSearchParams(window.location.search);
this.userId = urlParams.get("userId");
console.log("userId", this.userId);
this.getRecruitList();
},
methods: {
@ -256,16 +264,20 @@
formData.append("userId", this.userId);
try {
await this.ajaxRequest({
const res = await this.ajaxRequest({
url: "/ruoyi/upload-zip",
method: "POST",
body: formData,
});
this.$refs.uploadRef.clearFiles();
this.uploadFile = null;
ElementPlus.ElMessage.success("上传成功");
if (res.code == 200) {
ElementPlus.ElMessage.success("上传成功");
} else {
ElementPlus.ElMessage.error(`${res.msg}`);
}
} catch (error) {
ElementPlus.ElMessage.error("上传失败");
ElementPlus.ElMessage.error(`${error}`);
}
},
@ -310,7 +322,6 @@
config.body = JSON.stringify(options.body);
}
}
const response = await fetch(this.baseUrl + options.url, config);
if (!response.ok) throw new Error(response.statusText);
@ -325,7 +336,6 @@
},
},
});
app.use(ElementPlus);
app.mount("#app");
</script>