更新Android Studio后,我有.AndroidStudio1.3和.AndroidStudio1.4文件夹.如果我删除.AndroidStudio1.3文件夹,会不会引起任何问题?
这个想法是将 MySQL 数据库捆绑在 npm 应用程序中。其背后的原因是该应用程序旨在作为使用 Electron 以及许多其他模块构建的独立桌面应用程序运行。
到目前为止,我对 MySQL 数据库模块的所有搜索都只找到了驱动程序。所有其他教程都讨论典型的 Web 应用程序设置,其中 MySQL 数据库安装在服务器中。另一篇文章的评论讨论了如何在服务器中设置 MySQL 数据库,并提到如果它是桌面应用程序,那就是另一个问题了。我想知道是否有办法做到这一点,或者根本不可能。
我XMLHttpRequest使用以下代码从服务器获取了一个 json 值:
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
let msg = JSON.parse(xhr.responseText);
// Send the request to our POST Servlet
}
};
xhr.open("GET", "/libs/granite/csrf/token.json", true);
xhr.send();
Run Code Online (Sandbox Code Playgroud)
但是,我想fetch在我的代码中使用,但是,在尝试下面的代码时,我立即收到了 403 错误的答复:
fetch("/libs/granite/csrf/token.json", { method: "GET" })
.then((response: any) => {
if (response.status === 200 || response.statusText === "OK") {
callback(ResponseCode.SUCCESS);
} else {
callback(ResponseCode.ERROR);
}
})
.catch((error: any) => {
callback(ResponseCode.ERROR);
});
Run Code Online (Sandbox Code Playgroud)
我想知道两者之间的区别以及我应该修改什么才能完成fetch …