From 1f9e8d756fdb8b68906dc9eef607bff6daee360b Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 4 May 2025 08:48:56 +0800 Subject: [PATCH] add some --- core/code/go.go | 3 +-- logs.go | 7 ++++++- misc/wx/access.go | 2 +- misc/wx/agent.js | 10 +++++----- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/code/go.go b/core/code/go.go index 95058dd7..a4911ab9 100644 --- a/core/code/go.go +++ b/core/code/go.go @@ -82,8 +82,7 @@ func _go_show(m *ice.Message, arg ...string) { "gonganxitong/domain.go", "gonganxitong/command.go", "gonganxitong/quotalist.go", - "operation/studio.go", - ) && nfs.Exists(m, p) { + ) && nfs.Exists(m, p) && !kit.IsIn(path.Base(arg[1]), "studio.go") { if cmd := ctx.GetFileCmd(p); cmd != "" { if m.ActionKey() == mdb.RENDER { ctx.ProcessField(m, cmd, kit.Simple()) diff --git a/logs.go b/logs.go index 883a0990..ae9a5d92 100644 --- a/logs.go +++ b/logs.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "net/http" + "path" "runtime" "strings" "time" @@ -123,7 +124,11 @@ func (m *Message) Warn(err Any, arg ...Any) bool { } str, meta := m.join(arg...) if m.log(LOG_WARN, str, meta...); len(arg) > 0 { - m.Option(MSG_TITLE, kit.JoinWord(kit.Keys(m.Option(MSG_USERPOD), m.CommandKey(), m.ActionKey()), logs.FileLines(-2))) + p := path.Join(kit.Slice(strings.Split(logs.FileLines(-2), "/"), -2)...) + m.Info("what %v", strings.Split(logs.FileLines(-2), "/")) + m.Info("what %v", kit.Slice(strings.Split(logs.FileLines(-2), "/"), -2)) + m.Info("what %v", p) + m.Option(MSG_TITLE, kit.JoinWord(kit.Keys(m.Option(MSG_USERPOD), m.CommandKey(), m.ActionKey()), p)) m.error(arg...) kit.If(map[string]int{ ErrNotLogin: http.StatusUnauthorized, diff --git a/misc/wx/access.go b/misc/wx/access.go index 8f501233..d9571073 100644 --- a/misc/wx/access.go +++ b/misc/wx/access.go @@ -139,7 +139,7 @@ func init() { }, gdb.EventsAction(web.SPACE_GRANT, web.SPACE_LOGIN_CLOSE), mdb.ExportHashAction( mdb.SHORT, ACCESS, mdb.FIELD, "time,type,access,icons,usernick,appid,secret,token", tcp.SERVER, CGI_BIN, )), Hand: func(m *ice.Message, arg ...string) { - mdb.HashSelect(m, arg...).PushAction(OAUTH, web.SSO, mdb.REMOVE).StatusTimeCount(mdb.ConfigSimple(m, ACCESS, APPID), web.SERVE, m.MergeLink("/chat/wx/login/")) + mdb.HashSelect(m, arg...).PushAction(OAUTH, web.SSO, TOKENS, TICKET, mdb.REMOVE).StatusTimeCount(mdb.ConfigSimple(m, ACCESS, APPID), web.SERVE, m.MergeLink("/chat/wx/login/")) m.RewriteAppend(func(value, key string, index int) string { kit.If(key == cli.QRCODE, func() { value = ice.Render(m, ice.RENDER_QRCODE, value) }) return value diff --git a/misc/wx/agent.js b/misc/wx/agent.js index 0ae4d7d3..dbb1ba96 100644 --- a/misc/wx/agent.js +++ b/misc/wx/agent.js @@ -32,14 +32,14 @@ Volcanos(chat.ONIMPORT, { ]), openTagList: ["wx-open-subscribe"], }) wx.ready(function () { - function share(title, icons, content) { - wx.updateAppMessageShareData({title: title, desc: content||can.user.info.titles, link: location.href, imgUrl: icons}) - wx.updateTimelineShareData({title: title, link: location.href, imgUrl: icons}) + function share(title, icons, content, link) { + wx.updateAppMessageShareData({title: title, desc: content||can.user.info.titles, link: link||location.href, imgUrl: icons}) + wx.updateTimelineShareData({title: title, link: link||location.href, imgUrl: icons}) } var p = can.misc.Resource(can, can.user.info.favicon); can.base.beginWith(p, "/") && (p = location.origin + p) - can.user.agent.init = function(can, content, icons) { if (!can) { return } + can.user.agent.init = function(can, content, icons, link) { if (!can) { return } p = can.misc.Resource(can, icons||can.Conf(mdb.ICONS))||p; can.base.beginWith(p, "/") && (p = location.origin + p) - share(document.title, p, content) + share(document.title, p, content, link) }, can.user.agent.init(can.user.agent.cmd, can.user.agent._init_content, can.user.agent._init_icons) }) })