1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-27 01:28:28 +08:00

fix mp.command

This commit is contained in:
shaoying 2019-03-04 08:55:32 +08:00
parent 399bfd20bd
commit 341aae3864
2 changed files with 7 additions and 2 deletions

View File

@ -77,8 +77,13 @@ App({
command: function(args, cb) {
var app = this
var cmd = args["cmd"]
if (cmd[0] == "note") {
cmd = ["context", "ssh", "sh", "node", "note", "context", "mdb"].concat(args["cmd"])
}
app.login(function(userInfo) {
app.request({cmd: ["context", "ssh", "sh", "node", "note", "context", "mdb"].concat(args["cmd"])}, function(res) {
app.request({cmd: cmd}, function(res) {
app.toast("ok")
typeof cb == "function" && cb(res)
})

View File

@ -11,7 +11,7 @@ Page({
onCommand: function(e) {
var page = this
var cmd = e.detail.value
app.command({"cmd": cmd}, function(res) {
app.command({"cmd": ["source", cmd]}, function(res) {
if (res.append) {
var table = []
for (var i = 0; i < res[res.append[0]].length; i++) {