Skip to content

Commit

Permalink
Merge branch 'dev-1.2.0' of github.com:nicelizhi/easy-admin into dev-…
Browse files Browse the repository at this point in the history
…1.2.0
  • Loading branch information
xxl4 committed Nov 12, 2023
2 parents de529ab + 0e10c1a commit c18047e
Show file tree
Hide file tree
Showing 19 changed files with 498 additions and 61 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: cd ./ui/ && npm install --legacy-peer-deps

- name : npm build
run: cd ./ui/ && npm run build:prod --legacy-peer-deps
run: cd ./ui/ && npm run build:prod:base --legacy-peer-deps

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
Expand All @@ -67,7 +67,7 @@ jobs:
run: go mod tidy

- name: Build
run: CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -a -installsuffix "" -o easy-admin .
run: CGO_ENABLED=0 go build -ldflags="-s -w" -a -installsuffix "" -o easy-admin .

- name: Build the Docker image and push
run: |
Expand All @@ -81,6 +81,7 @@ jobs:
echo "************ docker images end"
docker push ${{ env.IMAGE_NAME_TAG }} # 推送
echo "************ docker push end"
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
Expand All @@ -100,4 +101,8 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: nicesteven/easy-admin:latest
tags: nicesteven/easy-admin:latest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ all:
# build vue ui
build-ui:
@echo "build node start"
cd ./ui/ && npm run build:prod
cd ./ui/ && npm run build:prod:base

# build go application
build:
Expand Down
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@

# easy-admin
# Easy-Admin

[![Build Status](https://github.com/nicelizhi/easy-admin/workflows/Build/badge.svg)](https://github.com/nicelizhi/easy-admin)
[![Release](https://img.shields.io/github/release/nicelizhi/easy-admin.svg?style=flat-square)](https://github.com/nicelizhi/easy-admin/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/nicelizhi/easy-admin)](https://goreportcard.com/report/github.com/nicelizhi/easy-admin)
[![HitCount](https://views.whatilearened.today/views/github/nicelizhi/easy-admin.svg)](https://github.com/nicelizhi/easy-admin)
[![License](https://img.shields.io/github/license/nicelizhi/easy-admin
)](https://github.com/nicelizhi/easy-admin)
[![Commits](https://img.shields.io/github/commit-activity/m/nicelizhi/easy-admin?color=ffff00)](https://github.com/nicelizhi/easy-admin/commits/main)
[![Docker Pulls](https://img.shields.io/docker/pulls/nicesteven/easy-admin)](https://hub.docker.com/r/nicesteven/easy-admin)


## About Easy-Admin

Easyadmin is a Quick, beautiful and modern admin gererator for Go VUE application.

English | [简体中文](https://nicelizhi.github.io/easy-admin/zh/)


>> The front-end and back-end separation authority management system based on Gin + Vue is extremely simple to initialize the system. You only need to modify the database connection in the configuration file. The system supports multi-instruction operations. Migration instructions can make it easier to initialize database information. Service instructions It's easy to start the api service.
## ✨ Feature
## Online demo
- [Vue2 demo](https://easy-admin-ui.vercel.app)
- [Arco demo](https://hello-arco-pro.vercel.app/)( testing now)

## Feature

- Follow RESTful API design specifications

Expand All @@ -31,12 +46,12 @@

- Multi Language

- TimeZone Support
- Multi-platform (Darwin Freebsd Linux Windows)

- TODO: unit test
- TimeZone Support


## 🎁 Internal
## Internal

1. User management: The user is the system operator, this function mainly completes the system user configuration.
2. Department management: configure the system organization (company, department, group), and display the tree structure to support data permissions.
Expand All @@ -52,6 +67,7 @@
1. Service monitoring: View the basic information of some servers.
1. Content management: demo function, including classification management and content management. You can refer to the easy to use quick start.


# Api Document Generate

```
Expand All @@ -66,13 +82,13 @@ http://localhost:8000/swagger/admin/index.html

# Install

[Docker Install](https://nicelizhi.github.io/easy-admin/guide/install/docker)
- [Docker Install](https://nicelizhi.github.io/easy-admin/guide/install/docker)

[Docker Composer Install](https://nicelizhi.github.io/easy-admin/guide/install/docker-composer)
- [Docker Composer Install](https://nicelizhi.github.io/easy-admin/guide/install/docker-composer)

[K8s Install](https://nicelizhi.github.io/easy-admin/guide/install/k8s)
- [K8s Install](https://nicelizhi.github.io/easy-admin/guide/install/k8s)

[Binary Install](https://nicelizhi.github.io/easy-admin/guide/install/binary)
- [Binary Install](https://nicelizhi.github.io/easy-admin/guide/install/binary)


# Configure
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ func initRouter() {
AcceptLanguage: []language.Tag{language.English, language.Chinese},
DefaultLanguage: language.English,
UnmarshalFunc: json.Unmarshal,
FormatBundleFile: "json",
FormatBundleFile: "json", //default json format
})))

// when you will pack vue into go,you should need config it
r.NoRoute(func(ctx *gin.Context) {
accept := ctx.Request.Header.Get("Accept")
flag := strings.Contains(accept, "text/html")
Expand Down
11 changes: 9 additions & 2 deletions common/middleware/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ func Options(c *gin.Context) {
if c.Request.Method != "OPTIONS" {
c.Next()
} else {
c.Header("Access-Control-Allow-Origin", "*")
origin := c.Request.Header.Get("Origin")
c.Header("Access-Control-Allow-Origin", origin)
c.Header("Access-Control-Allow-Methods", "GET,POST,PUT,PATCH,DELETE,OPTIONS")
c.Header("Access-Control-Allow-Headers", "authorization, origin, content-type, accept")
c.Header("Allow", "HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS")
c.Header("Access-Control-Allow-Credentials", "true")
c.Header("Content-Type", "application/json")
c.AbortWithStatus(200)
}
Expand All @@ -35,7 +37,12 @@ func Options(c *gin.Context) {
// Secure is a middleware function that appends security
// and resource access headers.
func Secure(c *gin.Context) {
c.Header("Access-Control-Allow-Origin", "*")
origin := c.Request.Header.Get("Origin")
c.Header("Access-Control-Allow-Origin", origin)
c.Header("Access-Control-Allow-Methods", "GET,POST,PUT,PATCH,DELETE,OPTIONS")
c.Header("Access-Control-Allow-Headers", "authorization, origin, content-type, accept")
c.Header("Allow", "HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS")
c.Header("Access-Control-Allow-Credentials", "true")
//c.Header("X-Frame-Options", "DENY")
c.Header("X-Content-Type-Options", "nosniff")
c.Header("X-XSS-Protection", "1; mode=block")
Expand Down
10 changes: 5 additions & 5 deletions config/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ CREATE TABLE `sys_dept` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

INSERT INTO `sys_dept` (`dept_id`, `parent_id`, `dept_path`, `dept_name`, `sort`, `leader`, `phone`, `email`, `status`, `create_by`, `update_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 0, '/0/1/', '上海申东', 0, '姚老师', '13524084051', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2023-10-21 21:36:42.379', 0),
(7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', 0),
(8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', 0),
(9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', 0),
(10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', 1, 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', 0),
(1, 0, '/0/1/', '上海公司', 0, '姚老师', '13524084051', 'nice.lizhi@gmail.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2023-10-21 21:36:42.379', 0),
(7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13524084051', 'nice.lizhi@gmail.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', 0),
(8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13524084051', 'nice.lizhi@gmail.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', 0),
(9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13524084051', 'nice.lizhi@gmail.com', 2, 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', 0),
(10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13524084051', 'nice.lizhi@gmail.com', 1, 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', 0),
(11, 10, '/0/1/10/11/', '财务部门', 10, 'admin', '13524084051', '[email protected]', 2, 0, 0, '2023-10-13 20:53:10.408', '2023-10-13 20:53:10.410', 0);

DROP TABLE IF EXISTS `sys_dict_data`;
Expand Down
Loading

0 comments on commit c18047e

Please sign in to comment.