diff --git a/base/web/html/html.go b/base/web/html/html.go index 3101786e..cede309d 100644 --- a/base/web/html/html.go +++ b/base/web/html/html.go @@ -52,6 +52,7 @@ const ( SPAN = "span" TEXT = "text" PLUG = "plug" + FORM = "form" TEXTAREA = "textarea" PASSWORD = "password" CHECKBOX = "checkbox" diff --git a/core/code/vimer.go b/core/code/vimer.go index 8dedceb0..c9d42e53 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -138,7 +138,6 @@ func init() { m.Cmdy(TEMPLATE, kit.Ext(m.Option(mdb.FILE)), m.Option(nfs.FILE), m.Option(nfs.PATH)) }}, COMPLETE: {Hand: func(m *ice.Message, arg ...string) { - return m.Cmdy(COMPLETE, kit.Ext(m.Option(mdb.FILE)), m.Option(nfs.FILE), m.Option(nfs.PATH)) }}, COMPILE: {Hand: func(m *ice.Message, arg ...string) { diff --git a/misc.go b/misc.go index ce016f9c..50c6b97b 100644 --- a/misc.go +++ b/misc.go @@ -197,7 +197,12 @@ func (m *Message) ToastProcess(arg ...string) func(...string) { func (m *Message) Trans(en string, zh string) string { switch strings.ToLower(kit.Select("", kit.Split(m.Option(MSG_LANGUAGE), "_-"), 0)) { case "zh": - return zh + if zh == "" { + if h, ok := m.Target().Commands[m.CommandKey()].Actions[en]; ok { + return kit.Select(en, h.Help) + } + } + return kit.Select(en, zh) default: return en } diff --git a/misc/wx/access.go b/misc/wx/access.go index 85d7cedd..338104b2 100644 --- a/misc/wx/access.go +++ b/misc/wx/access.go @@ -95,7 +95,6 @@ func init() { } }}, MEDIA: {Hand: func(m *ice.Message, arg ...string) { - m.OptionDefault(ACCESS, mdb.Config(m, ACCESS)) m.Cmdy(web.SPIDE, WX, web.SPIDE_SAVE, arg[1], http.MethodGet, MEDIA_GET, oauth.ACCESS_TOKEN, m.Cmdx(ACCESS, TOKENS), "media_id", arg[0]) }}, OAUTH: {Icon: "bi bi-shield-fill-check", Hand: func(m *ice.Message, arg ...string) { @@ -145,6 +144,7 @@ func init() { } func spideToken(m *ice.Message, api string, token, expire string, arg ...string) { msg := mdb.HashSelect(m.Spawn(), m.OptionDefault(ACCESS, mdb.Config(m, ACCESS))) + m.Info("what token %v %v", msg.Append(expire), msg.Append(token)) if msg.Append(token) == "" || m.Time() > msg.Append(expire) { kit.If(api != TICKET_GETTICKET, func() { arg = append(arg, msg.AppendSimple(APPID, SECRET)...) }) res := m.Cmd(web.SPIDE, WX, kit.Select(http.MethodGet, http.MethodPost, api == STABLE_TOKEN), api, arg) diff --git a/misc/wx/agent.js b/misc/wx/agent.js index ae0ffa59..85aa51b1 100644 --- a/misc/wx/agent.js +++ b/misc/wx/agent.js @@ -1,11 +1,12 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { if (!can.user.info.username && can.user.info._cmd != "web.chat.oauth.client" && msg.Option("oauth")) { - can.user.jumps(msg.Option("oauth")) - return + return can.user.jumps(msg.Option("oauth")) } msg.Option(ice.MSG_ACTION, ""), can.require([msg.Option(nfs.SCRIPT)], function(can) { var debug = msg.isDebug() && can.user.info.userrole == aaa.TECH; debug && can.onmotion.toggle(can, can._fields, true) + // debug = false + can.onmotion.hidden(can, can._fields) wx.config({debug: debug, signature: msg.Option("signature"), timestamp: msg.Option("timestamp"), nonceStr: msg.Option("noncestr"), appId: msg.Option("appid"), openTagList: ["wx-open-subscribe"], jsApiList: can.core.Item({ @@ -26,9 +27,14 @@ Volcanos(chat.ONIMPORT, { can.base.isFunc(cb) && cb(res.serverId) } }) }, }, function(key, value) { return can.user.agent[key] = value, key }).concat([ - // "updateAppMessageShareData", "updateTimelineShareData", + "updateAppMessageShareData", "updateTimelineShareData", ]), }) + wx.ready(function () { + var p = can.misc.Resource(can, can.user.info.favicon); can.base.beginWith(p, "/") && (p = location.origin + p) + wx.updateAppMessageShareData({title: can.user.info.titles, desc: "车管所业务代办", link: location.href, imgUrl: p}) + wx.updateTimelineShareData({title: can.user.info.titles, link: location.href, imgUrl: p}) + }) }) }, })