MCSERVER.URL 对接完成

This commit is contained in:
suwings 2018-01-24 17:10:46 +08:00
parent 26b970b189
commit 171b17ab78
5 changed files with 27 additions and 21 deletions

View File

@ -35,4 +35,6 @@ const vm_files_items = new Vue({
funcModule.ls().then(function name(data) {
vm_files_items.$data.filesCollect = data;
});
//tools.popWindow(123)
console.log("URL:", )

View File

@ -2,7 +2,7 @@ import ajaxMoudule from "./ajax";
import tools from "./tools";
const Ajax = ajaxMoudule.Ajax;
// const BASE_DIR = "";
const BASE_DIR = "";
function promiseAjax(url, datas = "") {
return new Promise((resolve, reject) => {
@ -22,7 +22,7 @@ function promiseAjax(url, datas = "") {
exports.ls = (path) => {
console.log("刷新");
return new Promise((resolve, reject) => {
promiseAjax("/fs/ls", path).then((data) => {
promiseAjax(MCSERVER.URL("fs/ls"), path).then((data) => {
//排序
let res_dir = [];
let res_file = [];
@ -45,34 +45,34 @@ exports.ls = (path) => {
exports.mkdir = (newName) => {
console.log("新建目录");
return promiseAjax("/fs/mkdir", newName);
return promiseAjax(MCSERVER.URL("fs/mkdir"), newName);
};
exports.copy = (fileStack) => {
console.log("复制");
return promiseAjax("/fs/cp", fileStack);
return promiseAjax(MCSERVER.URL("fs/cp"), fileStack);
};
exports.paste = () => {
console.log("粘贴");
return promiseAjax("/fs/patse");
return promiseAjax(MCSERVER.URL("fs/patse"));
};
exports.remove = (fileStack) => {
console.log("删除");
return promiseAjax("/fs/rm", fileStack);
return promiseAjax(MCSERVER.URL("fs/rm"), fileStack);
};
exports.cponce = (fileStack) => {
console.log("剪贴");
return promiseAjax("/fs/ct", fileStack);
return promiseAjax(MCSERVER.URL("fs/ct"), fileStack);
};
exports.rename = (filesStack, newName) => {
console.log("重名名:", filesStack[0].name, "->", newName);
if (filesStack.length == 1) {
let oldName = filesStack[0].name;
return promiseAjax("/fs/rename", {
return promiseAjax(MCSERVER.URL("fs/rename"), {
oldName: oldName,
newName: newName
});

View File

@ -94,7 +94,8 @@
_function2.default.ls().then(function name(data) {
vm_files_items.$data.filesCollect = data;
});
//tools.popWindow(123)
console.log("URL:");
/***/ }),
/* 1 */
@ -11363,7 +11364,7 @@
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Ajax = _ajax2.default.Ajax;
// const BASE_DIR = "";
var BASE_DIR = "";
function promiseAjax(url) {
var datas = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
@ -11385,7 +11386,7 @@
exports.ls = function (path) {
console.log("刷新");
return new Promise(function (resolve, reject) {
promiseAjax("/fs/ls", path).then(function (data) {
promiseAjax(MCSERVER.URL("fs/ls"), path).then(function (data) {
//排序
var res_dir = [];
var res_file = [];
@ -11408,34 +11409,34 @@
exports.mkdir = function (newName) {
console.log("新建目录");
return promiseAjax("/fs/mkdir", newName);
return promiseAjax(MCSERVER.URL("fs/mkdir"), newName);
};
exports.copy = function (fileStack) {
console.log("复制");
return promiseAjax("/fs/cp", fileStack);
return promiseAjax(MCSERVER.URL("fs/cp"), fileStack);
};
exports.paste = function () {
console.log("粘贴");
return promiseAjax("/fs/patse");
return promiseAjax(MCSERVER.URL("fs/patse"));
};
exports.remove = function (fileStack) {
console.log("删除");
return promiseAjax("/fs/rm", fileStack);
return promiseAjax(MCSERVER.URL("fs/rm"), fileStack);
};
exports.cponce = function (fileStack) {
console.log("剪贴");
return promiseAjax("/fs/ct", fileStack);
return promiseAjax(MCSERVER.URL("fs/ct"), fileStack);
};
exports.rename = function (filesStack, newName) {
console.log("重名名:", filesStack[0].name, "->", newName);
if (filesStack.length == 1) {
var oldName = filesStack[0].name;
return promiseAjax("/fs/rename", {
return promiseAjax(MCSERVER.URL("fs/rename"), {
oldName: oldName,
newName: newName
});

File diff suppressed because one or more lines are too long

View File

@ -19,9 +19,10 @@
<div class="row">
<div class="m-header">
<p>
<span style="color: #ffff19;">MCserver</span>
<span style="color: #ffff19;">Mcserver</span>
<span style="color: #49ff3e;">Online</span>
<span style="color: white;">File Manager</span>
<span style="color: #ff01d5;">File</span>
<span style="color: white;"> Manager</span>
</p>
</div>
<div class="container m-panel">
@ -44,6 +45,8 @@
</div>
</div>
<!--URL 处理函数-->
<script type="text/javascript" src="../common/URL.js"></script>
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
<script type="text/javascript" src="static/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="dist/app.js"></script>