├── .browserslistrc
├── babel.config.js
├── public
├── favicon.ico
└── index.html
├── src
├── assets
│ ├── logo.png
│ ├── avatar.jpg
│ └── styles
│ │ └── main.css
├── views
│ ├── About.vue
│ ├── ShowVideo.vue
│ ├── Home.vue
│ └── PostVideo.vue
├── plugins
│ └── element.js
├── api
│ ├── upload
│ │ └── index.js
│ └── video
│ │ └── index.js
├── store.js
├── App.vue
├── main.js
├── components
│ ├── NavBar.vue
│ └── HelloWorld.vue
└── router.js
├── postcss.config.js
├── docker
├── Dockerfile
├── nginx.conf
└── docker-compose.yml
├── .editorconfig
├── vue.config.js
├── .gitignore
├── README.md
├── .eslintrc.js
└── package.json
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app',
4 | ],
5 | };
6 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gourouting/giligili-vue/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gourouting/giligili-vue/HEAD/src/assets/logo.png
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | autoprefixer: {},
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/src/assets/avatar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gourouting/giligili-vue/HEAD/src/assets/avatar.jpg
--------------------------------------------------------------------------------
/src/views/About.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
欢迎来到Giligili
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nginx:alpine
2 |
3 | COPY ./nginx.conf /etc/nginx/conf.d/default.conf
4 | COPY ./dist /usr/share/nginx/html
5 |
--------------------------------------------------------------------------------
/src/assets/styles/main.css:
--------------------------------------------------------------------------------
1 | .main-contianer {
2 | max-width: 1400px;
3 | margin: 0 auto;
4 | padding-bottom: 80px;
5 | }
6 |
--------------------------------------------------------------------------------
/docker/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 |
4 | location / {
5 | root /usr/share/nginx/html;
6 | index index.html;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/plugins/element.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Element from 'element-ui';
3 | import 'element-ui/lib/theme-chalk/index.css';
4 |
5 | Vue.use(Element);
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{js,jsx,ts,tsx,vue}]
2 | indent_style = space
3 | indent_size = 2
4 | end_of_line = lf
5 | trim_trailing_whitespace = true
6 | insert_final_newline = true
7 | max_line_length = 100
8 |
--------------------------------------------------------------------------------
/docker/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | services:
4 | violet:
5 | image: registry.cn-hongkong.aliyuncs.com/chengka/violet:latest
6 | restart: always
7 | ports:
8 | - 3010:80
9 |
--------------------------------------------------------------------------------
/src/api/upload/index.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | // 读视频详情
4 | const postUploadToken = fileName => axios.post('/api/v1/upload/token', { filename: fileName }).then(res => res.data);
5 |
6 | export default postUploadToken;
7 |
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | devServer: {
3 | proxy: {
4 | '^/api': {
5 | target: 'http://localhost:3000',
6 | ws: true,
7 | changeOrigin: true,
8 | },
9 | },
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/src/store.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 |
4 | Vue.use(Vuex);
5 |
6 | export default new Vuex.Store({
7 | state: {
8 |
9 | },
10 | mutations: {
11 |
12 | },
13 | actions: {
14 |
15 | },
16 | });
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
18 |
19 |
21 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import App from './App.vue';
3 | import router from './router';
4 | import store from './store';
5 | import './plugins/element';
6 | import '@/assets/styles/main.css';
7 |
8 | Vue.config.productionTip = false;
9 |
10 | Vue.use(require('vue-moment'));
11 |
12 | new Vue({
13 | router,
14 | store,
15 | render: h => h(App),
16 | }).$mount('#app');
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # giligili
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 |
18 | ### Run your tests
19 | ```
20 | npm run test
21 | ```
22 |
23 | ### Lints and fixes files
24 | ```
25 | npm run lint
26 | ```
27 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true,
5 | },
6 | extends: [
7 | 'plugin:vue/essential',
8 | '@vue/airbnb',
9 | ],
10 | rules: {
11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13 | },
14 | parserOptions: {
15 | parser: 'babel-eslint',
16 | },
17 | };
18 |
--------------------------------------------------------------------------------
/src/api/video/index.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | // 创建视频
4 | const postVideo = form => axios.post('/api/v1/videos', form).then(res => res.data);
5 |
6 | // 读视频详情
7 | const getVideo = id => axios.get(`/api/v1/video/${id}`).then(res => res.data);
8 |
9 | // 读取视频列表
10 | const getVideos = (start, limit) => axios.get('/api/v1/videos', { params: { start, limit } }).then(res => res.data);
11 |
12 | export {
13 | getVideos,
14 | getVideo,
15 | postVideo,
16 | };
17 |
--------------------------------------------------------------------------------
/src/components/NavBar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | 首页
4 | 投稿视频
5 | 关于我们
6 |
7 |
8 |
9 |
14 |
15 |
16 |
21 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | giligili
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/router.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Router from 'vue-router';
3 | import Home from './views/Home.vue';
4 |
5 | Vue.use(Router);
6 |
7 | export default new Router({
8 | routes: [
9 | {
10 | path: '/',
11 | name: 'home',
12 | component: Home,
13 | },
14 | {
15 | path: '/postvideo',
16 | name: 'postVideo',
17 | component: () => import(/* webpackChunkName: "video" */ './views/PostVideo.vue'),
18 | },
19 | {
20 | path: '/video/:videoID',
21 | name: 'showVideo',
22 | component: () => import(/* webpackChunkName: "video" */ './views/ShowVideo.vue'),
23 | },
24 | {
25 | path: '/about',
26 | name: 'about',
27 | component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
28 | },
29 | ],
30 | });
31 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "giligili",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.19.0",
12 | "core-js": "^2.6.5",
13 | "element-ui": "^2.4.5",
14 | "moment": "^2.24.0",
15 | "video.js": "^7.6.0",
16 | "vue": "^2.6.10",
17 | "vue-moment": "^4.0.0",
18 | "vue-router": "^3.0.3",
19 | "vue-video-player": "^5.0.2",
20 | "vuex": "^3.0.1"
21 | },
22 | "devDependencies": {
23 | "@vue/cli-plugin-babel": "^3.0.4",
24 | "@vue/cli-plugin-eslint": "^3.0.4",
25 | "@vue/cli-service": "^3.0.4",
26 | "@vue/eslint-config-airbnb": "^4.0.0",
27 | "babel-eslint": "^10.0.1",
28 | "eslint": "^5.16.0",
29 | "eslint-plugin-vue": "^5.0.0",
30 | "node-sass": "^4.9.0",
31 | "sass-loader": "^7.1.0",
32 | "vue-cli-plugin-element": "^1.0.1",
33 | "vue-template-compiler": "^2.6.10"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/views/ShowVideo.vue:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
56 |
57 |
81 |
--------------------------------------------------------------------------------
/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
{{video.title}}
10 |
11 | {{video.info.substring(0, 40)}}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
65 |
66 |
87 |
--------------------------------------------------------------------------------
/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
8 |
9 |
Installed CLI Plugins
10 |
14 |
Essential Links
15 |
22 |
Ecosystem
23 |
30 |
31 |
32 |
33 |
41 |
42 |
43 |
59 |
--------------------------------------------------------------------------------
/src/views/PostVideo.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
欢迎投稿:
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
26 |
27 |
28 | 只能上传png文件,且不超过500kb
29 |
30 |
31 |
32 |
33 | 立即创建
34 |
35 |
36 |
37 |
38 |
39 |
40 |
113 |
114 |
139 |
--------------------------------------------------------------------------------