Commit f76e4fbe by 宋毅

tj

parent 2ca780fc
#!/bin/bash
FROM registry.cn-beijing.aliyuncs.com/hantang/node105:v2
MAINTAINER jy "jiangyong@gongsibao.com"
ADD channel-access /apps/channel-access/
WORKDIR /apps/channel-access/
ADD center-app /apps/center-app/
WORKDIR /apps/center-app/
RUN cnpm install -S
CMD ["node","/apps/channel-access/main.js"]
CMD ["node","/apps/center-app/main.js"]
......
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
# channel-access
## 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/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "channel-access",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.0",
"core-js": "^3.4.4",
"element-ui": "^2.13.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"babel-eslint": "^10.0.3",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.10"
}
}
<!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>channel-access</title>
</head>
<body>
<noscript>
<strong>We're sorry but channel-access 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>
<template>
<!-- 根组件 -->
<div id="app">
<router-view/>
</div>
</template>
<style lang="scss">
</style>
// 用ip
// var host = "https://movie.douban.com/";
var dev = "192.168.18.237";
export default {
testData: `${dev ? dev : host}/xxx`
}
\ No newline at end of file
/* 改变主题色变量 */
$--color-primary: red;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
// 自定义主题色变量
$themecolor:red;
@import "~element-ui/packages/theme-chalk/src/index";
\ No newline at end of file
<template>
<div class="hello">
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
import axios from 'axios'
import { Message, MessageBox } from 'element-ui'
import store from '../store'
import router from '../router/index'
// 创建axios实例
const service = axios.create({
// baseURL: process.env.BASE_API, // api 的 base_url
timeout: 5000 // 请求超时时间
})
// request拦截器
service.interceptors.request.use(
config => {
if (store.getters.token) {
config.headers['X-Token'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
return config
},
error => {
// Do something with request error
console.log(error) // for debug
Promise.reject(error)
}
)
// response 拦截器
service.interceptors.response.use(
response => {
/**
* code为非20000是抛错 可结合自己业务进行修改
*/
const res = response.data
const codeReg = /^20\d+/
if (!codeReg.test(response.status)) {
Message({
message: res.message,
type: 'error',
duration: 5 * 1000
})
// 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
MessageBox.confirm(
'你已被登出,可以取消继续留在该页面,或者重新登录',
'确定登出',
{
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
store.dispatch('FedLogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})
})
}
return Promise.reject('error')
} else {
return response.data
}
},
error => {
console.log('err' + error) // for debug
Message({
message: error.message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
}
)
export default service
\ No newline at end of file
import http from './http.js'
export default {
post(url, data, config) {
return http.post(url, data, config)
},
get(url, params, config) {
const getConfig = {}
if (params) {
Object.assign(getConfig, {
params
})
}
if (config) Object.assign(getConfig, config)
return http.get(url, getConfig)
},
put(url, data, config) {
return http.put(url, data, config)
},
delete(url, params, config) {
const delConfig = {}
if (params) {
Object.assign(delConfig, {
params
})
}
if (config) Object.assign(delConfig, config)
return http.delete(url, delConfig)
}
}
\ No newline at end of file
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// ui以及主题样式
import Element from 'element-ui'
import './assets/css/globelcolor.scss'
// 请求方法
import http from './http/request'
Vue.prototype.$axios = http;
Vue.use(Element)
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/pages/Home'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'home',
component: Home
},
]
const router = new VueRouter({
routes
})
export default router
import Vue from 'vue'
import Vuex from 'vuex'
import state from './root/state'
import mutations from './root/mutations'
import getters from './root/getters'
import actions from './root/actions'
import userInfo from './modules/userinfo'
import brandreg from './modules/brandreg'
Vue.use(Vuex)
export default new Vuex.Store({
state: state,
mutations: mutations,
actions: actions,
getters: getters,
modules:{
brandreg,
userInfo
}
})
const actions = {
ASYNC_SET_NAME({ state, commit, rootState }, payload) {
setTimeout(() => {
state.bName = 'asyncName'
}, 4000)
}
}
export default actions
\ No newline at end of file
export default {
}
\ No newline at end of file
import state from './state'
import mutations from './mutations'
import getters from './getters'
import actions from './actions'
export default {
namespaced: true,
state,
mutations,
actions,
getters,
}
let state = {
userName: ""
}
export default state
\ No newline at end of file
const actions = {
ASYNC_SET_NAME({ state, commit, rootState }, payload) {
setTimeout(() => {
state.bName = 'asyncName'
}, 4000)
}
}
export default {
}
\ No newline at end of file
export default {
}
\ No newline at end of file
import state from './state'
import mutations from './mutations'
import getters from './getters'
import actions from './actions'
export default {
namespaced: true,
state,
mutations,
actions,
getters,
}
let state = {
userName: ""
}
export default state
\ No newline at end of file
const actions = {
ASYNC_SET_NAME({ state, commit, rootState }, payload) {
setTimeout(() => {
state.bName = 'asyncName'
}, 4000)
}
}
export default {
}
\ No newline at end of file
export default {
}
\ No newline at end of file
let state = {
userName: ""
}
export default state
\ No newline at end of file
<template>
<div class="home">
<i class="el-icon-edit"></i>
<i class="el-icon-share"></i>
<el-input v-model="input" placeholder="请输入内容"></el-input>
<el-button type="primary">主要按钮</el-button>
<el-button type="success">成功按钮</el-button>
<el-button type="info">信息按钮</el-button>
<Abc />
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";
import Abc from "@/views/pages/abc.vue";
import api from '@/api/api.js'
export default {
name: "home",
components: {
HelloWorld,
Abc
},
data() {
return {
input: "123"
};
},
created() {
this.$axios
.get("/api/j/search_tags", { type: "movie", source: "1" })
.then(d => {
console.log(d);
});
}
};
</script>
<template>
<div>
<header>111111111111111</header>
</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
@import "../../assets/css/globelcolor";
header {
background: $--color-primary;
}
</style>
\ No newline at end of file
module.exports = {
outputDir: 'dist', //build输出目录
assetsDir: 'assets', //静态资源目录(js, css, img)
lintOnSave: false, //是否开启eslint
devServer: {
open: true, //是否自动弹出浏览器页面
host: "localhost",
port: '8080',
https: false,
hotOnly: false,
proxy: {
'/api': {
target: 'https://movie.douban.com', //API服务器的地址
ws: true, //代理websockets
changeOrigin: true, // 虚拟的站点需要更管origin
pathRewrite: { //重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
'^/api': ''
}
}
},
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment