diff --git a/server/resource/template/server/model.go.tpl b/server/resource/template/server/model.go.tpl index 6ec46518..bbc7331b 100644 --- a/server/resource/template/server/model.go.tpl +++ b/server/resource/template/server/model.go.tpl @@ -9,9 +9,9 @@ import ( type {{.StructName}} struct { global.GVA_MODEL {{- range .Fields}} {{- if eq .FieldType "bool" }} - {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"` + {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- end }}"` {{- else }} - {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}"` + {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if ne .FieldType "string" -}}{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}{{- end -}}"` {{- end }} {{- end }} } diff --git a/web/.env.development b/web/.env.development index 93aab90b..6e1d0340 100644 --- a/web/.env.development +++ b/web/.env.development @@ -1,6 +1,6 @@ ENV = 'development' -VUE_APP_CLI_PORT = '8080' -VUE_APP_SERVER_PORT = '8888' -VUE_APP_BASE_API = '/api' -VUE_APP_BASE_PATH = 'http://127.0.0.1' +VUE_APP_CLI_PORT = 8080 +VUE_APP_SERVER_PORT = 8888 +VUE_APP_BASE_API = /api +VUE_APP_BASE_PATH = http://127.0.0.1 diff --git a/web/.env.production b/web/.env.production index f8929e13..9e015c86 100644 --- a/web/.env.production +++ b/web/.env.production @@ -1,7 +1,7 @@ ENV = 'production' -VUE_APP_CLI_PORT = '8080' -VUE_APP_SERVER_PORT = '8888' -VUE_APP_BASE_API = '/api' +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 +VUE_APP_BASE_PATH = http://8.141.61.63 \ No newline at end of file diff --git a/web/src/core/config.js b/web/src/core/config.js new file mode 100644 index 00000000..08d58028 --- /dev/null +++ b/web/src/core/config.js @@ -0,0 +1,15 @@ +/* +* 网站配置文件 +* */ + + + +const config ={ + + appName : 'Gin-Vue-Admin', + + appLogo : 'https://www.gin-vue-admin.com/img/logo.png' + +} + +export default config \ No newline at end of file diff --git a/web/src/core/gin-vue-admin.js b/web/src/core/gin-vue-admin.js index 2b5f178c..5163ebfd 100644 --- a/web/src/core/gin-vue-admin.js +++ b/web/src/core/gin-vue-admin.js @@ -10,6 +10,10 @@ import APlayer from '@moefe/vue-aplayer' import '../../node_modules/timeline-vuejs/dist/timeline-vuejs.css' // 路由守卫 import Bus from '@/utils/bus' +//加载网站配置文件夹 +import config from './config' +Vue.prototype.$GIN_VUE_ADMIN = config +console.log(config) Vue.use(Bus) Vue.use(APlayer, { defaultCover: 'https://github.com/u3u.png', diff --git a/web/src/utils/page.js b/web/src/utils/page.js index 8c07b9fd..42e4a65f 100644 --- a/web/src/utils/page.js +++ b/web/src/utils/page.js @@ -1,8 +1,7 @@ -const title = 'GIN-VUE-ADMIN' - +import config from '@/core/config' export default function getPageTitle(pageTitle) { if (pageTitle) { - return `${pageTitle} - ${title}` + return `${pageTitle} - ${config.appName}` } - return `${title}` + return `${config.appName}` } diff --git a/web/src/view/init/index.vue b/web/src/view/init/index.vue index 68362069..7117a896 100644 --- a/web/src/view/init/index.vue +++ b/web/src/view/init/index.vue @@ -74,7 +74,6 @@ export default { console.log(this.hello) }, async onSubmit() { - this.out = true const loading = this.$loading({ lock: true, text: '正在初始化数据库,请稍候', @@ -84,6 +83,7 @@ export default { try { const res = await initDB(this.form) if (res.code === 0) { + this.out = true this.$message({ type: 'success', message: res.msg diff --git a/web/src/view/layout/bottomInfo/bottomInfo.vue b/web/src/view/layout/bottomInfo/bottomInfo.vue index 64f1488f..9be35600 100644 --- a/web/src/view/layout/bottomInfo/bottomInfo.vue +++ b/web/src/view/layout/bottomInfo/bottomInfo.vue @@ -3,7 +3,7 @@
Powered by - gin-vue-admin + {{$GIN_VUE_ADMIN.appName}} Copyright diff --git a/web/src/view/layout/index.vue b/web/src/view/layout/index.vue index 1908e5a9..7251a41e 100644 --- a/web/src/view/layout/index.vue +++ b/web/src/view/layout/index.vue @@ -4,8 +4,8 @@
- -

Gin-Vue-Admin

+ +

{{ $GIN_VUE_ADMIN.appName }}

@@ -39,7 +39,8 @@ export default { data() { return { value: '', - show: false + show: false, + reload: false } }, computed: { @@ -58,7 +59,33 @@ export default { this.$nextTick(() => { this.$refs['search-input'].focus() }) + }, + handleReload() { + this.reload = true + this.$bus.$emit('reload') + setTimeout(() => { + this.reload = false + }, 500) } } } + diff --git a/web/src/view/login/index.vue b/web/src/view/login/index.vue index 87bc1f0e..bf0f810d 100644 --- a/web/src/view/login/index.vue +++ b/web/src/view/login/index.vue @@ -3,7 +3,7 @@