1. 网络接口问题,会出现报错,误导为跨域问题
has been blocked by CoRs
indexpc.html:1
policy: Response to preflight request doesn't pass access control check: No "Access-Control-Allow 0rigin header is present on the reouested resource.
< Failed to load resource: net::ERR FAILED
:8001/schoolweb/bd/sys/doLogin:
这个问题实际的解决是,检查接口地址是否正确,
不需要先考虑跨域的问题
2. sweetalert2 插件更新问题
影响页面跳转,传参和使用方法调整变化
更改后
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10.5.0/dist/sweetalert2.all.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css" id="theme-styles">
swal.fire({
title: 'success!',
text: '登录成功',
// icon: 'error',
confirmButtonText: '确 定'
}).then((result) => {
if (result.isConfirmed)
window.location.href = "searchpc.html";
else
swal.fire("Error!", "Coudn't delet!", "error");
});
3. 服务端部署问题
net::ERR CONNECTION REFUSED
sudo systemctl restart tomcat
服务器接口 启动问题检查
更新插件时间;2024年7月13日