hequan2017 / go-admin Goto Github PK
View Code? Open in Web Editor NEWgo web api,包含gin+gorm+jwt+rbac等。
Home Page: https://github.com/hequan2017/go-admin/
License: MIT License
go web api,包含gin+gorm+jwt+rbac等。
Home Page: https://github.com/hequan2017/go-admin/
License: MIT License
如果是多实例部署,修改某个用户的权限,其他实例如何感应?
setting.Setup()
models.Setup()
logging.Setup()
inject.Init()
是否修改成 类似在 setting.go文件
func init() {
}
使用 init 启动比较优雅?
enforcer, err := casbin.NewEnforcer(path, false)
assignment mismatch: 2 variables but casbin.NewEnforcer returns 1 values
请问如何解决
mba➜ go-admin git:(master) ✗ >swag init
2019/10/21 16:42:50 Generate swagger docs....
2019/10/21 16:42:50 Generate general API Info, search dir:./
2019/10/21 16:42:50 ParseComment error in file routers/api/v1/role.go :can not find schema type: "v1.json"
token中不能放敏感信息,因为有效载荷是经过Base64编码生成的,并不是加密。所以不能存放敏感信息。
感谢。
readme中的例子,可以控制test访问user表,但表里的所有数据都可以访问,如何控制用户只能访问自己的用户数据,比如test用户只能访问自己创建的用户数据?
不知道是不是我理解错了。
AddUser方法的role_id 是int类型。不是应该是[]int{}类型吗?
添加用户的时候,用户可属于多角色
RT
前端地址 https://go-admin-vue 访问不了,不是有效的网址。
go mod 里面加了 com 是不是会报错啊
我这边显示为 go mod unexpect moudle path “github.com/unknwon/com”
你好,最近再学习咱们这个项目,但是文档里的域名和sql的链接失效了,可以给补上sql文件吗?谢谢大神
curl -X POST "http://127.0.0.1:8000/auth" -H "accept: application/json" -H "Content-Type: application/json" -d "{ "password": "admin", "username": "123456"}"
{
"code": 401,
"data": null,
"msg": "Token错误"
}
Due to GitHub handle change (to lowercase) for long term purpose, go get
may fail fetching github.com/Unknwon/com
.
Please consider take some time to update it to github.com/unknwon/com
in the go.mod
file.
I truly apology for the inconvenience and unintended troubles caused.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x117c4e2]
goroutine 1 [running]:
github.com/casbin/casbin/model.Model.RemoveFilteredPolicy(0xc0003d2120, 0x178722c, 0x1, 0x178722c, 0x1, 0x1, 0xc0004b33c0, 0x1, 0x1, 0xc0003b4180)
/Users/Yang/Desktop/Go/src/github.com/casbin/casbin/model/policy.go:115 +0xc2
github.com/casbin/casbin.(*Enforcer).removeFilteredPolicy(0xc00010e310, 0x178722c, 0x1, 0x178722c, 0x1, 0x1, 0xc0004b33c0, 0x1, 0x1, 0x2f35d80)
/Users/Yang/Desktop/Go/src/github.com/casbin/casbin/internal_api.go:67 +0x9e
github.com/casbin/casbin.(*Enforcer).RemoveFilteredNamedGroupingPolicy(0xc00010e310, 0x178722c, 0x1, 0x1, 0xc0004b33c0, 0x1, 0x1, 0xc0004b33c0)
/Users/Yang/Desktop/Go/src/github.com/casbin/casbin/management_api.go:254 +0x8c
github.com/casbin/casbin.(*Enforcer).RemoveFilteredGroupingPolicy(0xc00010e310, 0x1, 0xc0004b33c0, 0x1, 0x1, 0xc00012e730)
/Users/Yang/Desktop/Go/src/github.com/casbin/casbin/management_api.go:229 +0x68
github.com/casbin/casbin.(*Enforcer).DeleteRole(0xc00010e310, 0xc0004b0570, 0x4)
/Users/Yang/Desktop/Go/src/github.com/casbin/casbin/rbac_api.go:70 +0x82
github.com/hequan2017/go-admin/service/role_service.(*Role).LoadPolicy(0xc0001582a0, 0x1, 0x1, 0x0)
/Users/Yang/Desktop/Go/src/github.com/hequan2017/go-admin/service/role_service/role.go:143 +0x87
github.com/hequan2017/go-admin/service/role_service.(*Role).LoadAllPolicy(0xc0001582a0, 0x8, 0xc0003d21b0)
/Users/Yang/Desktop/Go/src/github.com/hequan2017/go-admin/service/role_service/role.go:128 +0x83
github.com/hequan2017/go-admin/middleware/inject.LoadCasbinPolicyData(0x0, 0x1858c60)
/Users/Yang/Desktop/Go/src/github.com/hequan2017/go-admin/middleware/inject/inject.go:61 +0x3d
main.main()
/Users/Yang/Desktop/Go/src/github.com/hequan2017/go-admin/main.go:33 +0x48
exit status 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.