deploy
Pan 2019-04-19 21:41:22 +08:00
parent b6147d33f3
commit e5e3f7beb3
9 changed files with 104 additions and 4 deletions

25
deploy.sh 100644
View File

@ -0,0 +1,25 @@
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run build
# navigate into the build output directory
cd dist
# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME
#创建.nojekyll 防止Github Pages build错误
touch .nojekyll
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:PanJiaChen/vueAdmin-template.git master:gh-pages
cd -

View File

@ -22,6 +22,7 @@
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"vue": "2.6.10",
"vue-analytics": "5.16.4",
"vue-router": "3.0.6",
"vuex": "3.1.0"
},

View File

@ -0,0 +1,53 @@
<template>
<div id="codefund" />
</template>
<script>
import axios from 'axios'
export default {
data() {
return {
loadSuccess: true
}
},
watch: {
'$route.path': {
handler: function(val, oldVal) {
this.getCodefund()
}
}
},
mounted() {
this.getCodefund()
},
methods: {
getCodefund() {
if (this.$isServer) return
const codefundId = this.isGitee()
? '165'
: '164'
const template = 'horizontal'
axios.get(`https://api.codefund.app/properties/${codefundId}/funder.html?template=${template}`)
.then(function(response) {
document.getElementById('codefund').innerHTML = response.data
})
},
isGitee() {
const origin = window.location.origin
if (origin.includes('gitee.io')) {
return true
}
return false
},
loadError(oError) {
this.loadSuccess = false
}
}
}
</script>
<style>
.cf-wrapper{
margin: 0!important;
}
</style>

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1547533298036" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2337" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M799.835567 409.343969c-7.124258 0-17.45658 1.125637-26.720571 0-51.567469 15.005762-88.169085 59.042721-106.883309 106.749256-23.420409-29.151947-62.499449-52.284807-106.883309-53.374628-5.526877 1.088798-15.553231 2.187829-26.720572 0-75.839269 22.039969-132.216277 117.15628-120.243594 200.153576 32.484855 177.732937 359.762737 234.369865 360.730784 253.528204-0.968048 15.081487 15.32094-79.065753 66.802452-160.122861 51.226708-80.33977 121.281227-110.282732 106.883309-226.841402-13.123902-72.211649-76.882018-120.089076-146.96519-120.092145zM345.58176 903.057487c-0.069585 0-0.159636-0.097214-0.241501-0.152473-0.11461 0.100284-0.048095 0.152473 0.241501 0.152473z" p-id="2338"></path><path d="M733.033116 129.128963c-115.27442-8.884344-205.739804 94.891184-253.848499 173.466773-28.197202-65.910129-108.804055-148.775418-173.685761-146.778948-111.029746-0.483001-231.309156 76.278267-240.48719 213.497489C54.354955 565.682643 190.689017 610.455359 265.419022 729.590713c49.859571 75.175143 75.201749 170.110329 79.921237 173.314301 1.494027-1.316995 37.989219-12.054547 120.485095-53.222155-58.424644-36.85028-103.33346-92.574419-120.243594-160.122861-15.33015-119.972419 42.422182-261.34831 146.965189-280.216029 27.203572-11.225669 95.869465-34.045397 160.325475 26.686802 29.960359-66.275449 71.678506-82.142835 120.243595-93.405343 9.8176-1.951445 23.158443-3.786233 40.080858 0 53.009308-3.783163 105.278765 18.951631 146.965189 53.374628-2.736321-9.131985-1.047866-20.48352 0-26.686802 7.274684-149.553131-88.768743-228.409107-227.12895-240.184291z" p-id="2339"></path></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -20,7 +20,7 @@ export default {
<style scoped>
.app-main {
/*50 = navbar */
min-height: calc(100vh - 50px);
min-height: calc(100vh - 50px - 43px);
width: 100%;
position: relative;
overflow: hidden;

View File

@ -6,6 +6,7 @@
<div :class="{'fixed-header':fixedHeader}">
<navbar />
</div>
<AD />
<app-main />
</div>
</div>
@ -14,13 +15,15 @@
<script>
import { Navbar, Sidebar, AppMain } from './components'
import ResizeMixin from './mixin/ResizeHandler'
import AD from '@/components/AD'
export default {
name: 'Layout',
components: {
Navbar,
Sidebar,
AppMain
AppMain,
AD
},
mixins: [ResizeMixin],
computed: {

View File

@ -15,6 +15,13 @@ import router from './router'
import '@/icons' // icon
import '@/permission' // permission control
import VueAnalytics from 'vue-analytics'
Vue.use(VueAnalytics, {
id: 'UA-109340118-1',
router
})
/**
* If you don't want to use mock-server
* you want to use mockjs for request interception

View File

@ -17,7 +17,6 @@ import Layout from '@/layout'
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
@ -159,6 +158,17 @@ export const constantRoutes = [
]
},
{
path: 'donate',
component: Layout,
children: [
{
path: 'https://panjiachen.gitee.io/vue-element-admin-site/zh/donate/',
meta: { title: 'Donate', icon: 'donate' }
}
]
},
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]

View File

@ -18,7 +18,7 @@ module.exports = {
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/vue-admin-template/',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',