Documentation
¶
Overview ¶
Code generated for package main by go-bindata DO NOT EDIT. (@generated) sources: templates/CNAME templates/asset-manifest.json templates/favicon.png templates/home_bg.png templates/icons/icon-128x128.png templates/icons/icon-192x192.png templates/icons/icon-512x512.png templates/index.html templates/layouts__BasicLayout.5d6a0276.chunk.css templates/layouts__BasicLayout.70fefa2c.async.js templates/layouts__SecurityLayout.8802f42e.async.js templates/layouts__UserLayout.b53fe6b6.chunk.css templates/layouts__UserLayout.f746a429.async.js templates/p__404.ee09bdf9.async.js templates/p__Welcome.72864ae1.chunk.css templates/p__Welcome.d03bc865.async.js templates/p__account__changePassword.9f6380da.async.js templates/p__dataShow.c2558fd9.async.js templates/p__userManage.23c70b5c.async.js templates/p__userManage.432db247.chunk.css templates/p__user__login.49d4f094.chunk.css templates/p__user__login.7b9d3ff8.async.js templates/p__user__reg.7089f7db.chunk.css templates/p__user__reg.94d4cb32.async.js templates/pro_icon.svg templates/static/logo.f0355d39.svg templates/umi.87c8b022.js templates/umi.d10f205a.css templates/vendors~layouts__BasicLayout.7b0d2ca9.async.js templates/vendors~layouts__BasicLayout.8a8bd272.chunk.css templates/vendors~layouts__BasicLayout~p__Welcome~p__account__changePassword~p__dataShow~p__userManage~p__user~60880431.b89631fd.chunk.css templates/vendors~layouts__BasicLayout~p__Welcome~p__account__changePassword~p__dataShow~p__userManage~p__user~60880431.d73b0ff9.async.js templates/vendors~layouts__UserLayout.adb92b26.async.js templates/vendors~p__Welcome.9a3636d6.chunk.css templates/vendors~p__Welcome.d4bdb317.async.js templates/vendors~p__account__changePassword~p__dataShow~p__userManage.7116cd40.async.js templates/vendors~p__account__changePassword~p__dataShow~p__userManage.85bb279b.chunk.css templates/vendors~p__account__changePassword~p__dataShow~p__userManage~p__user__login~p__user__reg.2b50ec8e.async.js templates/vendors~p__account__changePassword~p__dataShow~p__userManage~p__user__login~p__user__reg.fd04645f.chunk.css templates/vendors~p__dataShow~p__userManage.7fe1b3ca.chunk.css templates/vendors~p__dataShow~p__userManage.eab0f32e.async.js
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 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 PagResult
- type Policy
- type SpAdmin
- type UserModel
Constants ¶
This section is empty.
Variables ¶
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 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
Prefix string
InitAdminUserName string
InitAdminPassword string
UserModelSpecialUniqueName string
}
type SpAdmin ¶
type SpAdmin struct {
// contains filtered or unexported fields
}
var (
NowSpAdmin *SpAdmin
)
func (*SpAdmin) Pagination ¶
分页