Commit a73917a9 by 陆志强

Merge branch 'feature/csr'

parents de120aaa 5a18b777
module.exports = { module.exports = {
root: true, root: true,
env: { env: {},
browser: true, extends: [
node: true, 'alloy',
}, 'alloy/vue',
],
parserOptions: { parserOptions: {
parser: '@babel/eslint-parser', parser: '@babel/eslint-parser',
requireConfigFile: false,
}, },
extends: ['@nuxtjs', 'plugin:nuxt/recommended', 'prettier'], ignorePatterns: ["**/WSTimer/timer.js", "public/**"],
plugins: [], rules: {
// add your custom rules here 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
rules: {}, '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 FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:nginx
ADD ./ /var/www/web-job RUN mkdir -p /usr/share/nginx/www/job
ENV HOST 0.0.0.0 COPY ./dist /usr/share/nginx/www/job
ENV TZ Asia/Shanghai
WORKDIR /var/www/web-job
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 4011
RUN chmod +x start.sh
ENTRYPOINT ["./start.sh"]
FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:zabbix
ADD ./ /var/www/web-job
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web-job
RUN yarn install
RUN yarn build:cbnclouds
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml pDockerfile README.md pStart.sh
EXPOSE 4011
RUN chmod +x cbncloudsStart.sh
ENTRYPOINT ["./cbncloudsStart.sh"]
#!/bin/sh
/etc/init.d/zabbix_agentd start
yarn run pm2:cbnclouds
while true
do
sleep 5;
done
// const protocol = process.client && window.location.protocol
export default {
defDomain: `//${process.env.CUSTOMER_API_DOMAIN}/v1`,
goDomain: `//${process.env.GO_API_DOMAIN}/v1`,
privateDomain: `//${process.env.PRIVATE_API_DOMAIN}/v1`,
jobDomain: `//${process.env.ACTIVITY_API_DOMAIN}/v1`,
env: process.env.X_CA_STAGE,
private: process.env.IS_PRIVATE,
ossImageServe: process.env.IS_PRIVATE ? '' : '?x-oss-process=style/mobilebackground',
tokenKey: process.env.CUSTOMER_TOKEN_KEY,
// defShareImg: `${protocol || 'https:'}${process.env.OSS_DOMAIN}/common/img/lottery.png`, // 必须带协议头,否则微信分享配置时无法生效
}
FROM registry.cn-hangzhou.aliyuncs.com/cduan/customer-resource-base:zabbix
ADD ./ /var/www/web-job
ENV HOST 0.0.0.0
ENV TZ Asia/Shanghai
WORKDIR /var/www/web-job
RUN yarn install
RUN yarn build:cuc
RUN rm -rf assets components layouts middleware pages plugins store .eslintrc.js .gitignore build.yml pDockerfile README.md pStart.sh
EXPOSE 4011
RUN chmod +x cucStart.sh
ENTRYPOINT ["./cucStart.sh"]
\ No newline at end of file
#!/bin/sh
/etc/init.d/zabbix_agentd start
yarn run pm2:cuc
while true
do
sleep 5;
done
/* eslint-disable nuxt/no-cjs-in-config */
const path = require('path')
const resolve = (dir) => path.join(__dirname, dir)
const { getEnvConfig } = require("@gdyfe/config");
const WebpackAliOSSPlugin = require('@gdyfe/webpack-alioss-plugin')
const { version, name } = require('./package.json')
/* env configs */
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.job;
const sentryOptions = {
dsn: SENTRY_DSN,
env: RUN_SERVER,
version,
name,
};
const IS_USE_OSS = process.env.NODE_ENV === 'production'
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, // 上传打包输出目录里的文件
}),
]
: []
export default {
buildDir: 'nuxt-dist',
env: {
GTAG_ID,
sentryOptions,
...env,
UPLOADER_ACCESS: '',
STATIC_OSS_ACCESS: '',
},
router: {
base: BASE_URL,
middleware: ['device'],
extendRoutes(routes, resolve) {
routes.push({
path: '/',
redirect: '/index',
components: null,
})
},
},
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' },
],
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: '//static-pro.guangdianyun.tv',
rel: 'dns-prefetch',
},
],
script: [
{
src: `//${STATIC_SOURCE_DOMAIN}/web-component/complaintsDeal/complaintsDeal.min.js`,
defer: true,
},
],
},
// 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/vant' },
{ src: '@/filters' },
{ src: '@/plugins/dmsService', ssr: false },
{ src: '@/plugins/deviceId', ssr: false },
{ src: '@/plugins/pvStatisticalService', ssr: false },
{ src: '@/plugins/font', 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',
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
},
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$/], // 忽略转换正则匹配项
propList: ['*'],
},
},
},
loaders: {
less: {
lessOptions: {
javascriptEnabled: true,
modifyVars: {
// 引入less变量文件
hack: `true; @import "${resolve('./assets/styles/variable.less')}";`,
},
},
},
},
plugins,
},
}
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
"release": "standard-version", "release": "standard-version",
"release:minor": "standard-version -r minor", "release:minor": "standard-version -r minor",
"release:patch": "standard-version -r patch", "release:patch": "standard-version -r patch",
"serve:dev": "cross-env mode=test nuxt", "serve:dev": "cross-env mode=test vue-cli-service serve",
"serve:pre": "cross-env mode=preview nuxt", "serve:pre": "cross-env mode=preview vue-cli-service serve",
"serve:prod": "cross-env mode=production nuxt", "serve:prod": "cross-env mode=production vue-cli-service serve",
"serve:cbnclouds": "cross-env mode=cbnclouds nuxt", "serve:cbnclouds": "cross-env mode=cbnclouds vue-cli-service serve",
"serve:cuc": "cross-env mode=cuc nuxt", "serve:cuc": "cross-env mode=cuc vue-cli-service serve",
"build:dev": "cross-env mode=test nuxt build", "build:dev": "cross-env mode=test vue-cli-service build",
"build:pre": "cross-env mode=preview nuxt build", "build:pre": "cross-env mode=preview vue-cli-service build",
"build:prod": "cross-env mode=production nuxt build", "build:prod": "cross-env mode=production vue-cli-service build",
"build:cbnclouds": "cross-env mode=cbnclouds nuxt build", "build:cbnclouds": "cross-env mode=cbnclouds vue-cli-service build",
"build:cuc": "cross-env mode=cuc nuxt build", "build:cuc": "cross-env mode=cuc vue-cli-service build",
"start:dev": "cross-env mode=test nuxt start", "start:dev": "cross-env mode=test vue-cli-service build",
"start:pre": "cross-env mode=preview nuxt start", "start:pre": "cross-env mode=preview vue-cli-service build",
"start:prod": "cross-env mode=production nuxt start", "start:prod": "cross-env mode=production vue-cli-service build",
"start:cbnclouds": "cross-env mode=cbnclouds nuxt start", "start:cbnclouds": "cross-env mode=cbnclouds vue-cli-service build",
"start:cuc": "cross-env mode=cuc nuxt start", "start:cuc": "cross-env mode=cuc vue-cli-service build",
"pm2:dev": "pm2 start pm2.json --only job-test", "pm2:dev": "pm2 start pm2.json --only job-test",
"pm2:pre": "pm2 start pm2.json --only job-pre", "pm2:pre": "pm2 start pm2.json --only job-pre",
"pm2:prod": "pm2 start pm2.json --only job-prod", "pm2:prod": "pm2 start pm2.json --only job-prod",
...@@ -33,16 +33,15 @@ ...@@ -33,16 +33,15 @@
"lintfix": "prettier --write --list-different . && yarn lint:js --fix" "lintfix": "prettier --write --list-different . && yarn lint:js --fix"
}, },
"dependencies": { "dependencies": {
"@gdyfe/config": "^1.5.7", "@gdyfe/config": "^2.1.5",
"@gdyfe/gdy-component-lib": "^0.4.1", "@gdyfe/gdy-component-lib": "^0.4.1",
"@gdyfe/rop-client": "1.1.10", "@gdyfe/rop-client": "1.1.10",
"@gdyfe/webpack-alioss-plugin": "^0.1.6", "@gdyfe/webpack-alioss-plugin": "^0.1.6",
"@nuxtjs/axios": "^5.13.6",
"@vant/touch-emulator": "^1.3.2", "@vant/touch-emulator": "^1.3.2",
"core-js": "^3.19.3", "axios": "^1.6.2",
"core-js": "^3.37.1",
"dayjs": "^1.11.3", "dayjs": "^1.11.3",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"nuxt": "^2.15.8",
"plupload": "^2.3.9", "plupload": "^2.3.9",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"vant": "^2.12.36", "vant": "^2.12.36",
...@@ -50,21 +49,29 @@ ...@@ -50,21 +49,29 @@
"vue-cookie": "^1.1.4", "vue-cookie": "^1.1.4",
"vue-server-renderer": "^2.6.14", "vue-server-renderer": "^2.6.14",
"vue-template-compiler": "^2.6.14", "vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0" "webpack": "^4.46.0",
"vuex": "^3.0.1",
"vue-router": "^3.1.3",
"vue-clipboard2": "^0.2.1"
}, },
"devDependencies": { "devDependencies": {
"@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/eslint-parser": "^7.16.3", "@babel/eslint-parser": "^7.16.3",
"@nuxtjs/eslint-config": "^8.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/style-resources": "^1.2.1",
"babel-plugin-import": "^1.13.5", "babel-plugin-import": "^1.13.5",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^8.4.1", "eslint": "^8.4.1",
"eslint-config-alloy": "^3.0.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-nuxt": "^3.1.0", "eslint-plugin-nuxt": "^3.1.0",
"eslint-plugin-vue": "^8.2.0", "eslint-plugin-vue": "^8.2.0",
"less": "^4.1.2", "less": "^3.4.0",
"less-loader": "^7.3.0", "less-loader": "^5.0.0",
"postcss-pxtorem": "^5.1.1", "postcss-pxtorem": "^5.1.1",
"prettier": "^2.5.1" "prettier": "^2.5.1"
} }
......
{
"apps": [
{
"name": "job-test",
"script": "npm",
"args": "run start:dev",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "4G",
"env": {
"port": 4011,
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "job-pre",
"script": "npm",
"args": "run start:pre",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "4G",
"env": {
"port": 4011,
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "job-prod",
"script": "npm",
"args": "run start:prod",
"instances": "max",
"exec_mode": "cluster",
"autorestart": true,
"max_memory_restart": "8G",
"env": {
"port": 4011,
"NODE_ENV": "production"
},
"error_file": "./logs/app-err.log",
"out_file": "./logs/app-out.log"
},
{
"name": "job-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": "job-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 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" />
<script src="<%= BASE_URL %><%= process.env.VUE_APP_ASSETS_DIR %>/config.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)
}
_addLink('//apiliveroom.dev.guangdianyun.tv/v1', 'dns-prefetch')
_addLink('//static-pro.guangdianyun.tv', 'dns-prefetch')
// 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')
_addScript('//' + window.__GDY_ENV_CONFIG__.STATIC_SOURCE_DOMAIN + '/web-component/complaintsDeal/complaintsDeal.min.js')
})()
</script>
<style>
</style>
</head>
<body>
<noscript>
</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>
...@@ -4,6 +4,7 @@ import qs from "qs"; ...@@ -4,6 +4,7 @@ import qs from "qs";
import VueCookie from "vue-cookie"; import VueCookie from "vue-cookie";
// message消息弹窗,可自行引入其他插件 // message消息弹窗,可自行引入其他插件
import { Toast } from "vant"; import { Toast } from "vant";
import { ENV_CONFIG } from '@/config'
// 创建axios实例,不污染axios全局 // 创建axios实例,不污染axios全局
const axiosService = axios.create(); const axiosService = axios.create();
...@@ -11,14 +12,15 @@ const axiosService = axios.create(); ...@@ -11,14 +12,15 @@ const axiosService = axios.create();
// 默认content-type // 默认content-type
axiosService.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded"; axiosService.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
// 默认baseURL // 默认baseURL
axiosService.defaults.baseURL = `//${process.env.CUSTOMER_API_DOMAIN}/v1`; axiosService.defaults.baseURL = `//${ENV_CONFIG.CUSTOMER_API_DOMAIN}/v1`;
// 默认请求超时时间 // 默认请求超时时间
axiosService.defaults.timeout = 3 * 1000; axiosService.defaults.timeout = 3 * 1000;
// 请求拦截器 // 请求拦截器
/* eslint-disable no-param-reassign */
axiosService.interceptors.request.use( axiosService.interceptors.request.use(
config => { config => {
const token = VueCookie.get(process.env.CUSTOMER_TOKEN_KEY); const token = VueCookie.get(ENV_CONFIG.CUSTOMER_TOKEN_KEY);
const { method, headers } = config; const { method, headers } = config;
const data = filterNull(config.data); const data = filterNull(config.data);
// 格式化序列,目前只对post进行处理,可新增其他请求逻辑 // 格式化序列,目前只对post进行处理,可新增其他请求逻辑
...@@ -34,11 +36,11 @@ axiosService.interceptors.request.use( ...@@ -34,11 +36,11 @@ axiosService.interceptors.request.use(
// config.data = { unused: 0 } // axios内部处理了get方法,使data无效 // config.data = { unused: 0 } // axios内部处理了get方法,使data无效
} }
// 自定义header键:token // 自定义header键:token
if (token && process.client) { if (token) {
config.headers.token = token; config.headers.token = token;
} }
// 自定义header键:X-Ca-Stage(环境变量) // 自定义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() }; config.metadata = { startTime: new Date() };
return config; return config;
}, },
...@@ -53,7 +55,7 @@ axiosService.interceptors.response.use( ...@@ -53,7 +55,7 @@ axiosService.interceptors.response.use(
// 如果返回的状态码为200,说明接口请求成功,可以正常拿到数据 // 如果返回的状态码为200,说明接口请求成功,可以正常拿到数据
// 否则的话抛出错误 // 否则的话抛出错误
response.config.metadata.endTime = new Date(); response.config.metadata.endTime = new Date();
response.duration = (response.config?.metadata?.endTime || 0) - (response.config?.metadata?.startTime || 0); // response.duration = (response.config?.metadata?.endTime || 0) - (response.config?.metadata?.startTime || 0);
const { status, data } = response; const { status, data } = response;
if (status === 200) { if (status === 200) {
if (data && data.errorCode === 0 && data.code === 200) { if (data && data.errorCode === 0 && data.code === 200) {
...@@ -70,7 +72,7 @@ axiosService.interceptors.response.use( ...@@ -70,7 +72,7 @@ axiosService.interceptors.response.use(
}, },
error => { error => {
error.config.metadata.endTime = new Date(); error.config.metadata.endTime = new Date();
error.duration = (error.config?.metadata?.endTime || 0) - (error.config?.metadata?.startTime || 0); // error.duration = (error.config?.metadata?.endTime || 0) - (error.config?.metadata?.startTime || 0);
const { message } = error; const { message } = error;
if (message.includes("timeout")) { if (message.includes("timeout")) {
errorHandle(408); errorHandle(408);
......
...@@ -23,7 +23,7 @@ html { ...@@ -23,7 +23,7 @@ html {
// body 也增加最大最小宽度限制,避免默认100%宽度的 block 元素跟随 body 而过大过小 // body 也增加最大最小宽度限制,避免默认100%宽度的 block 元素跟随 body 而过大过小
body { body {
max-width: @--body-max-width; max-width: 540px;
min-width: @--body-min-width; min-width: 320px;
margin: 0 auto !important; margin: 0 auto !important;
} }
@import './reset.less'; // 去除默认样式 @import './reset.less'; // 去除默认样式
@import 'normalize.css/normalize.css'; // 统一各个浏览器样式的插件 @import '~normalize.css/normalize.css'; // 统一各个浏览器样式的插件
@import './adapt.less'; // 适配 @import './adapt.less'; // 适配
@import '~vant/lib/index.less';
html, html,
body { body {
...@@ -29,4 +30,4 @@ body { ...@@ -29,4 +30,4 @@ body {
.sidebar-hidden-scroll { .sidebar-hidden-scroll {
right: -0.2rem !important; right: -0.2rem !important;
opacity: 0.7; opacity: 0.7;
} }
\ No newline at end of file
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
message: '请先登录', message: '请先登录',
duration: 1500, duration: 1500,
onClose() { onClose() {
if (process.client && window.self !== window.top) return if (window.self !== window.top) return
self.jumpToLogin() self.jumpToLogin()
} }
}) })
......
...@@ -327,6 +327,7 @@ export default { ...@@ -327,6 +327,7 @@ export default {
width: 72px; width: 72px;
height: 40px; height: 40px;
border-radius: 25px; border-radius: 25px;
margin-right: 15px;
} }
&__submit { &__submit {
width: 261px; width: 261px;
......
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
if (val.length === 3) { if (val.length === 3) {
cityList.forEach((item, index) => { cityList.forEach((item, index) => {
if (item.value === val[0]) { if (item.value === val[0]) {
label += '' label = String(label)
listItem = cityList[index].children listItem = cityList[index].children
} }
}) })
......
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
if (val && val.length === 3) { if (val && val.length === 3) {
cityList.forEach((item, index) => { cityList.forEach((item, index) => {
if (item.value === val[0]) { if (item.value === val[0]) {
label += '' label = String(label)
listItem = cityList[index].children listItem = cityList[index].children
} }
}) })
......
...@@ -18,12 +18,13 @@ ...@@ -18,12 +18,13 @@
use-button-slot use-button-slot
style="width: 52%; padding-right: 0" style="width: 52%; padding-right: 0"
> >
<div slot="button" class="form-buttonbox"> <template #button>
<div class="form-buttonbox">
<van-button <van-button
type="default" type="default"
size="small" size="small"
class="form-buttonbox__button" class="form-buttonbox__button"
:class="{ 'form-buttonbox__button--checked': judgeSex == 1 }" :class="{ 'form-buttonbox__button--checked': judgeSex === 1 }"
style="margin-right: 10px" style="margin-right: 10px"
@click="data.sex = '男'" @click="data.sex = '男'"
>男</van-button >男</van-button
...@@ -32,11 +33,12 @@ ...@@ -32,11 +33,12 @@
type="default" type="default"
size="small" size="small"
class="form-buttonbox__button" class="form-buttonbox__button"
:class="{ 'form-buttonbox__button--checked': judgeSex == 2 }" :class="{ 'form-buttonbox__button--checked': judgeSex === 2 }"
@click="data.sex = '女'" @click="data.sex = '女'"
>女</van-button >女</van-button
> >
</div> </div>
</template>
</van-field> </van-field>
<van-field <van-field
v-model="data.birth" v-model="data.birth"
...@@ -56,8 +58,8 @@ ...@@ -56,8 +58,8 @@
title="选择出生年月" title="选择出生年月"
:min-date="min" :min-date="min"
:max-date="max" :max-date="max"
@confirm="confirmBirth()" @confirm="confirmBirth"
@cancel="cancelFn()" @cancel="cancelFn"
/> />
</van-popup> </van-popup>
<van-field <van-field
...@@ -78,7 +80,7 @@ ...@@ -78,7 +80,7 @@
visible-item-count="8" visible-item-count="8"
:show-toolbar="true" :show-toolbar="true"
@confirm="confirmEducation" @confirm="confirmEducation"
@cancel="cancelFn()" @cancel="cancelFn"
/> />
</van-popup> </van-popup>
<van-field <van-field
...@@ -95,21 +97,22 @@ ...@@ -95,21 +97,22 @@
<div class="form-cv"> <div class="form-cv">
<van-cell-group class="slot" :border="false"> <van-cell-group class="slot" :border="false">
<van-cell :border="false"> <van-cell :border="false">
<template slot="title"> <template v-slot:title>
<div class="form-cv__title">简历</div> <div class="form-cv__title">简历</div>
</template> </template>
<template slot="label"> <template v-slot:label>
<div style="white-space: nowrap"> <div style="white-space: nowrap">
支持png、jpeg、jpg、pdf格式,文件大小不可超过10M 支持png、jpeg、jpg、pdf格式,文件大小不可超过10M
</div> </div>
</template> </template>
<van-button <template v-slot:right-icon>
id="select" <van-button
slot="right-icon" id="select"
class="form-cv__addbutton" class="form-cv__addbutton"
icon="plus" icon="plus"
type="info" type="info"
/> />
</template>
</van-cell> </van-cell>
<div class="previewarea"> <div class="previewarea">
<div v-for="(item, count) in uploadList" :key="item.fullName"> <div v-for="(item, count) in uploadList" :key="item.fullName">
...@@ -521,6 +524,7 @@ export default { ...@@ -521,6 +524,7 @@ export default {
} }
}, },
FilesAdded: (up, file) => { FilesAdded: (up, file) => {
/* eslint-disable no-param-reassign */
file.forEach((v) => { file.forEach((v) => {
const nameFilter = v.name.split('.') const nameFilter = v.name.split('.')
nameFilter.pop() nameFilter.pop()
...@@ -945,4 +949,4 @@ export default { ...@@ -945,4 +949,4 @@ export default {
} }
} }
} }
</style> </style>
\ No newline at end of file
export const ENV_CONFIG = window.__GDY_ENV_CONFIG__
export default {
defDomain: `//${ENV_CONFIG.CUSTOMER_API_DOMAIN}/v1`,
goDomain: `//${ENV_CONFIG.GO_API_DOMAIN}/v1`,
privateDomain: `//${ENV_CONFIG.PRIVATE_API_DOMAIN}/v1`,
jobDomain: `//${ENV_CONFIG.ACTIVITY_API_DOMAIN}/v1`,
env: ENV_CONFIG.X_CA_STAGE,
private: ENV_CONFIG.IS_PRIVATE,
ossImageServe: ENV_CONFIG.IS_PRIVATE ? '' : '?x-oss-process=style/mobilebackground',
tokenKey: ENV_CONFIG.CUSTOMER_TOKEN_KEY,
// defShareImg: `${protocol || 'https:'}${ENV_CONFIG.OSS_DOMAIN}/common/img/lottery.png`, // 必须带协议头,否则微信分享配置时无法生效
}
...@@ -5,21 +5,21 @@ ...@@ -5,21 +5,21 @@
<router-view></router-view> <router-view></router-view>
</div> </div>
</div> </div>
<Loading :isShow="isPageLoading"></Loading> <!-- <Loading :isShow="isPageLoading"></Loading> -->
</div> </div>
</template> </template>
<script> <script>
import Loading from '@/components/Loading' // import Loading from '@/components/Loading'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'index', name: 'Index',
components: { // components: {
Loading, // Loading,
}, // },
computed: { computed: {
...mapGetters({ ...mapGetters({
isPageLoading: 'isPageLoading', isPageLoading: 'common/isPageLoading',
}), }),
}, },
watch: { watch: {
......
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/assets/styles/main.less' // global css
import '@/plugins/vant'
import '@/plugins/deviceId'
import '@/plugins/dmsService'
import '@/plugins/font'
import '@/plugins/pvStatisticalService'
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
...@@ -200,4 +200,4 @@ export default { ...@@ -200,4 +200,4 @@ export default {
/* background-color: #fff; */ /* background-color: #fff; */
// transition: all var(--time); // transition: all var(--time);
} }
</style> </style>
\ No newline at end of file
...@@ -13,6 +13,7 @@ export default { ...@@ -13,6 +13,7 @@ export default {
SubmitForm: () => import('@/components/Submit/SubmitForm'), SubmitForm: () => import('@/components/Submit/SubmitForm'),
}, },
beforeRouteEnter: (to, from, next) => { beforeRouteEnter: (to, from, next) => {
/* eslint-disable no-param-reassign */
next((vm) => { next((vm) => {
vm.backPath = from.path vm.backPath = from.path
}) })
...@@ -53,4 +54,4 @@ export default { ...@@ -53,4 +54,4 @@ export default {
height: 100vh; height: 100vh;
background-color: #fafafa; background-color: #fafafa;
} }
</style> </style>
\ No newline at end of file
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: '',
component: () => import('@/layout/index'),
children: [
{
path: '/index',
name: 'index',
component: () => import('../pages/Index/index'),
},
{
path: '/detail',
name: 'detail',
component: () => import('../pages/Detail/index'),
},
{
path: '/introduction',
name: 'introduction',
component: () => import('../pages/Introduction/index'),
},
{
path: '/submit',
name: 'submit',
component: () => import('../pages/Submit/index'),
},
{
path: '/success',
name: 'success',
component: () => import('../pages/Success/index'),
},
]
},
{
path: '/error',
name: '404',
component: () => import('@/components/errorPage/404'),
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router
import vue from 'vue'
import vuex from 'vuex'
import createLogger from 'vuex/dist/logger' // 修改日志
vue.use(vuex)
// https://webpack.js.org/guides/dependency-management/#requirecontext
const modulesFiles = require.context('./modules', true, /\.js$/)
// you do not need `import app from './modules/app'`
// it will auto require all vuex module from modules file
const modules = modulesFiles.keys().reduce((files, modulePath) => {
// set './app.js' => 'app'
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
files[moduleName] = value.default
return files
}, {})
export default new vuex.Store({
modules,
plugins: process.env.NODE_ENV !== 'production' ? [createLogger()] : [] // 开发环境下显示vuex的状态修改
})
export const state = () => ({ const state = {
isPageLoading: true // 加载动画 isPageLoading: true // 加载动画
}) }
export const mutations = { const mutations = {
SET_ISPAGELOADING: (state, isLoading) => { SET_ISPAGELOADING: (state, isLoading) => {
state.isPageLoading = isLoading state.isPageLoading = isLoading
} }
} }
export const actions = { const actions = {
updateIsPageLoading({ commit }, value) { updateIsPageLoading({ commit }, value) {
commit('common/SET_ISPAGELOADING', value, { root: true }) commit('common/SET_ISPAGELOADING', value, { root: true })
} }
} }
export const getters = { const getters = {
isPageLoading: state => state.isPageLoading // 是否加载 isPageLoading: state => state.isPageLoading // 是否加载
} }
export default {
namespaced: true,
state,
mutations,
actions,
getters
}
...@@ -4,13 +4,13 @@ import QuickStorage from '@/utils/QuickStorage' ...@@ -4,13 +4,13 @@ import QuickStorage from '@/utils/QuickStorage'
import { CUSTOM_SOURCE_TYPE } from '@/utils/constant' import { CUSTOM_SOURCE_TYPE } from '@/utils/constant'
import Bus from '@/utils/Bus' import Bus from '@/utils/Bus'
export const state = () => ({ const state = {
uin: 0, uin: 0,
isLogin: false, isLogin: false,
isBindPhone: null, isBindPhone: null,
userInfo: {} userInfo: {}
}) }
export const mutations = { const mutations = {
SET_USERINFO: (state, info) => { SET_USERINFO: (state, info) => {
state.userInfo = info state.userInfo = info
}, },
...@@ -24,7 +24,7 @@ export const mutations = { ...@@ -24,7 +24,7 @@ export const mutations = {
state.isBindPhone = isBind state.isBindPhone = isBind
} }
} }
export const actions = { const actions = {
async getUerInfo({ commit }, params = {}) { async getUerInfo({ commit }, params = {}) {
const res = await getUserInfo(params) const res = await getUserInfo(params)
const { code, errorCode, errorMessage, data } = res const { code, errorCode, errorMessage, data } = res
...@@ -44,7 +44,7 @@ export const actions = { ...@@ -44,7 +44,7 @@ export const actions = {
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (isReqSuccess) { if (isReqSuccess) {
return resolve(data) resolve(data)
} }
reject(new Error(JSON.stringify({ errorCode, errorMessage }))) reject(new Error(JSON.stringify({ errorCode, errorMessage })))
}) })
...@@ -54,13 +54,13 @@ export const actions = { ...@@ -54,13 +54,13 @@ export const actions = {
const params = { const params = {
channelId: id, // 资源id channelId: id, // 资源id
uin, uin,
userId: state.userInfo?.id || 0, userId: state.userInfo.id || 0,
type: CUSTOM_SOURCE_TYPE.job, type: CUSTOM_SOURCE_TYPE.job,
deviceid: QuickStorage.localGet('DEVICE_ID') deviceid: QuickStorage.localGet('DEVICE_ID')
} }
if(window.location.pathname === '/job/index') return setPvInfo(params) if(window.location.pathname === '/job/index') return setPvInfo(params)
console.log(window.location); console.log(window.location);
}, },
// 登录跳转地址 // 登录跳转地址
jumpToLogin({ state }) { jumpToLogin({ state }) {
...@@ -89,9 +89,16 @@ export const actions = { ...@@ -89,9 +89,16 @@ export const actions = {
window.location.href = `${origin}/my/login/binding?uin=${state.uin}&backUrl=${backUrl}` window.location.href = `${origin}/my/login/binding?uin=${state.uin}&backUrl=${backUrl}`
} }
} }
export const getters = { const getters = {
isLogin: state => state.isLogin, // 是否登录 isLogin: state => state.isLogin, // 是否登录
isBindPhone: state => state.isBindPhone, // 是否绑定手机 isBindPhone: state => state.isBindPhone, // 是否绑定手机
userInfo: state => state.userInfo, // 用户信息 userInfo: state => state.userInfo, // 用户信息
uin: state => state.uin uin: state => state.uin
} }
export default {
namespaced: true,
state,
mutations,
actions,
getters
}
import ROP from '@gdyfe/rop-client' import ROP from '@gdyfe/rop-client'
import { ENV_CONFIG } from '@/config'
const rp = new ROP({ const rp = new ROP({
ICS_ADDR: `mqttdms.${process.env.ROP_DOMAIN}`, ICS_ADDR: `mqttdms.${ENV_CONFIG.ROP_DOMAIN}`,
ROP_FLASH_SITE: `https://cdn.${process.env.ROP_DOMAIN}/dms/` ROP_FLASH_SITE: `https://cdn.${ENV_CONFIG.ROP_DOMAIN}/dms/`
}) })
export default rp export default rp
const userAgent = () => { const userAgent = () => {
if (!process.client) return {}
const u = navigator.userAgent.toLowerCase() const u = navigator.userAgent.toLowerCase()
const json = { const json = {
isAndroid: /Android|Linux|Adr/i.test(u), isAndroid: /Android|Linux|Adr/i.test(u),
......
#!/bin/sh
/etc/init.d/zabbix_agentd start
yarn run pm2:prod
while true
do
sleep 5;
done
# STORE
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Vuex Store files.
Vuex Store option is implemented in the Nuxt.js framework.
Creating a file in this directory automatically activates the option in the framework.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store).
const { defineConfig } = require('@vue/cli-service');
const path = require('path');
const fs = require('fs');
/* config 配置读取 */
const { downloadConfigFile } = require('@gdyfe/config');
const assetsDirMap = {
test: 'test',
preview: 'pre',
production: 'prod',
};
const assetsDir = assetsDirMap[process.env.mode] || 'prod';
const BASE_URL = '/job/';
const assetsDirPath = path.join(__dirname, './public', assetsDir);
if (!fs.existsSync(assetsDirPath)) {
fs.mkdirSync(assetsDirPath);
}
// 下载配置文件到指定目录
downloadConfigFile({
server: process.env.mode,
ic: 'ZmUtZ5WNp%XBzDw=',
path: path.resolve(__dirname, `${assetsDirPath}/config.js`),
})
.then(() => {
console.log('$$ config file downloaded $$');
})
.catch((err) => {
console.log('$$ config file download failed $$', err);
});
module.exports = defineConfig({
publicPath: BASE_URL,
assetsDir,
transpileDependencies: true,
chainWebpack: (config) => {
// 别名
config.resolve.alias
.set('@', path.join(__dirname, 'src'))
.set('assets', path.resolve('src/assets'))
.set('public', path.resolve(__dirname, 'public'));
// DefinePlugin
config.plugin('define').tap((args) => {
args[0]['process.env'] = {
...args[0]['process.env'],
mode: JSON.stringify(process.env.mode),
BASE_URL: JSON.stringify(BASE_URL),
VUE_APP_ASSETS_DIR: JSON.stringify(assetsDir),
};
return args;
});
// terser
if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer('terser').tap((args) => {
args[0].terserOptions.compress.drop_console = true;
args[0].terserOptions.compress.drop_debugger = true;
return args;
});
}
},
});
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