Browse Source

Merge pull request #651 from flipped-aurora/gva-vue3-2.4.5

增加关闭当前标签方法
main
奇淼(piexlmax 3 years ago
committed by GitHub
parent
commit
b3056e188e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      server/go.mod
  2. 210
      web/package-lock.json
  3. 6
      web/package.json
  4. 4
      web/src/core/gin-vue-admin.js
  5. 19
      web/src/utils/request.js
  6. 9
      web/src/view/layout/aside/historyComponent/history.vue

2
server/go.mod

@ -3,7 +3,6 @@ module github.com/flipped-aurora/gin-vue-admin/server
go 1.16 go 1.16
require ( require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible
github.com/casbin/casbin/v2 v2.11.0 github.com/casbin/casbin/v2 v2.11.0
@ -18,7 +17,6 @@ require (
github.com/gookit/color v1.3.1 github.com/gookit/color v1.3.1
github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84 github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84
github.com/lestrrat-go/file-rotatelogs v2.3.0+incompatible github.com/lestrrat-go/file-rotatelogs v2.3.0+incompatible
github.com/lestrrat-go/strftime v1.0.5 // indirect
github.com/mojocn/base64Captcha v1.3.1 github.com/mojocn/base64Captcha v1.3.1
github.com/qiniu/api.v7/v7 v7.4.1 github.com/qiniu/api.v7/v7 v7.4.1
github.com/robfig/cron/v3 v3.0.1 github.com/robfig/cron/v3 v3.0.1

210
web/package-lock.json

@ -1,5 +1,5 @@
{ {
"name": "gvav3",
"name": "gin-vue-admin",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
@ -1156,21 +1156,6 @@
"postcss": "^7.0.0" "postcss": "^7.0.0"
} }
}, },
"@moefe/vue-aplayer": {
"version": "2.0.0-beta.5",
"resolved": "https://registry.npmjs.org/@moefe/vue-aplayer/-/vue-aplayer-2.0.0-beta.5.tgz",
"integrity": "sha512-ytzp4GStzjftuh7H1rIS/ziqwV1FO67iTLSkDxgN0J2bqlO+rBgDDr83Y+pZKBIgRUc30uu/UZHqmE4QiBHHeg==",
"requires": {
"vue": "^2.5.17"
},
"dependencies": {
"vue": {
"version": "2.6.14",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz",
"integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ=="
}
}
},
"@mrmlnc/readdir-enhanced": { "@mrmlnc/readdir-enhanced": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npm.taobao.org/@mrmlnc/readdir-enhanced/download/@mrmlnc/readdir-enhanced-2.2.1.tgz", "resolved": "https://registry.npm.taobao.org/@mrmlnc/readdir-enhanced/download/@mrmlnc/readdir-enhanced-2.2.1.tgz",
@ -1780,6 +1765,63 @@
"integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=", "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
"dev": true "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": { "ssri": {
"version": "8.0.1", "version": "8.0.1",
"resolved": "https://registry.nlark.com/ssri/download/ssri-8.0.1.tgz", "resolved": "https://registry.nlark.com/ssri/download/ssri-8.0.1.tgz",
@ -1788,6 +1830,28 @@
"requires": { "requires": {
"minipass": "^3.1.1" "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"
}
} }
} }
}, },
@ -10113,11 +10177,6 @@
} }
} }
}, },
"simple-uploader.js": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/simple-uploader.js/-/simple-uploader.js-0.5.6.tgz",
"integrity": "sha512-ukjL0wZhK1dNMaQa6sd+UpCSmnUjblaUGbAd/B8f5IFrChMzDsC/7eFSK4bs4BS5NPJFSZVLI+l6Ri7THTkQtw=="
},
"slash": { "slash": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/slash/download/slash-2.0.0.tgz", "resolved": "https://registry.npm.taobao.org/slash/download/slash-2.0.0.tgz",
@ -10962,21 +11021,6 @@
"integrity": "sha1-Wrr3FKlAXbBQRzK7zNLO3Z75U30=", "integrity": "sha1-Wrr3FKlAXbBQRzK7zNLO3Z75U30=",
"dev": true "dev": true
}, },
"timeline-vuejs": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/timeline-vuejs/-/timeline-vuejs-1.1.1.tgz",
"integrity": "sha512-jsdr0xNCBH/GBiW7qsOTbBxZuyk7WKD5YmtTGP1sm0su0fy+iBsEJLDyhHhQ4nTAxca8MkSbJhKGUgF5eNoEfA==",
"requires": {
"vue": "^2.5.17"
},
"dependencies": {
"vue": {
"version": "2.6.14",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz",
"integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ=="
}
}
},
"timers-browserify": { "timers-browserify": {
"version": "2.0.12", "version": "2.0.12",
"resolved": "https://registry.npm.taobao.org/timers-browserify/download/timers-browserify-2.0.12.tgz?cache=0&sync_timestamp=1603793712916&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftimers-browserify%2Fdownload%2Ftimers-browserify-2.0.12.tgz", "resolved": "https://registry.npm.taobao.org/timers-browserify/download/timers-browserify-2.0.12.tgz?cache=0&sync_timestamp=1603793712916&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftimers-browserify%2Fdownload%2Ftimers-browserify-2.0.12.tgz",
@ -11544,87 +11588,6 @@
} }
} }
}, },
"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": { "vue-particle-line": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz", "resolved": "https://registry.npmjs.org/vue-particle-line/-/vue-particle-line-0.1.4.tgz",
@ -11648,14 +11611,6 @@
"@vue/devtools-api": "^6.0.0-beta.14" "@vue/devtools-api": "^6.0.0-beta.14"
} }
}, },
"vue-simple-uploader": {
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/vue-simple-uploader/-/vue-simple-uploader-0.7.6.tgz",
"integrity": "sha512-DYddedNi+ZZzqxmKgW2t4lBN3aiB66oKOxgAfS9Hz9J1FHv7Xt+u1Pq8F48BFS4vG0+MFHCNzjzS2xaEUOIcHQ==",
"requires": {
"simple-uploader.js": "^0.5.6"
}
},
"vue-style-loader": { "vue-style-loader": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.3.tgz?cache=0&sync_timestamp=1614758661292&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-style-loader%2Fdownload%2Fvue-style-loader-4.1.3.tgz", "resolved": "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.3.tgz?cache=0&sync_timestamp=1614758661292&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-style-loader%2Fdownload%2Fvue-style-loader-4.1.3.tgz",
@ -11680,11 +11635,6 @@
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=", "integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
"dev": true "dev": true
}, },
"vuescroll": {
"version": "4.17.3",
"resolved": "https://registry.npmjs.org/vuescroll/-/vuescroll-4.17.3.tgz",
"integrity": "sha512-5P3hje/fYjo1eAB0Y8zboLbaq/mnPNczYyZ1aPHHM6wIFKcqal9Mi42CBCZizUnEtoXtbsGlnyLcVbnalTNptA=="
},
"vuex": { "vuex": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.nlark.com/vuex/download/vuex-4.0.2.tgz?cache=0&sync_timestamp=1623945253165&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvuex%2Fdownload%2Fvuex-4.0.2.tgz", "resolved": "https://registry.nlark.com/vuex/download/vuex-4.0.2.tgz?cache=0&sync_timestamp=1623945253165&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvuex%2Fdownload%2Fvuex-4.0.2.tgz",

6
web/package.json

@ -1,5 +1,5 @@
{ {
"name": "gvav3",
"name": "gin-vue-admin",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -8,7 +8,6 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@moefe/vue-aplayer": "^2.0.0-beta.5",
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"element-plus": "^1.1.0-beta.4", "element-plus": "^1.1.0-beta.4",
@ -22,12 +21,9 @@
"screenfull": "^5.0.2", "screenfull": "^5.0.2",
"script-ext-html-webpack-plugin": "^2.1.4", "script-ext-html-webpack-plugin": "^2.1.4",
"spark-md5": "^3.0.1", "spark-md5": "^3.0.1",
"timeline-vuejs": "1.1.1",
"vue": "^3.0.0", "vue": "^3.0.0",
"vue-particle-line": "^0.1.4", "vue-particle-line": "^0.1.4",
"vue-router": "^4.0.0-0", "vue-router": "^4.0.0-0",
"vue-simple-uploader": "^0.7.4",
"vuescroll": "^4.14.4",
"vuex": "^4.0.0-0", "vuex": "^4.0.0-0",
"vuex-persist": "^2.1.0" "vuex-persist": "^2.1.0"
}, },

4
web/src/core/gin-vue-admin.js

@ -2,15 +2,11 @@
* gin-vue-admin web框架组 * gin-vue-admin web框架组
* *
* */ * */
// time line css
import '../../node_modules/timeline-vuejs/dist/timeline-vuejs.css'
// 加载网站配置文件夹 // 加载网站配置文件夹
import config from './config' import config from './config'
export const run = function(app) { export const run = function(app) {
app.config.globalProperties.$GIN_VUE_ADMIN = config app.config.globalProperties.$GIN_VUE_ADMIN = config
// app.use(uploader) // app.use(uploader)
console.log(` console.log(`

19
web/src/utils/request.js

@ -81,10 +81,11 @@ service.interceptors.response.use(
}, },
error => { error => {
closeLoading() closeLoading()
switch (error.response.status) {
case 500:
ElMessageBox.confirm(` ElMessageBox.confirm(`
<p>检测到接口错误${error}</p> <p>检测到接口错误${error}</p>
<p>错误码500此类错误内容常见于后台panic如果影响您正常使用可强制登出清理缓存</p>
<p>错误码404此类错误多为接口未注册或未重启或者请求路径方法与api路径方法不符</p>
<p>错误码<span style="color:red"> 500 </span>panic使</p>
`, '接口报错', { `, '接口报错', {
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
@ -94,6 +95,20 @@ service.interceptors.response.use(
.then(() => { .then(() => {
store.commit('user/LoginOut') store.commit('user/LoginOut')
}) })
break
case 404:
ElMessageBox.confirm(`
<p>检测到接口错误${error}</p>
<p>错误码<span style="color:red"> 404 </span>api--</p>
`, '接口报错', {
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '我知道了',
cancelButtonText: '取消'
})
break
}
return error return error
} }
) )

9
web/src/view/layout/aside/historyComponent/history.vue

@ -16,7 +16,9 @@
:tab="item" :tab="item"
class="gva-tab" class="gva-tab"
> >
<span slot="label" :style="{color: activeValue===name(item)?activeColor:'#333'}"><i class="dot" :style="{ backgroundColor:activeValue===name(item)?activeColor:'#ddd'}" /> {{ item.meta.title }}</span>
<template #label>
<span :style="{color: activeValue===name(item)?activeColor:'#333'}"><i class="dot" :style="{ backgroundColor:activeValue===name(item)?activeColor:'#ddd'}" /> {{ item.meta.title }}</span>
</template>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -109,9 +111,8 @@ export default {
}, },
mounted() { mounted() {
// //
this.$bus.on('closeThisPage', ()=>{
const router = this.$route.path.split("/")
this.removeTab(`${router[router.length - 1]}`)
emitter.on('closeThisPage', () => {
this.removeTab(this.name(this.$route))
}) })
}, },
beforeDestroy() { beforeDestroy() {

Loading…
Cancel
Save