新增B站直播相关配置
新增MySQL及Redis配置 新增VUE前端
This commit is contained in:
108
web/src/App.vue
Normal file
108
web/src/App.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<el-container>
|
||||
<el-header id="header">
|
||||
<el-menu
|
||||
|
||||
class="el-menu-demo"
|
||||
mode="horizontal"
|
||||
|
||||
background-color="#545c64"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
>
|
||||
<el-submenu index="1">
|
||||
<template slot="title" v-on:click="blog('/home')">博客</template>
|
||||
<el-menu-item index="1-1">
|
||||
<a href="javascript:;" @click="blog('/home')">主页</a>
|
||||
</el-menu-item>
|
||||
</el-submenu>
|
||||
|
||||
<el-submenu index="2">
|
||||
<template slot="title">选项2</template>
|
||||
<el-menu-item index="2-1">选项1</el-menu-item>
|
||||
<el-menu-item index="2-2">选项2</el-menu-item>
|
||||
<el-menu-item index="2-3">选项3</el-menu-item>
|
||||
<el-submenu index="2-4">
|
||||
<template slot="title">选项4</template>
|
||||
<el-menu-item index="2-4-1">选项1</el-menu-item>
|
||||
<el-menu-item index="2-4-2">选项2</el-menu-item>
|
||||
<el-menu-item index="2-4-3">选项3</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-submenu>
|
||||
<el-menu-item index="3" disabled>选项3</el-menu-item>
|
||||
<el-menu-item index="4">
|
||||
<a href="#" target="_blank">选项4</a>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-header>
|
||||
<el-container>
|
||||
<!-- <el-aside width="200px">
|
||||
<el-menu>
|
||||
<el-menu-item index="1">选项1</el-menu-item>
|
||||
<el-menu-item index="1">选项1</el-menu-item>
|
||||
</el-menu>
|
||||
</el-aside>-->
|
||||
<el-container>
|
||||
<el-main id="main">
|
||||
<router-view />
|
||||
</el-main>
|
||||
<el-footer>© 2020 yutou</el-footer>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</el-container>
|
||||
<!-- <div id="nav">
|
||||
<router-link to="/">Home</router-link> |
|
||||
<router-link to="/about">About</router-link>|
|
||||
<router-link to="/test">test</router-link>
|
||||
</div>-->
|
||||
|
||||
<!-- <router-view/> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
var tmp_a = 1;
|
||||
console.log(tmp_a);
|
||||
export default {
|
||||
methods:{
|
||||
blog:function(data){
|
||||
this.$router.push({ path: data })
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
#header {
|
||||
padding: 0;
|
||||
}
|
||||
.el-footer {
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
background-color: darkgrey;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-aside {
|
||||
background-color: #d3dce6;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
line-height: 200px;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
#main {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
BIN
web/src/assets/logo.png
Normal file
BIN
web/src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
59
web/src/components/HelloWorld.vue
Normal file
59
web/src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
<h1>{{ msg }}</h1>
|
||||
|
||||
<p>
|
||||
For a guide and recipes on how to configure / customize this project,<br>
|
||||
check out the
|
||||
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
||||
</p>
|
||||
<h3>Installed CLI Plugins</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
||||
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
||||
</ul>
|
||||
<h3>Essential Links</h3>
|
||||
<ul>
|
||||
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
||||
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
||||
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
||||
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
||||
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
||||
</ul>
|
||||
<h3>Ecosystem</h3>
|
||||
<ul>
|
||||
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
||||
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
||||
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
||||
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
||||
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Hello1World',
|
||||
props: {
|
||||
msg: String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
h3 {
|
||||
margin: 40px 0 0;
|
||||
}
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
</style>
|
||||
58
web/src/components/test.vue
Normal file
58
web/src/components/test.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
|
||||
<div>
|
||||
|
||||
<el-row>
|
||||
<el-button type="primary" v-on:click='greet' >按钮</el-button>
|
||||
</el-row>
|
||||
<ul id='list'>
|
||||
<li v-for="item in items" :key="item" style="width:10px">
|
||||
{{item.data}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Axios from 'axios'
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
message:'abc',
|
||||
message2:'123',
|
||||
show:false,
|
||||
items:[
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
},
|
||||
methods:{
|
||||
greet:function () {
|
||||
const _this =this
|
||||
_this.show=true
|
||||
Axios.get('http://localhost:8001/bili/live/get/url.do')
|
||||
.then(function (params) {
|
||||
//alert(params.data.data[0].url)
|
||||
var list=params.data.data
|
||||
for(var item in list){
|
||||
console.log(item)
|
||||
_this.items.push({
|
||||
data:list[item].url
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
17
web/src/main.js
Normal file
17
web/src/main.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
import Axios from 'axios';
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(ElementUI)
|
||||
//Vue.use(Axios)
|
||||
Vue.prototype.$ajax = Axios
|
||||
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
33
web/src/router/index.js
Normal file
33
web/src/router/index.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import Home from '../views/Home.vue'
|
||||
import test from '../components/test.vue'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: Home
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
name: 'About',
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
|
||||
},{
|
||||
path:'/test',
|
||||
name:'test',
|
||||
component:test
|
||||
}
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
mode:'history',
|
||||
routes
|
||||
})
|
||||
|
||||
export default router
|
||||
5
web/src/views/About.vue
Normal file
5
web/src/views/About.vue
Normal file
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div class="about">
|
||||
<h1>{{msg}}</h1>
|
||||
</div>
|
||||
</template>
|
||||
20
web/src/views/Home.vue
Normal file
20
web/src/views/Home.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<iframe src="http://blog.yutou233.cn/" id="frame" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
#frame{
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user