40 lines
915 B
JavaScript
40 lines
915 B
JavaScript
Tea.context(function () {
|
|
this.platform = "android";
|
|
this.version = this.defaultVersion || "1.0.0";
|
|
this.isUploading = false;
|
|
|
|
if (!Array.isArray(this.uploadedFiles)) {
|
|
this.uploadedFiles = [];
|
|
}
|
|
|
|
this.beforeUpload = function () {
|
|
this.isUploading = true;
|
|
};
|
|
|
|
this.doneUpload = function () {
|
|
this.isUploading = false;
|
|
};
|
|
|
|
this.successUpload = function () {
|
|
teaweb.success("上传成功", function () {
|
|
window.location = "/httpdns/apps/sdk?appId=" + this.app.id;
|
|
}.bind(this));
|
|
};
|
|
|
|
this.deleteUploadedFile = function (filename) {
|
|
let that = this;
|
|
teaweb.confirm("确定要删除文件 " + filename + " 吗?", function () {
|
|
that.$post("/httpdns/apps/sdk/upload/delete")
|
|
.params({
|
|
appId: that.app.id,
|
|
filename: filename
|
|
})
|
|
.success(function () {
|
|
teaweb.success("删除成功", function () {
|
|
window.location.reload();
|
|
});
|
|
});
|
|
});
|
|
};
|
|
});
|