1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-02 11:37:01 +08:00
This commit is contained in:
harveyshao 2021-09-06 16:49:43 +08:00
parent 1754b933cc
commit d0776d298f
2 changed files with 9 additions and 1 deletions

View File

@ -36,7 +36,11 @@ func _cat_find(m *ice.Message, name string) io.ReadCloser {
return kit.NewReadCloser(bytes.NewBuffer(b)) return kit.NewReadCloser(bytes.NewBuffer(b))
} }
return kit.NewReadCloser(bytes.NewBufferString(m.Cmdx("web.spide", "dev", "raw", "GET", path.Join("/share/local/", name)))) msg := m.Cmd("web.spide", "dev", "raw", "GET", path.Join("/share/local/", name))
if msg.Result(0) == ice.ErrWarn {
return kit.NewReadCloser(bytes.NewBufferString(""))
}
return kit.NewReadCloser(bytes.NewBufferString(msg.Result()))
} }
func _cat_show(m *ice.Message, name string) { func _cat_show(m *ice.Message, name string) {
if !_cat_right(m, name) { if !_cat_right(m, name) {

View File

@ -102,6 +102,10 @@ func _spide_show(m *ice.Message, arg ...string) {
if m.Warn(res.StatusCode != http.StatusOK, res.Status) { if m.Warn(res.StatusCode != http.StatusOK, res.Status) {
switch m.Set(ice.MSG_RESULT); res.StatusCode { switch m.Set(ice.MSG_RESULT); res.StatusCode {
case http.StatusNotFound: case http.StatusNotFound:
m.Warn(true, ice.ErrNotFound, " of ", uri)
return
case http.StatusUnauthorized:
m.Warn(true, ice.ErrNotRight, " of ", uri)
return return
default: default:
} }