chore: 完善并规范 Bell 上游源码导入 (#62)

This commit is contained in:
QiuSW
2026-08-27 18:26:56 +08:00
parent f5a3dd796b
commit 91befd63a7
36 changed files with 127 additions and 72 deletions
+2
View File
@@ -12,6 +12,7 @@ Bell 的后端与管理端是从冻结 GoAdmin 完整应用源码派生的独立
- 三个上游仓库的 `.git/`:避免嵌套仓库;来源由上表完整 commit 固定。
- `go-admin/go-admin-db.db`:上游跟踪的本地演示 SQLite 数据库,不属于产品源码,且 Bell 正式数据库为 PostgreSQL。
- `go-admin/static/uploadfile/`:上游跟踪的运行期演示上传图片与日志,不属于产品源码,也不得作为 Bell 运行数据导入。
- `go-admin-ui/node_modules/`:本机生成依赖目录,不属于上游跟踪源码;依赖由 `pnpm-lock.yaml` 重建。
- 日志、构建产物和本机未跟踪文件未导入。
@@ -19,6 +20,7 @@ Bell 的后端与管理端是从冻结 GoAdmin 完整应用源码派生的独立
## Bell 相对上游的首轮差异
- 对冻结源码导入后由完整基线差异检查报告的尾随空白、文件末尾多余空行做机械规范化;该项仅改变空白,不改变程序逻辑、配置语义或许可证内容。
- 生产配置固定使用 Bell 独立 PostgreSQL、端口和命名空间;数据库 URL 与 JWT secret 必须从 `BELL_*` 进程环境提供。
- 初始管理员必须在迁移时显式提供,仓库不保存默认账号、密码或可用 secret;登录页不预填凭据。
- JWT realm 与前端 token key 使用 Bell 独立名称,只接受 Authorization header,不复用 Sense Cookie/token。
+3 -3
View File
@@ -75,7 +75,7 @@ antd体验:[https://antd.go-admin.pro](https://antd.go-admin.pro/)
## 准备工作
你需要在本地安装 [go] [gin] [node](http://nodejs.org/) 和 [git](https://git-scm.com/)
你需要在本地安装 [go] [gin] [node](http://nodejs.org/) 和 [git](https://git-scm.com/)
同时配套了系列教程包含视频和文档,如何从下载完成到熟练使用,强烈建议大家先看完这些教程再来实践本项目!!!
@@ -151,11 +151,11 @@ go mod tidy
# 编译项目
go build
# 修改配置
# 修改配置
# 文件路径 go-admin/config/settings.yml
vi ./config/settings.yml
# 1. 配置文件中修改数据库信息
# 1. 配置文件中修改数据库信息
# 注意: settings.database 下对应的配置数据
# 2. 确认log路径
```
+2 -2
View File
@@ -28,7 +28,7 @@ Arco Design vue3 demo:[https://vue3.go-admin.dev](https://vue3.go-admin.dev/#/
antd demo:[https://antd.go-admin.pro](https://antd.go-admin.pro/)
> 上游在线演示凭据不属于 Bell,已移除。
>
>
## ✨ Feature
- Follow RESTful API design specifications
@@ -149,7 +149,7 @@ go mod tidy
# Compile the project
go build
# Change setting
# Change setting
# File path go-admin/config/settings.yml
vi ./config/settings.yml
+7 -7
View File
@@ -12,18 +12,18 @@ const INDEX = `
<title>GO-ADMIN欢迎您</title>
<style>
body{
margin:0;
padding:0;
margin:0;
padding:0;
overflow-y:hidden
}
</style>
<script src="https://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script type="text/javascript">
window.onerror=function(){return true;}
$(function(){
headerH = 0;
<script type="text/javascript">
window.onerror=function(){return true;}
$(function(){
headerH = 0;
var h=$(window).height();
$("#iframe").height((h-headerH)+"px");
$("#iframe").height((h-headerH)+"px");
});
</script>
</head>
+1 -1
View File
@@ -2,7 +2,7 @@ package apis
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/go-admin-team/go-admin-core/sdk/api"
+12 -12
View File
@@ -3,16 +3,16 @@
1. 配置文件说明
```yml
settings:
application:
# 项目启动环境
application:
# 项目启动环境
mode: dev # dev开发环境 prod线上环境;
host: 0.0.0.0 # 主机ip 或者域名,默认0.0.0.0
# 服务名称
name: go-admin
name: go-admin
# 服务端口
port: 8000
readtimeout: 1
writertimeout: 2
port: 8000
readtimeout: 1
writertimeout: 2
log:
# 日志文件存放路径
dir: temp/logs
@@ -23,15 +23,15 @@ settings:
timeout: 3600
database:
# 数据库名称
name: dbname
name: dbname
# 数据库类型
dbtype: mysql
dbtype: mysql
# 数据库地址
host: 127.0.0.1
host: 127.0.0.1
# 数据库密码
password: <由安全环境提供>
password: <由安全环境提供>
# 数据库端口
port: 3306
port: 3306
# 数据库用户名
username: root
username: root
```
+6 -6
View File
@@ -1,6 +1,6 @@
-- 开始初始化数据 ;
SET IDENTITY_INSERT sys_api ON;
INSERT INTO sys_api (id, handle, title, path, type, "action", created_at, updated_at, deleted_at, create_by, update_by)VALUES
INSERT INTO sys_api (id, handle, title, path, type, "action", created_at, updated_at, deleted_at, create_by, update_by)VALUES
(5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0),
(6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0),
(7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0),
@@ -141,7 +141,7 @@ INSERT INTO sys_dept (dept_id, parent_id, dept_path, dept_name, sort, leader, ph
SET IDENTITY_INSERT sys_dept OFF;
INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default,
status, "default", remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES
status, "default", remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES
(1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL);
INSERT INTO sys_dict_data VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL);
INSERT INTO sys_dict_data VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL);
@@ -191,12 +191,12 @@ INSERT INTO sys_dict_type VALUES (10, '通知状态', 'sys_notice_status', '2',
INSERT INTO sys_dict_type VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL);
INSERT INTO sys_job (job_id, job_name, job_group, job_type, cron_expression, invoke_target, args, misfire_policy, concurrent, status, entry_id, created_at, updated_at, deleted_at, create_by, update_by)VALUES
INSERT INTO sys_job (job_id, job_name, job_group, job_type, cron_expression, invoke_target, args, misfire_policy, concurrent, status, entry_id, created_at, updated_at, deleted_at, create_by, update_by)VALUES
(1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1),
(2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1);
SET IDENTITY_INSERT sys_menu ON;
INSERT INTO sys_menu (menu_id, menu_name, title, icon, path, paths, menu_type, "action", permission, parent_id, no_cache, breadcrumb, component, sort, visible, is_frame, create_by, update_by, created_at, updated_at, deleted_at)VALUES
INSERT INTO sys_menu (menu_id, menu_name, title, icon, path, paths, menu_type, "action", permission, parent_id, no_cache, breadcrumb, component, sort, visible, is_frame, create_by, update_by, created_at, updated_at, deleted_at)VALUES
(2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL),
(3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL),
(43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL),
@@ -332,11 +332,11 @@ INSERT INTO sys_menu_api_rule (sys_menu_menu_id, sys_api_id)VALUES (216, 6);
(43, 150),
(45, 151),
(46, 156);
INSERT INTO sys_post (post_id, post_name, post_code, sort, status, remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES
INSERT INTO sys_post (post_id, post_name, post_code, sort, status, remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES
(1, '首席执行官', 'CEO', 0, '2','首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL),
(2, '首席技术执行官', 'CTO', 2, '2','首席技术执行官', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL),
(3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL);
INSERT INTO sys_role (role_id, role_name, status, role_key, role_sort, flag, remark, admin, data_scope, create_by, update_by, created_at, updated_at, deleted_at)VALUES
INSERT INTO sys_role (role_id, role_name, status, role_key, role_sort, flag, remark, admin, data_scope, create_by, update_by, created_at, updated_at, deleted_at)VALUES
(1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL);
-- Bell 不在仓库中保存默认管理员;正式支持的 PostgreSQL 迁移从安全环境创建初始账号。
-- 数据完成 ;
+1 -1
View File
@@ -54,7 +54,7 @@ settings:
# password: xxxxxx
# db: 2
# key存在即可
memory: ''
memory: ''
queue:
memory:
poolSize: 100
-1
View File
@@ -16,4 +16,3 @@ services:
networks:
myweb:
driver: bridge
File diff suppressed because one or more lines are too long
-1
View File
@@ -44,4 +44,3 @@ export function del{{.ClassName}}(data) {
data: data
})
}
@@ -42,11 +42,11 @@ func (e {{.ClassName}}) GetPage(c *gin.Context) {
Bind(&req).
MakeService(&s.Service).
Errors
if err != nil {
e.Logger.Error(err)
e.Error(500, err, err.Error())
return
}
if err != nil {
e.Logger.Error(err)
e.Error(500, err, err.Error())
return
}
p := actions.GetPermissionFromContext(c)
list := make([]models.{{.ClassName}}, 0)
-1
View File
@@ -100,4 +100,3 @@ return
success = true
return
}
-1
View File
@@ -5,4 +5,3 @@ ENV = 'staging'
# base api
VUE_APP_BASE_API = ''
+1 -1
View File
@@ -1,6 +1,6 @@
name: Build CI
on:
on:
push:
branches: [ master ]
pull_request:
+7 -7
View File
@@ -34,7 +34,7 @@
- 支持 Swagger 文档(基于swaggo)
- 基于 GORM 的数据库存储,可扩展多种类型数据库
- 基于 GORM 的数据库存储,可扩展多种类型数据库
- 配置文件简单的模型映射,快速能够得到想要的配置
@@ -66,7 +66,7 @@
## 准备工作
你需要在本地安装 [go] [gin] [node](http://nodejs.org/) 和 [git](https://git-scm.com/)
你需要在本地安装 [go] [gin] [node](http://nodejs.org/) 和 [git](https://git-scm.com/)
同时配套了系列教程包含视频和文档,如何从下载完成到熟练使用,强烈建议大家先看完这些教程再来实践本项目!!!
@@ -74,9 +74,9 @@
[步骤一 - 基础内容介绍](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial01.html)
[步骤二 - 实际应用 - 编写增删改查](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial02.html)
[步骤二 - 实际应用 - 编写增删改查](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial02.html)
### 手把手教你从入门到放弃 - 视频教程
### 手把手教你从入门到放弃 - 视频教程
[如何启动go-admin](https://www.bilibili.com/video/BV1z5411x7JG)
@@ -141,11 +141,11 @@ cd ./go-admin
# 编译项目
go build
# 修改配置
# 修改配置
# 文件路径 go-admin/config/settings.yml
vi ./config/setting.yml
vi ./config/setting.yml
# 1. 配置文件中修改数据库信息
# 1. 配置文件中修改数据库信息
# 注意: settings.database 下对应的配置数据
# 2. 确认log路径
```
+2 -2
View File
@@ -134,9 +134,9 @@ cd ./go-admin
# Compile the project
go build
# Change setting
# Change setting
# File path go-admin/config/settings.yml
vi ./config/setting.yml
vi ./config/setting.yml
# 1. Modify the database information in the configuration file
# Note: The corresponding configuration data under settings.database
+1 -2
View File
@@ -3,7 +3,7 @@
## 问题描述
编译时出现警告:
```
Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated
Deprecation Warning [legacy-js-api]: The legacy JS API is deprecated
and will be removed in Dart Sass 2.0.0.
```
@@ -87,4 +87,3 @@ npm run dev
- [Sass Legacy JS API](https://sass-lang.com/d/legacy-js-api)
- [Sass Silencing Deprecations](https://sass-lang.com/documentation/cli/dart-sass/#silencedeprecations)
- [sass-loader v13 文档](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
+35
View File
@@ -0,0 +1,35 @@
const { run } = require('runjs')
const chalk = require('chalk')
const config = require('../vue.config.js')
const rawArgv = process.argv.slice(2)
const args = rawArgv.join(' ')
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
const report = rawArgv.includes('--report')
run(`vue-cli-service build ${args}`)
const port = 9526
const publicPath = config.publicPath
var connect = require('connect')
var serveStatic = require('serve-static')
const app = connect()
app.use(
publicPath,
serveStatic('./dist', {
index: ['index.html', '/']
})
)
app.listen(port, function () {
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
if (report) {
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
}
})
} else {
run(`vue-cli-service build ${args}`)
}
+1 -1
View File
@@ -1,4 +1,4 @@
{
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
-1
View File
@@ -9,4 +9,3 @@ export default {
name: 'App'
}
</script>
-1
View File
@@ -43,4 +43,3 @@ export function delSysApi(data) {
data: data
})
}
-1
View File
@@ -25,4 +25,3 @@ export function delSysLoginlog(data) {
data: data
})
}
-1
View File
@@ -25,4 +25,3 @@ export function delSysOperlog(data) {
data: data
})
}
-1
View File
@@ -43,4 +43,3 @@ export function delPost(postId) {
data: postId
})
}
-1
View File
@@ -132,4 +132,3 @@ export function getUserProfile() {
method: 'get'
})
}
-1
View File
@@ -59,4 +59,3 @@ export function startJob(jobId) {
method: 'get'
})
}
-1
View File
@@ -33,4 +33,3 @@ export function getInfo() {
method: 'get'
})
}
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="52px" height="45px" viewBox="0 0 52 45" version="1.1"
xmlns="http://www.w3.org/2000/svg"
<svg width="52px" height="45px" viewBox="0 0 52 45" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter x="-9.4%" y="-6.2%" width="118.8%" height="122.5%" filterUnits="objectBoundingBox" id="filter-1">

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="52px" height="45px" viewBox="0 0 52 45" version="1.1"
xmlns="http://www.w3.org/2000/svg"
<svg width="52px" height="45px" viewBox="0 0 52 45" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter x="-9.4%" y="-6.2%" width="118.8%" height="122.5%" filterUnits="objectBoundingBox" id="filter-1">

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

-1
View File
@@ -88,4 +88,3 @@ vueSticky.install = Vue => {
}
export default vueSticky
-1
View File
@@ -34,4 +34,3 @@ export default {
mutations,
actions
}
-1
View File
@@ -365,4 +365,3 @@ export function formatJson(filterVal, jsonData) {
}
}))
}
-1
View File
@@ -22,4 +22,3 @@ export default function openWindow(url, title, w, h) {
newWindow.focus()
}
}
@@ -311,4 +311,3 @@ export default {
}
}
</script>
@@ -0,0 +1,36 @@
<template>
<BasicLayout>
<template #wrapper>
<el-card class="box-card">
<div v-loading="loading" :style="'height:'+ height">
<iframe :src="src" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
</div>
</el-card>
</template>
</BasicLayout>
</template>
<script>
export default {
components: {
},
data() {
return {
src: process.env.VUE_APP_BASE_API + '/form-generator/index.html',
height: document.documentElement.clientHeight - 94.5 + 'px;',
loading: true
}
},
mounted: function() {
setTimeout(() => {
this.loading = false
}, 230)
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 94.5 + 'px;'
}
}
}
</script>