Browse Source

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

Gva vue3 2.4.5
main
奇淼(piexlmax 3 years ago
committed by GitHub
parent
commit
ff287f2f37
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      web/build.config.js
  2. 12
      web/package-lock.json
  3. 2
      web/package.json
  4. 15
      web/src/api/github.js
  5. 8
      web/src/main.js
  6. 4
      web/src/view/layout/index.vue
  7. 24
      web/vue.config.js

17
web/build.config.js

@ -1,17 +0,0 @@
'use strict'
module.exports = {
title: 'GIN-VUE-ADMIN',
baseCdnUrl: '//cdn.staticfile.org',
cdns: [
/**
* 如果设置path属性, { name: 'vue', scope: 'Vue', path: '/vue/2.6.9/vue.min.js' } 即编译出来以[baseCdnUrl][path]
* 否则自动拼写 [baseCdnUrl]/[name]/[version]/[name].min.js
*/
{ name: 'vue', scope: 'Vue' },
{ name: 'vue-router', scope: 'VueRouter' },
{ name: 'vuex', scope: 'Vuex' },
{ name: 'axios', scope: 'axios' },
{ name: 'element-ui', scope: 'ELEMENT', path: '/element-ui/2.12.0/index.js' }
]
}

12
web/package-lock.json

@ -1173,9 +1173,9 @@
"dev": true "dev": true
}, },
"@popperjs/core": { "@popperjs/core": {
"version": "2.9.3",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.3.tgz",
"integrity": "sha512-xDu17cEfh7Kid/d95kB6tZsLOmSWKCZKtprnhVepjsSaCij+lM3mItSJDuuHDMbCWTh8Ejmebwb+KONcCJ0eXQ=="
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.0.tgz",
"integrity": "sha512-QWvCHtYwNIR3C/mxW9jGzOu1gbaZkq/6is2OedayPH7HsxI4CVuVzAZ1PmxRElXLwwwCN7aMjRhxtTAGLEZ8IQ=="
}, },
"@soda/friendly-errors-webpack-plugin": { "@soda/friendly-errors-webpack-plugin": {
"version": "1.8.0", "version": "1.8.0",
@ -4728,9 +4728,9 @@
"dev": true "dev": true
}, },
"element-plus": { "element-plus": {
"version": "1.1.0-beta.4",
"resolved": "https://registry.npmjs.org/element-plus/-/element-plus-1.1.0-beta.4.tgz",
"integrity": "sha512-wtef1yfLX4IKysspX18s5bsGU3IG6YbkueBorsXi0L/5ykFANoui8QTverAKMQ5ulBcE/jcR7wegfmXGnK9iOA==",
"version": "1.1.0-beta.8",
"resolved": "https://registry.npmjs.org/element-plus/-/element-plus-1.1.0-beta.8.tgz",
"integrity": "sha512-L0z4UoaazLgvimU+Eb8KHwBdX6ND2sSOO/ja70FMJl7Y3T+PxP95OZAkpr1sNiBzMaVVdMef4lQLBwPqTO6PKw==",
"requires": { "requires": {
"@element-plus/icons": "^0.0.11", "@element-plus/icons": "^0.0.11",
"@popperjs/core": "^2.4.4", "@popperjs/core": "^2.4.4",

2
web/package.json

@ -11,7 +11,7 @@
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"echarts": "4.9.0", "echarts": "4.9.0",
"element-plus": "^1.1.0-beta.4",
"element-plus": "^1.1.0-beta.8",
"highlight.js": "^10.6.0", "highlight.js": "^10.6.0",
"marked": "^2.0.0", "marked": "^2.0.0",
"mitt": "^3.0.0", "mitt": "^3.0.0",

15
web/src/api/github.js

@ -1,22 +1,7 @@
import axios from 'axios' import axios from 'axios'
import { ElLoading } from 'element-plus'
let loadingInstance
const service = axios.create() const service = axios.create()
service.interceptors.request.use((config) => {
loadingInstance = ElLoading.service({ fullscreen: true })
return config
})
service.interceptors.response.use((resp) => {
loadingInstance.close()
return resp
}, (error) => {
loadingInstance.close()
return error
})
export function Commits(page) { export function Commits(page) {
return service({ return service({
url: 'https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=' + page, url: 'https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=' + page,

8
web/src/main.js

@ -1,7 +1,9 @@
import { createApp } from 'vue' import { createApp } from 'vue'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
// 引入gin-vue-admin前端初始化相关内容 // 引入gin-vue-admin前端初始化相关内容
import './core/gin-vue-admin' import './core/gin-vue-admin'
// 引入封装的router // 引入封装的router
import router from '@/router/index' import router from '@/router/index'
import { run } from '@/core/gin-vue-admin.js' import { run } from '@/core/gin-vue-admin.js'
@ -9,9 +11,7 @@ import '@/permission'
import { store } from '@/store/index' import { store } from '@/store/index'
import { auth } from '@/directive/auth' import { auth } from '@/directive/auth'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import App from './App.vue' import App from './App.vue'
const app = createApp(App) const app = createApp(App)
run(app) run(app)

4
web/src/view/layout/index.vue

@ -213,7 +213,9 @@ export default {
}) })
if (res.code === 0) { if (res.code === 0) {
emitter.emit('closeAllPage') emitter.emit('closeAllPage')
window.location.reload()
setTimeout(() => {
window.location.reload()
}, 1)
} }
}, },
reload() { reload() {

24
web/vue.config.js

@ -1,8 +1,6 @@
'use strict' 'use strict'
const path = require('path') const path = require('path')
const buildConf = require('./build.config')
const packageConf = require('./package.json')
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir) return path.join(__dirname, dir)
@ -51,29 +49,9 @@ module.exports = {
config config
.when(process.env.NODE_ENV !== 'development', .when(process.env.NODE_ENV !== 'development',
config => { config => {
// 不打包 begin
// 1.目前已经测试通过[vue,axios,echarts]可以cdn引用,其它组件测试通过后可继续添加
// 2.此处添加不打包后,需在public/index.html head中添加相应cdn资源链接
config.set('externals', buildConf.cdns.reduce((p, a) => {
p[a.name] = a.scope
return p
}, {}))
// 不打包 end
config.plugin('html') config.plugin('html')
.tap(args => { .tap(args => {
if (buildConf.title) {
args[0].title = buildConf.title
}
if (buildConf.cdns.length > 0) {
args[0].cdns = buildConf.cdns.map(conf => {
if (conf.path) {
conf.js = `${buildConf.baseCdnUrl}${conf.path}`
} else {
conf.js = `${buildConf.baseCdnUrl}/${conf.name}/${packageConf.dependencies[conf.name].replace('^', '')}/${conf.name}.min.js`
}
return conf
})
}
args[0].title = 'GIN-VUE-ADMIN'
return args return args
}) })

Loading…
Cancel
Save