From 782d64eced3d9fbecf40aea8590191b7566880aa Mon Sep 17 00:00:00 2001
From: piexlmax <303176530@qq.com>
Date: Thu, 26 Aug 2021 14:32:50 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9vue3=20template?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
server/resource/template/readme.txt.tpl | 2 -
server/resource/template/web/table.vue.tpl | 41 ++----
web/package-lock.json | 160 +++++++++++----------
web/src/utils/request.js | 2 +-
4 files changed, 96 insertions(+), 109 deletions(-)
diff --git a/server/resource/template/readme.txt.tpl b/server/resource/template/readme.txt.tpl
index 5ab163b3..25de2300 100644
--- a/server/resource/template/readme.txt.tpl
+++ b/server/resource/template/readme.txt.tpl
@@ -5,5 +5,3 @@
项目github:"https://github.com/piexlmax/github.com/flipped-aurora/gin-vue-admin/server"
希望大家给个star多多鼓励
-
-暂时不保存大家生成的结构体 只为方便一次性使用
\ No newline at end of file
diff --git a/server/resource/template/web/table.vue.tpl b/server/resource/template/web/table.vue.tpl
index a8c6f8e4..30c8e4e0 100644
--- a/server/resource/template/web/table.vue.tpl
+++ b/server/resource/template/web/table.vue.tpl
@@ -24,13 +24,15 @@
查询
新增
-
+
确定要删除吗?
取消
确定
- 批量删除
+
+ 批量删除
+
@@ -46,24 +48,24 @@
>
- {{ "{{ scope.row.CreatedAt|formatDate }}" }}
+ {{ "{{ formatDate(scope.row.CreatedAt) }}" }}
{{- range .Fields}}
{{- if .DictType}}
-
+
{{"{{"}} filterDict(scope.row.{{.FieldJson}},"{{.DictType}}") {{"}}"}}
{{- else if eq .FieldType "bool" }}
- {{ "{{scope.row."}}{{.FieldJson}}{{"|formatBoolean}}" }}
+ {{"{{"}} formatBoolean(scope.row.{{.FieldJson}}) {{"}}"}}
{{- else }}
{{- end }}
{{- end }}
-
+
变更
删除
@@ -107,10 +109,12 @@
{{- end }}
-
+
+
+
@@ -128,23 +132,6 @@ import { formatTimeToStr } from '@/utils/date'
import infoList from '@/mixins/infoList'
export default {
name: '{{.StructName}}',
- filters: {
- formatDate: function(time) {
- if (time !== null && time !== '') {
- var date = new Date(time)
- return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
- } else {
- return ''
- }
- },
- formatBoolean: function(bool) {
- if (bool != null) {
- return bool ? '是' : '否'
- } else {
- return ''
- }
- }
- },
mixins: [infoList],
data() {
return {
diff --git a/web/package-lock.json b/web/package-lock.json
index 29be2ef0..997cdee3 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -1780,63 +1780,6 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true
},
- "ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "optional": true,
- "requires": {
- "color-convert": "^2.0.1"
- }
- },
- "chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "optional": true,
- "requires": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- }
- },
- "color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "optional": true,
- "requires": {
- "color-name": "~1.1.4"
- }
- },
- "color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true,
- "optional": true
- },
- "has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "optional": true
- },
- "loader-utils": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
- "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
- "dev": true,
- "optional": true,
- "requires": {
- "big.js": "^5.2.2",
- "emojis-list": "^3.0.0",
- "json5": "^2.1.2"
- }
- },
"ssri": {
"version": "8.0.1",
"resolved": "https://registry.nlark.com/ssri/download/ssri-8.0.1.tgz",
@@ -1845,28 +1788,6 @@
"requires": {
"minipass": "^3.1.1"
}
- },
- "supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "optional": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- },
- "vue-loader-v16": {
- "version": "npm:vue-loader@16.5.0",
- "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz",
- "integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==",
- "dev": true,
- "optional": true,
- "requires": {
- "chalk": "^4.1.0",
- "hash-sum": "^2.0.0",
- "loader-utils": "^2.0.0"
- }
}
}
},
@@ -11623,6 +11544,87 @@
}
}
},
+ "vue-loader-v16": {
+ "version": "npm:vue-loader@16.5.0",
+ "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.5.0.tgz",
+ "integrity": "sha512-WXh+7AgFxGTgb5QAkQtFeUcHNIEq3PGVQ8WskY5ZiFbWBkOwcCPRs4w/2tVyTbh2q6TVRlO3xfvIukUtjsu62A==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "chalk": "^4.1.0",
+ "hash-sum": "^2.0.0",
+ "loader-utils": "^2.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true,
+ "optional": true
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "optional": true
+ },
+ "loader-utils": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
+ "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^2.1.2"
+ }
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ }
+ }
+ },
"vue-particle-line": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz",
diff --git a/web/src/utils/request.js b/web/src/utils/request.js
index c667e223..f6fb04a5 100644
--- a/web/src/utils/request.js
+++ b/web/src/utils/request.js
@@ -59,10 +59,10 @@ service.interceptors.request.use(
service.interceptors.response.use(
response => {
closeLoading()
-
if (response.headers['new-token']) {
store.commit('user/setToken', response.headers['new-token'])
}
+ debugger
if (response.data.code === 0 || response.headers.success === 'true') {
return response.data
} else {