diff --git a/proto.js b/proto.js index 0d691767..a39d9890 100644 --- a/proto.js +++ b/proto.js @@ -13,8 +13,8 @@ var ice = { SHOW: "show", HIDE: "hide", HELP: "help", COPY: "copy", VIEW: "view", MODE: "mode", SHIP: "ship", EXEC: "exec", - POD: "pod", CTX: "ctx", CMD: "cmd", ARG: "arg", OPT: "opt", DEV: "dev", + POD: "pod", CTX: "ctx", CMD: "cmd", ARG: "arg", OPT: "opt", CAN: "can", RUN: "run", RES: "res", ERR: "err", CAN_PLUGIN: "can.plugin", @@ -34,9 +34,9 @@ var ice = { MSG_STATUS: "_status", MSG_PREFIX: "_prefix", - MSG_PROCESS: "_process", MSG_DISPLAY: "_display", MSG_TOOLKIT: "_toolkit", + MSG_PROCESS: "_process", PROCESS_AGAIN: "_again", MSG_TITLE: "sess.title", @@ -63,33 +63,6 @@ var ctx = { INDEX: "index", ARGS: "args", STYLE: "style", DISPLAY: "display", ACTION: "action", EXTRA_INDEX: "extra.index", EXTRA_ARGS: "extra.args", } -var cli = { - SYSTEM: "system", DAEMON: "daemon", - BEGIN: "begin", START: "start", OPEN: "open", CLOSE: "close", STOP: "stop", END: "end", RESTART: "restart", - COLOR: "color", WHITE: "white", BLACK: "black", RED: "red", GREEN: "green", BLUE: "blue", - YELLOW: "yellow", CYAN: "cyan", PURPLE: "purple", MAGENTA: "magenta", GLASS: "#0000", - MAKE: "make", MAIN: "main", EXEC: "exec", DONE: "done", COST: "cost", FROM: "from", CLEAR: "clear", - PWD: "pwd", - ORDER: "order", BUILD: "build", -} -var aaa = { - LOGIN: "login", LOGOUT: "logout", INVITE: "invite", TOKEN: "token", - PASSWORD: "password", USERNAME: "username", USERNICK: "usernick", BACKGROUND: "background", AVATAR: "avatar", - LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese", - VOID: "void", TECH: "tech", -} -var web = { - SPACE: "space", DREAM: "dream", SHARE: "share", - WEBSITE: "website", DRAW: "draw", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter", SUBMIT: "submit", CANCEL: "cancel", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage", - SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/", - - GET: "GET", PUT: "PUT", POST: "POST", DELETE: "DELETE", - Accept: "Accept", ContentType: "Content-Type", - ContentJSON: "application/json", ContentFORM: "application/x-www-form-urlencoded", - - CODE_INNER: "web.code.inner", WIKI_WORD: "web.wiki.word", - VIDEO_WEBM: "video/webm", -} var mdb = { DICT: "dict", META: "meta", HASH: "hash", LIST: "list", @@ -105,8 +78,35 @@ var mdb = { MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend", FOREACH: "*", RANDOMS: "%", } +var web = { + SPACE: "space", DREAM: "dream", SHARE: "share", + WEBSITE: "website", DRAW: "draw", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter", SUBMIT: "submit", CANCEL: "cancel", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage", + SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/", + + GET: "GET", PUT: "PUT", POST: "POST", DELETE: "DELETE", + Accept: "Accept", ContentType: "Content-Type", + ContentJSON: "application/json", ContentFORM: "application/x-www-form-urlencoded", + + CODE_INNER: "web.code.inner", WIKI_WORD: "web.wiki.word", + VIDEO_WEBM: "video/webm", +} +var aaa = { + LOGIN: "login", LOGOUT: "logout", INVITE: "invite", TOKEN: "token", + PASSWORD: "password", USERNAME: "username", USERNICK: "usernick", BACKGROUND: "background", AVATAR: "avatar", + LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese", + VOID: "void", TECH: "tech", +} +var lex = { + SPLIT: "split", PREFIX: "prefix", SUFFIX: "suffix", +} +var gdb = { + SIGNAL: "signal", +} var ssh = { } +var tcp = { + HOST: "host", PORT: "port", +} var nfs = { PATH: "path", FILE: "file", LINE: "line", SIZE: "size", ROOT: "root", COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags", @@ -116,14 +116,12 @@ var nfs = { ZML: "zml", IML: "iml", TXT: "txt", PNG: "png", WEBM: "webm", _CSS: ".css", _JS: ".js", } -var tcp = { - HOST: "host", PORT: "port", -} -var lex = { - SPLIT: "split", PREFIX: "prefix", SUFFIX: "suffix", -} -var gdb = { - SIGNAL: "signal", +var cli = { + PWD: "pwd", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build", + BEGIN: "begin", START: "start", OPEN: "open", CLOSE: "close", STOP: "stop", END: "end", RESTART: "restart", + COLOR: "color", WHITE: "white", BLACK: "black", RED: "red", GREEN: "green", BLUE: "blue", + YELLOW: "yellow", CYAN: "cyan", PURPLE: "purple", MAGENTA: "magenta", GLASS: "#0000", + MAKE: "make", MAIN: "main", EXEC: "exec", DONE: "done", COST: "cost", FROM: "from", CLEAR: "clear", } var log = { INFO: "info", WARN: "warn", ERROR: "error", DEBUG: "debug", TRACE: "trace", diff --git a/publish/client/mp/app.js b/publish/client/mp/app.js index 334e36ba..c8eb280d 100644 --- a/publish/client/mp/app.js +++ b/publish/client/mp/app.js @@ -5,7 +5,7 @@ App({ requests: function(cmd, data, cb) { wx.showLoading() this.request(cmd, data, function(msg) { wx.hideLoading(), typeof cb == "function" && cb(msg) }) }, - request: function(cmd, data, cb) { var app = this; data.sessid = app.conf.sessid, data.pod = app.conf.space + request: function(cmd, data, cb) { var app = this; data.sessid_443 = app.conf.sessid, data.pod = app.conf.space wx.request({method: "POST", url: app.conf.serve+"/"+cmd, data: data, success: function(res) { var msg = res.data if (res.statusCode == 401) { return app.usercode(function() { app.request(cmd, data, cb) }) } console.log("POST", cmd, msg) @@ -69,13 +69,13 @@ App({ }, usercode: function(cb) { var app = this - wx.login({success: function(res) { app.request("mp/login/sess", {code: res.code}, function(msg) { + wx.login({success: function(res) { app.request("mp/login/action/sess", {code: res.code}, function(msg) { wx.setStorage({key: "sessid", data: app.conf.sessid = msg.Result()}) typeof cb == "function" && cb() })}}) }, userinfo: function(cb) { var app = this - app.conf.userInfo? app.request("mp/login/user", app.conf.userInfo, function(msg) { + app.conf.userInfo? app.request("mp/login/action/user", app.conf.userInfo, function(msg) { typeof cb == "function" && cb(app.conf.userInfo) }): app.usercode(function() { wx.getSetting({success: function(res) { res.authSetting['scope.userInfo'] && wx.getUserInfo({success: function(res) {