Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
nizhengjia888
gin-vue-admin
提交
fde318d3
G
gin-vue-admin
项目概览
nizhengjia888
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
fde318d3
编写于
5月 06, 2021
作者:
Mr.奇淼(
提交者:
GitHub
5月 06, 2021
浏览文件
操作
浏览文件
下载
差异文件
优化配置 提升新手友好度
优化配置 提升新手友好度
上级
df4d3034
d4ce19bc
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
124 addition
and
17 deletion
+124
-17
server/README.md
server/README.md
+44
-0
server/api/v1/sys_api.go
server/api/v1/sys_api.go
+2
-1
server/api/v1/sys_menu.go
server/api/v1/sys_menu.go
+3
-2
server/api/v1/sys_user.go
server/api/v1/sys_user.go
+4
-3
server/model/request/common.go
server/model/request/common.go
+1
-1
web/.env.development
web/.env.development
+5
-1
web/.env.production
web/.env.production
+6
-1
web/README.md
web/README.md
+49
-0
web/build.config.js
web/build.config.js
+2
-0
web/src/main.js
web/src/main.js
+2
-2
web/src/view/superAdmin/api/api.vue
web/src/view/superAdmin/api/api.vue
+2
-2
web/src/view/systemTools/formCreate/index.vue
web/src/view/systemTools/formCreate/index.vue
+2
-2
web/vue.config.js
web/vue.config.js
+2
-2
未找到文件。
server/README.md
0 → 100644
浏览文件 @
fde318d3
整理代码结构
```
lua
web
├──
api
/
v1
-- 主要API
|
├──
sys_initdb
.
go
-- ico
|
└──
sys_user
.
go
--
├──
config
-- 配置文件 设定操作的结构体
|
├──
auto_code
.
go
-- ico captcha.go
|
├──
...
-- ico captcha.go
|
└──
zap
.
go
-- core
├──
core
-- 主要结构代码
|
├──
server_other
.
go
-- ico captcha.go
|
├──
...
-- ico captcha.go
|
└──
zap
.
go
--
├──
docs
-- 文档系统
|
├──
docs
.
go
-- ico captcha.go
|
├──
swagger
.
json
-- json
|
└──
swagger
.
yaml
-- yaml
├──
global
-- global
├──
initialize
-- initialize
├──
middleware
-- 中间键
├──
model
-- global
│
├──
request
-- 所有请求model结构体
|
|
├──
common
.
go
|
|
├──
...
|
|
└──
sys_user
.
go
-- yaml
|
├──
response
-- 返回数据
|
|
├──
common
.
go
|
|
├──
...
|
|
└──
sys_user
.
go
-- yaml
├──
packfile
-- 文件写入
├──
resource
-- 资源文件
├──
router
-- 路由
├──
service
-- service层
├──
source
-- 文件目录操作
├──
utils
├──
config
.
yaml
--
├──
Dockerfile
-- docker配置
├──
go
.
mod
-- mod 配置
├──
go
.
sum
-- sum
├──
latest_log
-- vue-cli 配置
└──
main
.
go
-- package.json
```
\ No newline at end of file
server/api/v1/sys_api.go
浏览文件 @
fde318d3
...
...
@@ -7,6 +7,7 @@ import (
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
...
...
@@ -100,7 +101,7 @@ func GetApiById(c *gin.Context) {
response
.
FailWithMessage
(
err
.
Error
(),
c
)
return
}
err
,
api
:=
service
.
GetApiById
(
idInfo
.
I
d
)
err
,
api
:=
service
.
GetApiById
(
idInfo
.
I
D
)
if
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
"获取失败!"
,
zap
.
Any
(
"err"
,
err
))
response
.
FailWithMessage
(
"获取失败"
,
c
)
...
...
server/api/v1/sys_menu.go
浏览文件 @
fde318d3
...
...
@@ -7,6 +7,7 @@ import (
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
...
...
@@ -132,7 +133,7 @@ func DeleteBaseMenu(c *gin.Context) {
response
.
FailWithMessage
(
err
.
Error
(),
c
)
return
}
if
err
:=
service
.
DeleteBaseMenu
(
menu
.
I
d
);
err
!=
nil
{
if
err
:=
service
.
DeleteBaseMenu
(
menu
.
I
D
);
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
"删除失败!"
,
zap
.
Any
(
"err"
,
err
))
response
.
FailWithMessage
(
"删除失败"
,
c
)
}
else
{
...
...
@@ -182,7 +183,7 @@ func GetBaseMenuById(c *gin.Context) {
response
.
FailWithMessage
(
err
.
Error
(),
c
)
return
}
if
err
,
menu
:=
service
.
GetBaseMenuById
(
idInfo
.
I
d
);
err
!=
nil
{
if
err
,
menu
:=
service
.
GetBaseMenuById
(
idInfo
.
I
D
);
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
"获取失败!"
,
zap
.
Any
(
"err"
,
err
))
response
.
FailWithMessage
(
"获取失败"
,
c
)
}
else
{
...
...
server/api/v1/sys_user.go
浏览文件 @
fde318d3
...
...
@@ -8,11 +8,12 @@ import (
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/go-redis/redis"
"go.uber.org/zap"
"time"
)
// @Tags Base
...
...
@@ -217,11 +218,11 @@ func DeleteUser(c *gin.Context) {
return
}
jwtId
:=
getUserID
(
c
)
if
jwtId
==
uint
(
reqId
.
I
d
)
{
if
jwtId
==
uint
(
reqId
.
I
D
)
{
response
.
FailWithMessage
(
"删除失败, 自杀失败"
,
c
)
return
}
if
err
:=
service
.
DeleteUser
(
reqId
.
I
d
);
err
!=
nil
{
if
err
:=
service
.
DeleteUser
(
reqId
.
I
D
);
err
!=
nil
{
global
.
GVA_LOG
.
Error
(
"删除失败!"
,
zap
.
Any
(
"err"
,
err
))
response
.
FailWithMessage
(
"删除失败"
,
c
)
}
else
{
...
...
server/model/request/common.go
浏览文件 @
fde318d3
...
...
@@ -8,7 +8,7 @@ type PageInfo struct {
// Find by id structure
type
GetById
struct
{
I
d
float64
`json:"id" form:"id"`
// 主键ID
I
D
float64
`json:"id" form:"id"`
}
type
IdsReq
struct
{
...
...
web/.env.development
浏览文件 @
fde318d3
ENV = 'development'
VUE_APP_BASE_API = '/api'
\ No newline at end of file
VUE_APP_CLI_PORT = '8080'
VUE_APP_SERVER_PORT = '8888'
VUE_APP_BASE_API = '/api'
VUE_APP_BASE_PATH = 'http://127.0.0.1'
web/.env.production
浏览文件 @
fde318d3
ENV = 'production'
VUE_APP_BASE_API = '/api'
\ No newline at end of file
VUE_APP_CLI_PORT = '8080'
VUE_APP_SERVER_PORT = '8888'
VUE_APP_BASE_API = '/api'
#下方修改为你的线上ip
VUE_APP_BASE_PATH = 'http://8.141.61.63'
\ No newline at end of file
web/README.md
浏览文件 @
fde318d3
...
...
@@ -27,3 +27,52 @@ npm run lint
### Customize configuration
See
[
Configuration Reference
](
https://cli.vuejs.org/config/
)
.
整理代码结构
```
lua
web
├──
public
-- public
|
├──
favicon
.
ico
-- ico
|
└──
index
.
html
-- index
├──
src
-- 源代码
│
├──
api
-- 所有请求
│
├──
assets
-- 主题 字体等静态资源
|
├──
components
-- components组件
|
├──
directive
-- 公用方法
|
├──
mixins
-- 公用方法
|
├──
router
-- 路由权限
|
├──
store
-- store
|
|
├──
modules
-- modules
|
|
|
├──
dictionary
.
js
-- 动态路由
|
|
|
├──
router
.
js
-- 路由
|
|
|
└──
user
.
js
-- 用户权限菜单过滤
|
|
├──
getters
.
js
-- getters
|
|
└──
index
.
js
-- index
|
├──
styles
-- css
|
├──
utils
-- utils 组件
|
├──
view
-- 主要view代码
|
|
├──
about
-- 关于我们
|
|
├──
dashboard
-- 面板
|
|
├──
error
-- 错误
|
|
├──
example
--上传案例
|
|
├──
iconList
-- icon列表
|
|
├──
init
-- 初始化数据
|
|
├──
layout
-- layout约束页面
|
|
|
├──
aside
--
|
|
|
├──
bottomInfo
-- bottomInfo
|
|
|
├──
screenfull
-- 全屏设置
|
|
|
└──
index
.
vue
-- base 约束
|
|
├──
login
--结算单管理
|
|
├──
person
--结算单管理
|
|
├──
superAdmin
-- 超级管理员操作
|
|
└──
home
.
vue
-- page 入口页面
│
├──
App
.
vue
-- 入口页面
│
├──
main
.
js
-- 入口文件 加载组件 初始化等
│
└──
permission
.
js
-- 跳转
├──
build
.
config
.
js
-- 环境变量build配置
├──
openDocument
.
js
-- 商用代码公司自用产品无需授权
├──
.
babelrc
-- babel-loader 配置
├──
.
travis
.
yml
-- 自动化CI配置
├──
vue
.
config
.
js
-- vue-cli 配置
└──
package
.
json
-- package.json
```
\ No newline at end of file
web/build.config.js
浏览文件 @
fde318d3
...
...
@@ -2,6 +2,8 @@
module
.
exports
=
{
title
:
'
GIN-VUE-ADMIN1
'
,
vueClientPort
:
8080
,
goServerPort
:
8888
,
baseCdnUrl
:
'
//cdn.staticfile.org
'
,
cdns
:
[
/**
...
...
web/src/main.js
浏览文件 @
fde318d3
...
...
@@ -151,7 +151,7 @@ console.log(`
欢迎使用 Gin-Vue-Admin
当前版本:V2.4.1
加群方式:微信:shouzi_1994 QQ群:622360840
默认自动化文档地址:http://127.0.0.1
%s
/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:
8080
默认自动化文档地址:http://127.0.0.1
:`
+
process
.
env
.
VUE_APP_SERVER_PORT
+
`
/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:
`
+
process
.
env
.
VUE_APP_CLI_PORT
`
如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee
`
)
\ No newline at end of file
web/src/view/superAdmin/api/api.vue
浏览文件 @
fde318d3
...
...
@@ -236,10 +236,10 @@ export default {
openDialog
(
type
)
{
switch
(
type
)
{
case
"
addApi
"
:
this
.
dialogTitle
this
=
"
新增Api
"
;
this
.
dialogTitle
=
"
新增Api
"
;
break
;
case
"
edit
"
:
this
.
dialogTitle
this
=
"
编辑Api
"
;
this
.
dialogTitle
=
"
编辑Api
"
;
break
;
default
:
break
;
...
...
web/src/view/systemTools/formCreate/index.vue
浏览文件 @
fde318d3
<
template
>
<div
style=
"height:80vh"
>
<iframe
width=
"100%"
height=
"100%"
:src=
"
'http://127.0.0.1
:8888/form-generator/#/'"
frameborder=
"0"
></iframe>
<iframe
width=
"100%"
height=
"100%"
:src=
"
basePath+'
:8888/form-generator/#/'"
frameborder=
"0"
></iframe>
</div>
</
template
>
<
script
>
var
path
=
process
.
env
.
VUE_APP_BASE_
API
var
path
=
process
.
env
.
VUE_APP_BASE_
PATH
export
default
{
name
:
"
FormGenerator
"
,
data
(){
...
...
web/vue.config.js
浏览文件 @
fde318d3
...
...
@@ -15,7 +15,7 @@ module.exports = {
lintOnSave
:
process
.
env
.
NODE_ENV
===
'
development
'
,
productionSourceMap
:
false
,
devServer
:
{
port
:
8080
,
port
:
process
.
env
.
VUE_APP_CLI_PORT
,
open
:
true
,
overlay
:
{
warnings
:
false
,
...
...
@@ -25,7 +25,7 @@ module.exports = {
// 把key的路径代理到target位置
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
//需要代理的路径 例如 '/api'
target
:
`
http://127.0.0.1:8888
/`
,
//代理到 目标路径
target
:
`
${
process
.
env
.
VUE_APP_BASE_PATH
}
:
${
process
.
env
.
VUE_APP_SERVER_PORT
}
/`
,
//代理到 目标路径
changeOrigin
:
true
,
pathRewrite
:
{
// 修改路径数据
[
'
^
'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
// 举例 '^/api:""' 把路径中的/api字符串删除
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录