• Stars
    star
    802
  • Rank 54,782 (Top 2 %)
  • Language
    JavaScript
  • Created over 10 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

基于beego的后台管理系统

beego admin

基于beego,jquery easyui ,bootstrap的一个后台管理系统

VERSION = "0.1.1"

获取安装

执行以下命令,就能够在你的GOPATH/src 目录下发现beego admin

$ go get github.com/beego/admin

初次使用

创建应用

首先,使用bee工具创建一个应用程序,参考http://beego.me/quickstart

$ bee new hello

创建成功以后,你能得到一个名叫hello的应用程序, 现在开始可以使用它了。找到到刚刚新建的程序hello/routers/router.go这个文件

import (
	"hello/controllers" 		//自身业务包
	"github.com/astaxie/beego"  //beego 包
	"github.com/beego/admin"  //admin 包
)

引入admin代码,再init函数中使用它

func init() {
	admin.Run()
	beego.Router("/", &controllers.MainController{})
}

配置文件

数据库目前仅支持MySQL,PostgreSQL,sqlite3,后续会添加更多的数据库支持。

数据库的配置信息需要填写,程序会根据配置自动建库 MySQL数据库链接信息

db_host = localhost
db_port = 3306
db_user = root
db_pass = root
db_name = admin
db_type = mysql

postgresql数据库链接信息

db_host = localhost
db_port = 5432
db_user = postgres
db_pass = postgres
db_name = admin
db_type = postgres
db_sslmode=disable

sqlite3数据库链接信息

###db_path 是指数据库保存的路径,默认是在项目的根目录
db_path = ./
db_name = admin
db_type = sqlite3

把以上信息配置成你自己数据库的信息。

还有一部分权限系统需要配置的信息

sessionon = true
rbac_role_table = role
rbac_node_table = node
rbac_group_table = group
rbac_user_table = user
#admin用户名 此用户登录不用认证
rbac_admin_user = admin

#默认不需要认证模块
not_auth_package = public,static
#默认认证类型 0 不认证 1 登录认证 2 实时认证
user_auth_type = 1
#默认登录网关
rbac_auth_gateway = /public/login
#默认模版
template_type=easyui

以上配置信息都需要加入到hello/conf/app.conf文件中, 可以参考admin/conf/app.conf的配置。

复制静态文件

最后还需要把js,css,image,tpl这些文件复制过来。

$ cd $GOPATH/src/hello
$ cp -R ../github.com/beego/admin/static ./
$ cp -R ../github.com/beego/admin/views ./

编译项目

全部做好了以后。就可以编译了,进入hello目录

$ go build

首次启动需要创建数据库、初始化数据库表。

$ ./hello -syncdb

好了,现在可以通过浏览器地址访问了http://localhost:8080/

默认得用户名密码都是admin

More Repositories

1

beego

beego is an open-source, high-performance web framework for the Go programming language.
Go
30,948
star
2

bee

Bee is a tool for helping develop with beego app framework.
Go
1,423
star
3

samples

An open source project for beego sample applications.
Go
913
star
4

beedoc

An open source project for beego documentation.
680
star
5

mux

A high performance and powerful trie based url path router for Go.
Go
486
star
6

wetalk

An open source project for Gopher community.
Go
481
star
7

beeweb

An open source project for official documentation and blog website of beego app framework.
JavaScript
243
star
8

tutorial

beego tutorial
CSS
228
star
9

beego-example

Beego Example
Go
136
star
10

social-auth

Social account connect in Beego
Go
86
star
11

swagger

swagger docs files
HTML
56
star
12

compress

Beego Compress provides an automated system for compressing Css and JavaScript files
Go
34
star
13

i18n

Package i18n is for app Internationalization and Localization.
Go
27
star
14

beewatch

Bee Watch is an interactive debugger for the Go programming language.
Go
26
star
15

products

Showcase of Beego products.
20
star
16

orm-benchmark

All golang orm benchmark
Go
19
star
17

website

beego website
CSS
19
star
18

beemod

beemod
Go
11
star
19

memcache

migrate vitess from google to github
Go
10
star
20

beeblog

An open source project for beego blog.
9
star
21

beego-cache

The independent cache module from Beego
Go
6
star
22

beego-doc

beego documents
Shell
5
star
23

beego-pro

beego pro template
5
star
24

compose

Define and run multi-beego applications with http or grpc
5
star
25

shorturl-admin

短域名后台
TypeScript
4
star
26

wengine

wechat engine
4
star
27

contrib

Collection of middlewares, modules, plugins, library created by the community
3
star
28

example

example base on beego
2
star
29

ast-annotation

Extract the annotation information
Go
2
star
30

dashboard

beego application dashboard
2
star
31

beego-blog

beego-blog
TypeScript
2
star
32

beego-error

The independent error module from Beego
Go
1
star
33

top-website

top-website
1
star
34

go-openapi-definition

Go
1
star
35

router

1
star