diff --git a/ShadowEditor.Web/src/Application.js b/ShadowEditor.Web/src/Application.js
index 42749723..c72f28a1 100644
--- a/ShadowEditor.Web/src/Application.js
+++ b/ShadowEditor.Web/src/Application.js
@@ -236,7 +236,16 @@ Application.prototype.upload = function () {
input.type = 'file';
input.style.display = 'none';
input.addEventListener('change', event => {
-
+ Ajax.post(url, {
+ file: event.target.files[0],
+ }, json => {
+ var obj = JSON.parse(json);
+ if (obj.Code === 200) {
+ callback(obj);
+ } else {
+ app.toast(obj.Msg);
+ }
+ });
});
document.body.appendChild(input);
}
diff --git a/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx b/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx
index 3b3c03d2..4c782b6d 100644
--- a/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/AnimationPanel.jsx
@@ -21,6 +21,8 @@ class AnimationPanel extends React.Component {
};
this.handleClick = this.handleClick.bind(this);
+
+ this.handleAdd = this.handleAdd.bind(this);
this.handleEdit = this.handleEdit.bind(this);
this.handleDelete = this.handleDelete.bind(this);
@@ -45,6 +47,7 @@ class AnimationPanel extends React.Component {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
+ }
+
// ------------------------------- 编辑 ---------------------------------------
handleEdit(data) {
diff --git a/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx b/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx
index 80608172..f2f6508e 100644
--- a/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/AudioPanel.jsx
@@ -21,6 +21,8 @@ class AudioPanel extends React.Component {
};
this.handleClick = this.handleClick.bind(this);
+
+ this.handleAdd = this.handleAdd.bind(this);
this.handleEdit = this.handleEdit.bind(this);
this.handleDelete = this.handleDelete.bind(this);
@@ -45,6 +47,7 @@ class AudioPanel extends React.Component {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
+ }
+
// ------------------------------- 编辑 ---------------------------------------
handleEdit(data) {
diff --git a/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx b/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx
index d1e621ac..9dbc7691 100644
--- a/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/CharacterPanel.jsx
@@ -45,6 +45,7 @@ class CharacterPanel extends React.Component {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
+ }
+
// ------------------------------- 编辑 ---------------------------------------
handleEdit(data) {
diff --git a/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx b/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx
index a6a37af3..1a353c8e 100644
--- a/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/MaterialPanel.jsx
@@ -45,6 +45,7 @@ class MaterialPanel extends React.Component {
{
+ if (obj.Code === 200) {
+ this.update();
+ }
+ app.toast(obj.Msg);
+ });
}
// ------------------------------- 编辑 ---------------------------------------
diff --git a/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx b/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx
index 961dca60..f8954012 100644
--- a/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx
+++ b/ShadowEditor.Web/src/editor2/assets/ParticlePanel.jsx
@@ -45,6 +45,7 @@ class ParticlePanel extends React.Component {