新增B站直播相关配置

新增MySQL及Redis配置
新增VUE前端
This commit is contained in:
2020-03-05 17:43:41 +08:00
parent 58a6279661
commit 6b5d50dd40
30 changed files with 13882 additions and 7 deletions

21
web/.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

24
web/README.md Normal file
View File

@@ -0,0 +1,24 @@
# testweb
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

5
web/babel.config.js Normal file
View File

@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

11859
web/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

45
web/package.json Normal file
View File

@@ -0,0 +1,45 @@
{
"name": "toolsWeb",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.4",
"element-ui": "^2.13.0",
"vue": "^2.6.11",
"vue-router": "^3.1.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.2.0",
"@vue/cli-plugin-eslint": "~4.2.0",
"@vue/cli-plugin-router": "^4.2.3",
"@vue/cli-service": "~4.2.0",
"babel-eslint": "^10.0.3",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.1.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

BIN
web/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

17
web/public/index.html Normal file
View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

108
web/src/App.vue Normal file
View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View 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>

View 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
View 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
View 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
View File

@@ -0,0 +1,5 @@
<template>
<div class="about">
<h1>{{msg}}</h1>
</div>
</template>

20
web/src/views/Home.vue Normal file
View 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>