Commit 36dfff04 by 陆志强

Merge branch 'feature/neotype' into test

parents 79381c82 e01945f7
module.exports = {
root: true,
env: {
browser: true,
node: true
},
env: {},
extends: [
'alloy',
'alloy/vue',
],
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false
},
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'prettier'
],
plugins: [
],
// add your custom rules here
rules: {}
}
ignorePatterns: ["**/WSTimer/timer.js", "public/**"],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
"vue/component-tags-order": ["error", {
"order": ["template", "script", "style"]
}],
"vue/multi-word-component-names":"off",
'vue/no-reserved-component-names': 'off',
'new-cap': 'off',
'vue/no-duplicate-attributes': 'off',
"max-lines-per-function": 'off',
"complexity": 'off',
"max-params": 'off',
"max-depth": ["error", 6],
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": [
"e", // for e.returnvalue
"ctx", // for Koa routing
"req", // for Express requests
"request", // for Express requests
"res", // for Express responses
"response", // for Express responses
"state", // for vuex state
"item",
"files"
]
}
]
},
};
FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:zabbix
ADD ./ /var/www/web_lottery
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web_lottery
RUN yarn install
RUN yarn build:prod
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml pDockerfile README.md pStart.sh
EXPOSE 4002
RUN chmod +x start.sh
ENTRYPOINT ["./start.sh"]
FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:nginx
RUN mkdir -p /usr/share/nginx/www/lottery
COPY ./dist /usr/share/nginx/www/lottery
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
FROM alpine AS builder
WORKDIR /home/app
RUN apk add --no-cache --update nodejs yarn
COPY package.json yarn.lock ./
RUN yarn install --registry=https://registry.yarnpkg.com
FROM registry.cn-hangzhou.aliyuncs.com/open_images/node12.13.1-pm2
ADD ./ /var/www/web_lottery
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web_lottery
COPY --from=builder /home/app/package.json ./package.json
COPY --from=builder /home/app/node_modules ./node_modules
RUN yarn build:cbn
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml Dockerfile README.md start.sh
EXPOSE 4002
RUN chmod +x cbnStart.sh
ENTRYPOINT ["./cbnStart.sh"]
#!/bin/sh
yarn run pm2:cbn
while true
do
sleep 5;
done
FROM alpine AS builder
WORKDIR /home/app
RUN apk add --no-cache --update nodejs yarn
COPY package.json yarn.lock ./
RUN yarn install --registry=https://registry.yarnpkg.com
FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:zabbix
ADD ./ /var/www/web_lottery
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web_lottery
COPY --from=builder /home/app/package.json ./package.json
COPY --from=builder /home/app/node_modules ./node_modules
RUN yarn build:cbnclouds
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml Dockerfile README.md start.sh
EXPOSE 4002
RUN chmod +x cbncloudsStart.sh
ENTRYPOINT ["./cbncloudsStart.sh"]
#!/bin/sh
yarn run pm2:cbnclouds
while true
do
sleep 5;
done
FROM alpine AS builder
WORKDIR /home/app
RUN apk add --no-cache --update nodejs yarn
COPY package.json yarn.lock ./
RUN yarn install --registry=https://registry.yarnpkg.com
FROM registry.cn-hangzhou.aliyuncs.com/open_images/node12.13.1-pm2
ADD ./ /var/www/web_lottery
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web_lottery
COPY --from=builder /home/app/package.json ./package.json
COPY --from=builder /home/app/node_modules ./node_modules
RUN yarn build:cdzhcm
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml Dockerfile README.md start.sh
EXPOSE 4002
RUN chmod +x cdzhcmStart.sh
ENTRYPOINT ["./cdzhcmStart.sh"]
#!/bin/sh
yarn run pm2:cdzhcm
while true
do
sleep 5;
done
FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:zabbix
ADD ./ /var/www/web_lottery
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web_lottery
RUN yarn install
RUN yarn build:cm
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml Dockerfile README.md start.sh
EXPOSE 4002
RUN chmod +x cmStart.sh
ENTRYPOINT ["./cmStart.sh"]
\ No newline at end of file
#!/bin/sh
yarn run pm2:cm
while true
do
sleep 5;
done
const protocol = process.client && window.location.protocol
export default {
goDomain: `//${process.env.GO_API_DOMAIN}/v1`,
privateDomain: `//${process.env.PRIVATE_API_DOMAIN}/v1`,
activityDomain: `//${process.env.ACTIVITY_API_DOMAIN}/v1`,
defBanner: `//${process.env.OSS_DOMAIN}/common/img/lottery_banner_default_v2.png`,
defShareImg: `${protocol || 'https:'}//${process.env.OSS_DOMAIN}/common/img/lottery.png`, // 必须带协议头,否则微信分享配置时无法生效
ossImageServe: process.env.IS_PRIVATE ? '' : '?x-oss-process=style/mobilebackground',
}
FROM alpine AS builder
WORKDIR /home/app
RUN apk add --no-cache --update nodejs yarn
COPY package.json yarn.lock ./
RUN yarn install --registry=https://registry.yarnpkg.com
FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:zabbix
ADD ./ /var/www/web_lottery
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web_lottery
COPY --from=builder /home/app/package.json ./package.json
COPY --from=builder /home/app/node_modules ./node_modules
RUN yarn build:cuc
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml Dockerfile README.md start.sh
EXPOSE 4002
RUN chmod +x cucStart.sh
ENTRYPOINT ["./cucStart.sh"]
\ No newline at end of file
#!/bin/sh
yarn run pm2:cuc
while true
do
sleep 5;
done
FROM alpine AS builder
WORKDIR /home/app
RUN apk add --no-cache --update nodejs yarn
COPY package.json yarn.lock ./
RUN yarn install --registry=https://registry.yarnpkg.com
FROM registry.cn-hangzhou.aliyuncs.com/open_images/node12.13.1-pm2
ADD ./ /var/www/web_lottery
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web_lottery
COPY --from=builder /home/app/package.json ./package.json
COPY --from=builder /home/app/node_modules ./node_modules
RUN yarn build:huawei
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml Dockerfile README.md start.sh
EXPOSE 34002
RUN chmod +x huaweiStart.sh
ENTRYPOINT ["./huaweiStart.sh"]
#!/bin/sh
yarn run pm2:huawei
while true
do
sleep 5;
done
/* eslint-disable nuxt/no-cjs-in-config */
const path = require('path')
const WebpackAliOSSPlugin = require('@gdyfe/webpack-alioss-plugin')
const { getEnvConfig } = require('@gdyfe/config')
const { version, name } = require('./package.json')
const env = getEnvConfig({
server: process.env.mode,
ic: 'ZmUtZ5WNp%XBzDw='
})
const { X_CA_STAGE, RUN_SERVER, STATIC_SOURCE_DOMAIN, STATIC_OSS_ACCESS, OSS_DOMAIN } = env
const { SERVE_PORT, BASE_URL, PROJECT_NAME, SENTRY_DSN, GTAG_ID } = env.lottery
const IS_USE_OSS = process.env.NODE_ENV === 'production' && !!STATIC_OSS_ACCESS.accessKeyId
const plugins = IS_USE_OSS
? [
// 优化打包速度
new WebpackAliOSSPlugin({
accessKeyId: STATIC_OSS_ACCESS.accessKeyId,
accessKeySecret: STATIC_OSS_ACCESS.accessKeySecret,
region: STATIC_OSS_ACCESS.region,
bucket: STATIC_OSS_ACCESS.bucket,
prefix: PROJECT_NAME,
limit: 10, // 备份最近 10 个版本的 oss 文件
format: version,
exclude: [/.*\.html$/], // 或者 /.*\.html$/,排除.html文件的上传
deleteAll: false, // 优先匹配 format 配置项
output: path.resolve(__dirname, './nuxt-dist/dist/client'),
local: true // 上传打包输出目录里的文件
})
]
: []
const sentryConfig = IS_USE_OSS
? {
sentry: {
dsn: SENTRY_DSN,
config: {
name,
environment: RUN_SERVER,
release: version,
autoSessionTracking: false
},
lazy: true
}
}
: {}
const gtagConfig = IS_USE_OSS
? {
'google-gtag': {
id: GTAG_ID, // required
config: {
anonymize_ip: true,
send_page_view: false
}
}
}
: {}
export default {
buildDir: 'nuxt-dist',
env: {
...env,
UPLOADER_ACCESS: '',
STATIC_OSS_ACCESS: ''
},
router: {
base: BASE_URL,
middleware: ['device'],
extendRoutes(routes, resolve) {
routes.push({
path: '/',
redirect: '/list',
components: null
})
routes.push({
path: '/index/:id',
components: {
default: resolve(__dirname, 'pages/index') // or routes[index].component
}
})
}
},
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: '',
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover'
},
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' },
{
hid: 'description',
name: 'description',
content: '问卷报表'
}
],
link: [
{
rel: 'stylesheet',
href: `//${OSS_DOMAIN}/common/icon/iconfont.css`,
ssr: false
},
{ rel: 'icon', href: `//${OSS_DOMAIN}/common/img/gdy_favicon.png` },
{ rel: 'stylesheet', href: `//${STATIC_SOURCE_DOMAIN}/web-component/complaintsDeal/complaintsDeal.min.css` },
{
href: '//apiliveroom.dev.guangdianyun.tv/v1',
rel: 'dns-prefetch'
},
{
href: '//activity.guangdianyun.tv',
rel: 'dns-prefetch'
},
{
href: '//static-pro.guangdianyun.tv',
rel: 'dns-prefetch'
},
{
href: '//res.wx.qq.com',
rel: 'dns-prefetch'
},
{
href: '//www.googletagmanager.com',
rel: 'dns-prefetch'
},
{
rel: 'stylesheet',
href: `//${STATIC_SOURCE_DOMAIN}/custom-plugins-library/login-center/style.css`,
},
],
script: [
{ src: `//${STATIC_SOURCE_DOMAIN}/web-component/complaintsDeal/complaintsDeal.min.js`, defer: true },
{
src: `//${STATIC_SOURCE_DOMAIN}/custom-plugins-library/login-center/login-center.min.js`
},
]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['@/assets/styles/main.less'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
{ src: '@/plugins/routeHooks' },
{ src: '@/plugins/vant' },
{ src: '@/filters' },
{ src: '@/plugins/vueClipboard' },
{ src: '@/plugins/dmsService', ssr: false },
{ src: '@/plugins/pvStatisticalService', ssr: false },
{ src: '@/plugins/deviceId', ssr: false }
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/eslint
'@nuxtjs/eslint-module',
'@nuxtjs/style-resources'
],
/* less全局变量 */
styleResources: {
less: './assets/styles/variable.less'
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: ['@nuxtjs/axios', '@nuxtjs/sentry', '@nuxtjs/google-gtag'],
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
...sentryConfig,
...gtagConfig,
axios: {},
server: {
https: !process.env.NODE_ENV === 'production',
port: SERVE_PORT, // default: 3000
host: '0.0.0.0' // default: localhost
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
publicPath: IS_USE_OSS
? `//${STATIC_SOURCE_DOMAIN}/${PROJECT_NAME}/${version}`
: `/${X_CA_STAGE.toLowerCase() || 'prod'}/`,
transpile: [/vant.*?less/],
babel: {
plugins: [
[
'import',
{
libraryName: 'vant',
style: name => {
return `${name}/style/less.js`
}
},
'vant'
]
]
},
postcss: {
plugins: {
'postcss-pxtorem': {
rootValue: 75,
selectorBlackList: [/^html$/, /^body$/, '.lottery-entry', 'tippy'], // 忽略转换正则匹配项
propList: ['*']
}
}
},
plugins
}
}
......@@ -7,85 +7,72 @@
"release": "standard-version",
"release:minor": "standard-version -r minor",
"release:patch": "standard-version -r patch",
"serve:dev": "cross-env mode=test nuxt",
"serve:pre": "cross-env mode=preview nuxt",
"serve:prod": "cross-env mode=production nuxt",
"serve:cm": "cross-env mode=cm nuxt",
"serve:vvku": "cross-env mode=vvku nuxt",
"serve:cbn": "cross-env mode=cbn nuxt",
"serve:huawei": "cross-env mode=huawei nuxt",
"serve:cbnclouds": "cross-env mode=cbnclouds nuxt",
"serve:cuc": "cross-env mode=cuc nuxt",
"serve:cdzhcm": "cross-env mode=cdzhcm nuxt",
"build:dev": "cross-env mode=test nuxt build",
"build:pre": "cross-env mode=preview nuxt build",
"build:prod": "cross-env mode=production nuxt build",
"build:cm": "cross-env mode=cm nuxt build",
"build:vvku": "cross-env mode=vvku nuxt build",
"build:cbn": "cross-env mode=cbn nuxt build",
"build:huawei": "cross-env mode=huawei nuxt build",
"build:cbnclouds": "cross-env mode=cbnclouds nuxt build",
"build:cuc": "cross-env mode=cuc nuxt build",
"build:cdzhcm": "cross-env mode=cdzhcm nuxt build",
"start:dev": "cross-env mode=test nuxt start",
"start:pre": "cross-env mode=preview nuxt start",
"start:prod": "cross-env mode=production nuxt start",
"start:cm": "cross-env mode=cm nuxt start",
"start:vvku": "cross-env mode=vvku nuxt start",
"start:cbn": "cross-env mode=cbn nuxt start",
"start:huawei": "cross-env mode=huawei nuxt start",
"start:cbnclouds": "cross-env mode=cbnclouds nuxt start",
"start:cuc": "cross-env mode=cuc nuxt start",
"start:cdzhcm": "cross-env mode=cdzhcm nuxt start",
"pm2:dev": "pm2 start pm2.json --only lottery-test",
"pm2:pre": "pm2 start pm2.json --only lottery-pre",
"pm2:prod": "pm2 start pm2.json --only lottery-prod",
"pm2:cm": "pm2 start pm2.json --only lottery-cm",
"pm2:vvku": "pm2 start pm2.json --only lottery-vvku",
"pm2:cbn": "pm2 start pm2.json --only lottery-cbn",
"pm2:huawei": "pm2 start pm2.json --only lottery-huawei",
"pm2:cbnclouds": "pm2 start pm2.json --only lottery-cbnclouds",
"pm2:cuc": "pm2 start pm2.json --only lottery-cuc",
"pm2:cdzhcm": "pm2 start pm2.json --only lottery-cdzhcm",
"serve:dev": "cross-env mode=test vue-cli-service serve",
"serve:pre": "cross-env mode=preview vue-cli-service serve",
"serve:prod": "cross-env mode=production vue-cli-service serve",
"serve:cm": "cross-env mode=cm vue-cli-service serve",
"serve:vvku": "cross-env mode=vvku vue-cli-service serve",
"serve:cbn": "cross-env mode=cbn vue-cli-service serve",
"serve:huawei": "cross-env mode=huawei vue-cli-service serve",
"serve:cbnclouds": "cross-env mode=cbnclouds vue-cli-service serve",
"serve:cuc": "cross-env mode=cuc vue-cli-service serve",
"serve:cdzhcm": "cross-env mode=cdzhcm vue-cli-service serve",
"build:dev": "cross-env mode=test vue-cli-service build",
"build:pre": "cross-env mode=preview vue-cli-service build",
"build:prod": "cross-env mode=production vue-cli-service build",
"build:cm": "cross-env mode=cm vue-cli-service build",
"build:vvku": "cross-env mode=vvku vue-cli-service build",
"build:cbn": "cross-env mode=cbn vue-cli-service build",
"build:huawei": "cross-env mode=huawei vue-cli-service build",
"build:cbnclouds": "cross-env mode=cbnclouds vue-cli-service build",
"build:cuc": "cross-env mode=cuc vue-cli-service build",
"build:cdzhcm": "cross-env mode=cdzhcm vue-cli-service build",
"generate": "nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint:style": "stylelint \"**/*.{vue,css}\" --ignore-path .gitignore",
"lint": "yarn lint:js && yarn lint:style"
},
"dependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@easy-messenger/client-connection": "^1.0.3",
"@gdyfe/config": "^1.3.2",
"@gdyfe/gdy-component-lib": "^1.0.3",
"@gdyfe/config": "^2.1.5",
"@gdyfe/gdy-component-lib": "^1.0.4",
"@gdyfe/rop-client": "1.1.10",
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/google-gtag": "^1.0.4",
"@nuxtjs/sentry": "^5.1.7",
"axios": "^0.18.0",
"@vant/area-data": "^1.5.1",
"core-js": "^3.15.1",
"core-js": "^3.37.1",
"dayjs": "^1.10.6",
"js-cookie": "2.2.0",
"lotteries": "^1.2.2",
"normalize.css": "^8.0.1",
"nuxt": "^2.15.8",
"qrcode": "^1.4.4",
"uuid": "^8.3.2",
"vant": "^2.12.22",
"vconsole": "^3.9.1",
"vue": "^2.6.14",
"vue-clipboard2": "^0.3.1",
"vue-cookie": "^1.1.4",
"vue-router": "^3.1.3",
"vuescroll": "^4.17.3",
"vuex": "^3.0.1",
"webpack": "^4.46.0",
"weixin-js-sdk": "^1.6.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.14.7",
"@gdyfe/webpack-alioss-plugin": "^0.1.6",
"@nuxtjs/eslint-config": "^6.0.1",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/style-resources": "^1.2.0",
"@vant/touch-emulator": "^1.3.2",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/eslint-config-airbnb": "^4.0.0",
"@vue/eslint-config-prettier": "^6.0.0",
"babel-plugin-import": "^1.13.3",
"cross-env": "^7.0.3",
"eslint": "^7.29.0",
"eslint-config-alloy": "^3.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-nuxt": "^2.0.0",
"eslint-plugin-vue": "^7.12.1",
......
export default function ({ store, app, redirect }) {
app.router.beforeEach((to, from, next) => {
// if (to.path === '/') {
// redirect({ path: '/list', query: to.query })
// return
// }
const { uin = 0, id = 0, sessionId = 0 } = to.query
if (!uin) {
app.context.error({ statusCode: 404, message: 'This page could not be found' })
}
store.commit('users/SET_UIN', uin)
if (['/list', '/index', '/message', '/winners'].includes(to.path) && !id) {
app.context.error({ statusCode: 450, message: 'Incomplete route, parameter: ID not found' })
}
if (['/index', '/message'].includes(to.path) && !sessionId) {
app.context.error({ statusCode: 450, message: 'Incomplete route, parameter: found:sessionId not found' })
}
next()
})
}
import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
import Vue from 'vue'
import vueScroll from 'vuescroll'
Vue.use(vueScroll)
{
"apps": [
{
"name": "lottery-test",
"script": "npm",
"args": "run start:dev",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "4G",
"env": {
"mode": "test",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-pre",
"script": "npm",
"args": "run start:pre",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "4G",
"env": {
"mode": "preview",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-prod",
"script": "npm",
"args": "run start:prod",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "8G",
"env": {
"mode": "production",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-cm",
"script": "npm",
"args": "run start:cm",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "8G",
"env": {
"mode": "cm",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-vvku",
"script": "npm",
"args": "run start:vvku",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "8G",
"env": {
"mode": "vvku",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-cbn",
"script": "npm",
"args": "run start:cbn",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "8G",
"env": {
"mode": "cbn",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-huawei",
"script": "npm",
"args": "run start:huawei",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "8G",
"env": {
"mode": "huawei",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-cbnclouds",
"script": "npm",
"args": "run start:cbnclouds",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "32G",
"env": {
"mode": "cbnclouds",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "lottery-cuc",
"script": "npm",
"args": "run start:cuc",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "32G",
"env": {
"mode": "cuc",
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
}
]
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<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" />
<meta http-equiv="Cache-Control" content="no-store no-cache" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" /> -->
<link href="<%= BASE_URL %><%= process.env.VUE_APP_ASSETS_DIR %>/config.js" rel="preload" as="script" />
<!-- <link href="<%= BASE_URL %><%= process.env.VUE_APP_ASSETS_DIR %>/moduleLoader.js" rel="preload" as="script" /> -->
<script src="<%= BASE_URL %><%= process.env.VUE_APP_ASSETS_DIR %>/config.js"></script>
<!-- <script src="<%= BASE_URL %><%= process.env.VUE_APP_ASSETS_DIR %>/moduleLoader.js"></script> -->
<title></title>
<script>
;(function() {
// Function to create and add a link element
function _addLink(href, rel) {
var linkTag = document.createElement('link')
linkTag.rel = rel
linkTag.href = href
document.head.appendChild(linkTag)
}
// Function to create and add a script element
function _addScript(src) {
var scriptTag = document.createElement('script')
scriptTag.src = src
document.head.appendChild(scriptTag)
}
// Add favicon and iconfont stylesheets
_addLink('//' + window.__GDY_ENV_CONFIG__.OSS_DOMAIN + '/common/img/gdy_favicon.png', 'icon')
_addLink('//' + window.__GDY_ENV_CONFIG__.OSS_DOMAIN + '/common/icon/iconfont.css', 'stylesheet')
_addLink('//' + window.__GDY_ENV_CONFIG__.STATIC_SOURCE_DOMAIN + '/web-component/complaintsDeal/complaintsDeal.min.css', 'stylesheet')
_addLink('//apiliveroom.dev.guangdianyun.tv/v1', 'dns-prefetch')
_addLink('//activity.guangdianyun.tv', 'dns-prefetch')
_addLink('//static-pro.guangdianyun.tv', 'dns-prefetch')
_addLink('//res.wx.qq.com', 'dns-prefetch')
_addLink('//www.googletagmanager.com', 'dns-prefetch')
_addLink('//' + window.__GDY_ENV_CONFIG__.STATIC_SOURCE_DOMAIN + '/custom-plugins-library/login-center/style.css', 'stylesheet')
_addScript('//' + window.__GDY_ENV_CONFIG__.STATIC_SOURCE_DOMAIN + '/web-component/complaintsDeal/complaintsDeal.min.js')
_addScript('//' + window.__GDY_ENV_CONFIG__.STATIC_SOURCE_DOMAIN + '/custom-plugins-library/login-center/login-center.min.js')
})()
</script>
<style>
</style>
</head>
<body>
<noscript>
<strong
>We're sorry but web_lottery 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>
<script>
export default {
name: 'App'
}
</script>
<style lang="less">
// html {
// // width: 100%;
// // height: 100%;
// // margin: 0;
// // padding: 0;
// // font-family: 'Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, 微软雅黑, Arial, sans-serif';
// body {
// width: 100%;
// height: 100%;
// margin: 0;
// padding: 0;
// #app {
// width: 100%;
// height: 100%;
// // background: #f7f7f7;
// }
// }
// }
</style>
/* eslint-disable no-confusing-arrow */
import { get, post } from '@/api/request'
import CONFIG from '@/config'
import CONFIG,{ ENV_CONFIG } from '@/config'
const { privateDomain } = CONFIG
const flag = process.env.X_CA_STAGE
const flag = ENV_CONFIG.X_CA_STAGE
// 获取地址列表
export const getAddressList = data =>
......
......@@ -7,9 +7,9 @@
4# 业务模块需要哪个接口则引入哪个
*/
import { get, post } from '@/api/request'
import CONFIG from '@/config'
import CONFIG, { ENV_CONFIG } from '@/config'
const { privateDomain, goDomain } = CONFIG
const flag = process.env.X_CA_STAGE
const flag = ENV_CONFIG.X_CA_STAGE
// 获取dms sub_key
export const getDmsInfo = data =>
......
/* eslint-disable no-confusing-arrow */
import { post, get } from '@/api/request'
import CONFIG from '@/config'
import CONFIG, { ENV_CONFIG } from '@/config'
const { activityDomain, privateDomain } = CONFIG
const flag = process.env.X_CA_STAGE
const flag = ENV_CONFIG.X_CA_STAGE
// 获取抽奖(场次)列表
export const getLotterySessionList = data =>
......
/* eslint-disable no-confusing-arrow */
import { post, get } from '@/api/request'
import CONFIG from '@/config'
import CONFIG, { ENV_CONFIG } from '@/config'
const { activityDomain } = CONFIG
const flag = process.env.X_CA_STAGE
const flag = ENV_CONFIG.X_CA_STAGE
// 获取个人抽奖记录
export const getRecordList = data =>
......
/* eslint-disable no-confusing-arrow */
import { get } from '@/api/request'
import CONFIG from '@/config'
import CONFIG, { ENV_CONFIG } from '@/config'
const { activityDomain } = CONFIG
const flag = process.env.X_CA_STAGE
const flag = ENV_CONFIG.X_CA_STAGE
// 获取留言抽奖中奖名单
export const getWinnersList = data =>
......
......@@ -4,6 +4,7 @@ import qs from "qs";
import VueCookie from "vue-cookie";
// message消息弹窗,可自行引入其他插件
import { Toast } from "vant";
import { ENV_CONFIG } from "@/config";
// 创建axios实例,不污染axios全局
const axiosService = axios.create();
......@@ -11,14 +12,15 @@ const axiosService = axios.create();
// 默认content-type
axiosService.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
// 默认baseURL
axiosService.defaults.baseURL = `//${process.env.CUSTOMER_API_DOMAIN}/v1`;
axiosService.defaults.baseURL = `https://${ENV_CONFIG.CUSTOMER_API_DOMAIN}/v1`;
// 默认请求超时时间
axiosService.defaults.timeout = 3 * 1000;
// 请求拦截器
/* eslint-disable no-param-reassign */
axiosService.interceptors.request.use(
config => {
const token = VueCookie.get(process.env.CUSTOMER_TOKEN_KEY);
const token = VueCookie.get(ENV_CONFIG.CUSTOMER_TOKEN_KEY);
const { method, headers } = config;
const data = filterNull(config.data);
// 格式化序列,目前只对post进行处理,可新增其他请求逻辑
......@@ -34,11 +36,11 @@ axiosService.interceptors.request.use(
// config.data = { unused: 0 } // axios内部处理了get方法,使data无效
}
// 自定义header键:token
if (token && process.client) {
if (token) {
config.headers.token = token;
}
// 自定义header键:X-Ca-Stage(环境变量)
config.headers["X-Ca-Stage"] = process.env.X_CA_STAGE;
config.headers["X-Ca-Stage"] = ENV_CONFIG.X_CA_STAGE;
config.metadata = { startTime: new Date() };
return config;
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
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 sign in to comment