基于Gin + Casbin + Ant Design React 的RBAC权限管理脚手架
- go 1.11+
- node 8.12.0+
- yarn 1.12.3+
如果github源太慢,可以拉取国内源:https://gitee.com/lyric/gin-admin.git
git clone https://github.com/LyricTian/gin-admin.git $GOPATH/src/github.com/LyricTian/gin-admin
编辑$GOPATH/src/github.com/LyricTian/gin-admin/config/config.toml配置文件,更改如下配置
# mysql数据库配置
[mysql]
# 连接地址(格式:127.0.0.1:3306)
addr = "127.0.0.1:3306"
# 用户名
username = "root"
# 密码
password = "123456"
# 数据库
database = "ginadmin"
CREATE DATABASE `ginadmin` DEFAULT CHARACTER SET = `utf8mb4`;
- 初始化菜单数据:
$GOPATH/src/github.com/LyricTian/gin-admin/script/init_menu.sql
cd $GOPATH/src/github.com/LyricTian/gin-admin
cd cmd/server
go build -o server
./server -c ../../config/config.toml -m ../../config/model.conf
cd web
yarn
yarn start
在配置文件中可设定`system_root_user`配置项指定用户名及密码,默认用户名为:root,密码为:123
- Gin - https://github.com/gin-gonic/gin
- Casbin - https://github.com/casbin/casbin
- Ant Design - https://ant.design
Copyright (c) 2018 Lyric