Documentation
¶
Overview ¶
Code generated for package main by go-bindata DO NOT EDIT. (@generated) sources: simple_admin_templates/CNAME simple_admin_templates/asset-manifest.json simple_admin_templates/favicon.png simple_admin_templates/home_bg.png simple_admin_templates/icons/icon-128x128.png simple_admin_templates/icons/icon-192x192.png simple_admin_templates/icons/icon-512x512.png simple_admin_templates/layouts__BasicLayout.528d606b.async.js simple_admin_templates/layouts__BasicLayout.5d6a0276.chunk.css simple_admin_templates/layouts__SecurityLayout.0115ad76.async.js simple_admin_templates/layouts__UserLayout.b53fe6b6.chunk.css simple_admin_templates/layouts__UserLayout.f746a429.async.js simple_admin_templates/p__404.ee09bdf9.async.js simple_admin_templates/p__Welcome.72864ae1.chunk.css simple_admin_templates/p__Welcome.d03bc865.async.js simple_admin_templates/p__account__changePassword.80e657bd.async.js simple_admin_templates/p__dataShow.ae0d5de6.async.js simple_admin_templates/p__dataShow.b348721e.chunk.css simple_admin_templates/p__userManage.432db247.chunk.css simple_admin_templates/p__userManage.63745111.async.js simple_admin_templates/p__user__login.49d4f094.chunk.css simple_admin_templates/p__user__login.69c28ef4.async.js simple_admin_templates/p__user__reg.7089f7db.chunk.css simple_admin_templates/p__user__reg.ba1abe9c.async.js simple_admin_templates/pro_icon.svg simple_admin_templates/simple_admin.template simple_admin_templates/static/logo.f0355d39.svg simple_admin_templates/umi.d10f205a.css simple_admin_templates/umi.ed588113.js simple_admin_templates/vendors~layouts__BasicLayout.6d6fa217.async.js simple_admin_templates/vendors~layouts__BasicLayout.8a8bd272.chunk.css simple_admin_templates/vendors~layouts__BasicLayout~p__Welcome~p__account__changePassword~p__dataShow~p__userManage~p__user~60880431.b89631fd.chunk.css simple_admin_templates/vendors~layouts__BasicLayout~p__Welcome~p__account__changePassword~p__dataShow~p__userManage~p__user~60880431.d73b0ff9.async.js simple_admin_templates/vendors~layouts__UserLayout.adb92b26.async.js simple_admin_templates/vendors~p__Welcome.9a3636d6.chunk.css simple_admin_templates/vendors~p__Welcome.d4bdb317.async.js simple_admin_templates/vendors~p__account__changePassword~p__dataShow~p__userManage.7116cd40.async.js simple_admin_templates/vendors~p__account__changePassword~p__dataShow~p__userManage.85bb279b.chunk.css simple_admin_templates/vendors~p__account__changePassword~p__dataShow~p__userManage~p__user__login~p__user__reg.2b50ec8e.async.js simple_admin_templates/vendors~p__account__changePassword~p__dataShow~p__userManage~p__user__login~p__user__reg.fd04645f.chunk.css simple_admin_templates/vendors~p__dataShow~p__userManage.066cc075.async.js simple_admin_templates/vendors~p__dataShow~p__userManage.7fe1b3ca.chunk.css
Index ¶
- Variables
- func AddRouterData(ctx iris.Context)
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func ChangeUserPassword(ctx iris.Context)
- func ChangeUserRoles(ctx iris.Context)
- func Configuration(ctx iris.Context)
- func EditRouterData(ctx iris.Context)
- func GenJwtToken(userUid, userName string) string
- func GetCurrentUser(ctx iris.Context)
- func GetMapValues(a map[string]string) []string
- func GetRouterCustomAction(ctx iris.Context)
- func GetRouterData(ctx iris.Context)
- func GetRouterFields(ctx iris.Context)
- func GetRouterSingleData(ctx iris.Context)
- func GetRouters(ctx iris.Context)
- func Index(ctx iris.Context)
- func IsNum(s string) bool
- func Login(ctx iris.Context)
- func MsgLog(msg string) error
- func MustAsset(name string) []byte
- func PolicyRequireAdminMiddleware(ctx iris.Context)
- func PolicyValidMiddleware(ctx iris.Context)
- func RandStringBytes(n int) string
- func Reg(ctx iris.Context)
- func RemoveRouterData(ctx iris.Context)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func StringsContains(a []string, x string) bool
- func TokenToUserUidMiddleware(ctx iris.Context)
- type Config
- type ConfigResp
- type CustomAction
- type CustomActionResp
- type DeleteReq
- type GetCurrentUserResp
- type GlobalResp
- type PagResult
- type Policy
- type SpAdmin
- type TableFieldsResp
- type UserChangePasswordReq
- type UserChangeRolesReq
- type UserLoginReq
- type UserLoginResp
- type UserModel
Constants ¶
This section is empty.
Variables ¶
var ( NowSpAdmin *SpAdmin SvKey = sv.GlobalContextKey DefaultPrefix = "/SP_PREFIX" )
var CustomJwt = jwt.New(jwt.Config{ ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) { return MySecret, nil }, Expiration: true, SigningMethod: jwt.SigningMethodHS256, })
自定义JWT 使用办法 中间层 handler.CustomJwt.Serve, handler.TokenToUserUidMiddleware,user handler
var MySecret = []byte("8657684ae02840ead423e0d781a7a0c5")
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/
foo.txt
img/
a.png
b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func GetMapValues ¶
func GetRouterCustomAction ¶ added in v1.0.8
获取单个表的自定义操作
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func PolicyRequireAdminMiddleware ¶
必须admin权限middleware
func RandStringBytes ¶
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func StringsContains ¶
Types ¶
type Config ¶
type Config struct {
Name string // 后台显示名称
Engine *xorm.Engine // xorm engine实例
App *iris.Application // iris实例
ModelList []interface{} // 模型列表
UserModel interface{} // 用户模型
RunSync bool // 是否进行sync
PageSize int
AbridgeName string
Prefix string
InitAdminUserName string
InitAdminPassword string
UserModelSpecialUniqueName string
CustomAction []CustomAction
}
type ConfigResp ¶ added in v1.0.2
type CustomAction ¶ added in v1.0.8
type CustomAction struct {
Name string `json:"name"` // action display name
Methods string `json:"methods"` // request run methods
Valid interface{} `json:"valid"` // request valid struct
Path string `json:"path"` // request path
Scope []interface{} `json:"scope"` // show where
Func func(ctx context.Context)
}
自定义action
type CustomActionResp ¶ added in v1.0.8
type DeleteReq ¶ added in v1.0.2
type DeleteReq struct {
Ids string `json:"ids" comment:"标识符列表" validate:"required,min=1"`
}
type GetCurrentUserResp ¶ added in v1.0.2
type GlobalResp ¶ added in v1.0.2
type GlobalResp struct {
Code uint16 `json:"code"` // 状态码
Message string `json:"message"` // 消息
Data interface{} `json:"data"`
}
所有返回必须包裹一层resp
type SpAdmin ¶
type SpAdmin struct {
// contains filtered or unexported fields
}
func (*SpAdmin) Pagination ¶
分页
type TableFieldsResp ¶ added in v1.0.3
type UserChangePasswordReq ¶ added in v1.0.2
type UserChangePasswordReq struct {
Id uint64 `json:"id" comment:"id" validate:"required"`
UserName string `json:"user_name" comment:"用户名" validate:"required,max=20,min=3"`
Password string `json:"password" comment:"密码" validate:"required,min=3,max=20"`
}
用户变更密码
type UserChangeRolesReq ¶ added in v1.0.2
type UserChangeRolesReq struct {
Id uint64 `json:"id" comment:"id" validate:"required"`
Role string `json:"role" comment:"群组名" validate:"required"`
Add bool `json:"add" comment:"添加"`
}
admin 变更用户群组
type UserLoginReq ¶ added in v1.0.2
type UserLoginReq struct {
UserName string `json:"user_name" comment:"用户名" validate:"required,max=20,min=3"`
Password string `json:"password" comment:"密码" validate:"required,min=3,max=20"`
}
用户登录