mirror of
https://shylinux.com/x/icebergs
synced 2025-05-02 11:37:01 +08:00
opt some
This commit is contained in:
parent
1754b933cc
commit
d0776d298f
@ -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) {
|
||||||
|
@ -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:
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user