XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore(webui): inform the user of JSON parsing errors during import (#3001)

Closes #2996 Reviewed-on: https://www.onlyg.it/OpenWF/SpaceNinjaServer/pulls/3001 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

65138b64
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +15 -10
Modified static/webui/script.js +15 -10
@@ -3552,16 +3552,21 @@ function doPopArchonCrystalUpgrade(type) {
3552 3552
3553 3553 function doImport() {
3554 3554 revalidateAuthz().then(() => {
3555 $.post({
3556 url: "/custom/import?" + window.authz,
3557 contentType: "application/json",
3558 data: JSON.stringify({
3559 inventory: JSON.parse($("#import-inventory").val())
3560 })
3561 }).then(function () {
3562 toast(loc("code_succImport"));
3563 updateInventory();
3564 });
3555 try {
3556 $.post({
3557 url: "/custom/import?" + window.authz,
3558 contentType: "application/json",
3559 data: JSON.stringify({
3560 inventory: JSON.parse($("#import-inventory").val())
3561 })
3562 }).then(function () {
3563 toast(loc("code_succImport"));
3564 updateInventory();
3565 });
3566 } catch (e) {
3567 toast(e);
3568 console.error(e);
3569 }
3565 3570 });
3566 3571 }
3567 3572