优化
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user