API连接错误提示更加详细,以便于快速发现问题

This commit is contained in:
刘祥超
2022-06-08 15:17:00 +08:00
parent 700836903f
commit 9361a27dca
6 changed files with 86 additions and 25 deletions

View File

@@ -5,19 +5,19 @@ import (
"github.com/iwind/TeaGo/maps"
)
// Tabbar定义
// Tabbar Tabbar定义
type Tabbar struct {
items []maps.Map
}
// 获取新对象
// NewTabbar 获取新对象
func NewTabbar() *Tabbar {
return &Tabbar{
items: []maps.Map{},
}
}
// 添加菜单项
// Add 添加菜单项
func (this *Tabbar) Add(name string, subName string, url string, icon string, active bool) maps.Map {
m := maps.Map{
"name": name,
@@ -31,12 +31,12 @@ func (this *Tabbar) Add(name string, subName string, url string, icon string, ac
return m
}
// 取得所有的Items
// Items 取得所有的Items
func (this *Tabbar) Items() []maps.Map {
return this.items
}
// 设置子菜单
// SetTabbar 设置子菜单
func SetTabbar(action actions.ActionWrapper, tabbar *Tabbar) {
action.Object().Data["teaTabbar"] = tabbar.Items()
}