Commit 326f7c32 by 陆志强

feat: csr改造

parent 71b9d087
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-job
ENV HOST 0.0.0.0
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:nginx
RUN mkdir -p /usr/share/nginx/www/vote
COPY ./dist /usr/share/nginx/www/vote
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
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
......@@ -33,13 +33,13 @@
"lintfix": "prettier --write --list-different . && yarn lint:js --fix"
},
"dependencies": {
"@gdyfe/config": "^2.0.1",
"@gdyfe/config": "^2.1.5",
"@gdyfe/gdy-component-lib": "^0.4.1",
"@gdyfe/rop-client": "1.1.10",
"@gdyfe/webpack-alioss-plugin": "^0.1.6",
"@nuxtjs/axios": "^5.13.6",
"@vant/touch-emulator": "^1.3.2",
"core-js": "^3.19.3",
"axios": "^1.6.2",
"core-js": "^3.37.1",
"dayjs": "^1.11.3",
"normalize.css": "^8.0.1",
"plupload": "^2.3.9",
......@@ -55,18 +55,18 @@
"vue-clipboard2": "^0.2.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.0.0",
"@vue/cli-plugin-eslint": "^4.0.0",
"@vue/cli-service": "^4.0.0",
"@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",
"@nuxtjs/eslint-config": "^8.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/style-resources": "^1.2.1",
"babel-plugin-import": "^1.13.5",
"cross-env": "^7.0.3",
"eslint": "^8.4.1",
"eslint-config-alloy": "^3.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-nuxt": "^3.1.0",
"eslint-plugin-vue": "^8.2.0",
......
{
"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
......@@ -7,8 +7,8 @@
<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 %>config.js" rel="preload" as="script" />
<script src="<%= BASE_URL %>config.js"></script>
<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() {
......
......@@ -6,7 +6,7 @@
<script>
export default {
name: 'App'
name: 'App',
}
</script>
<style lang="less">
......
......@@ -17,6 +17,7 @@ axiosService.defaults.baseURL = `//${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(ENV_CONFIG.CUSTOMER_TOKEN_KEY);
......@@ -35,7 +36,7 @@ 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(环境变量)
......
......@@ -76,7 +76,7 @@ export default {
message: '请先登录',
duration: 1500,
onClose() {
if (process.client && window.self !== window.top) return
if (window.self !== window.top) return
self.jumpToLogin()
}
})
......
......@@ -80,7 +80,7 @@ export default {
if (val.length === 3) {
cityList.forEach((item, index) => {
if (item.value === val[0]) {
label += ''
label = String(label)
listItem = cityList[index].children
}
})
......
......@@ -54,7 +54,7 @@ export default {
if (val && val.length === 3) {
cityList.forEach((item, index) => {
if (item.value === val[0]) {
label += ''
label = String(label)
listItem = cityList[index].children
}
})
......
......@@ -18,12 +18,13 @@
use-button-slot
style="width: 52%; padding-right: 0"
>
<div slot="button" class="form-buttonbox">
<template slot:button>
<div class="form-buttonbox">
<van-button
type="default"
size="small"
class="form-buttonbox__button"
:class="{ 'form-buttonbox__button--checked': judgeSex == 1 }"
:class="{ 'form-buttonbox__button--checked': judgeSex === 1 }"
style="margin-right: 10px"
@click="data.sex = '男'"
>男</van-button
......@@ -32,11 +33,12 @@
type="default"
size="small"
class="form-buttonbox__button"
:class="{ 'form-buttonbox__button--checked': judgeSex == 2 }"
:class="{ 'form-buttonbox__button--checked': judgeSex === 2 }"
@click="data.sex = '女'"
>女</van-button
>
</div>
</template>
</van-field>
<van-field
v-model="data.birth"
......@@ -56,8 +58,8 @@
title="选择出生年月"
:min-date="min"
:max-date="max"
@confirm="confirmBirth()"
@cancel="cancelFn()"
@confirm="confirmBirth"
@cancel="cancelFn"
/>
</van-popup>
<van-field
......@@ -78,7 +80,7 @@
visible-item-count="8"
:show-toolbar="true"
@confirm="confirmEducation"
@cancel="cancelFn()"
@cancel="cancelFn"
/>
</van-popup>
<van-field
......@@ -95,21 +97,22 @@
<div class="form-cv">
<van-cell-group class="slot" :border="false">
<van-cell :border="false">
<template slot="title">
<template slot:title>
<div class="form-cv__title">简历</div>
</template>
<template slot="label">
<template slot:label>
<div style="white-space: nowrap">
支持png、jpeg、jpg、pdf格式,文件大小不可超过10M
</div>
</template>
<van-button
id="select"
slot="right-icon"
class="form-cv__addbutton"
icon="plus"
type="info"
/>
<template slot:right-icon>
<van-button
id="select"
class="form-cv__addbutton"
icon="plus"
type="info"
/>
</template>
</van-cell>
<div class="previewarea">
<div v-for="(item, count) in uploadList" :key="item.fullName">
......@@ -521,6 +524,7 @@ export default {
}
},
FilesAdded: (up, file) => {
/* eslint-disable no-param-reassign */
file.forEach((v) => {
const nameFilter = v.name.split('.')
nameFilter.pop()
......@@ -945,4 +949,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -10,13 +10,13 @@
</template>
<script>
import Loading from '@/components/Loading'
// import Loading from '@/components/Loading'
import { mapGetters } from 'vuex'
export default {
name: 'index',
components: {
Loading,
},
name: 'Index',
// components: {
// Loading,
// },
computed: {
...mapGetters({
isPageLoading: 'common/isPageLoading',
......
......@@ -13,6 +13,7 @@ export default {
SubmitForm: () => import('@/components/Submit/SubmitForm'),
},
beforeRouteEnter: (to, from, next) => {
/* eslint-disable no-param-reassign */
next((vm) => {
vm.backPath = from.path
})
......@@ -53,4 +54,4 @@ export default {
height: 100vh;
background-color: #fafafa;
}
</style>
\ No newline at end of file
</style>
......@@ -44,7 +44,7 @@ const actions = {
}
return new Promise((resolve, reject) => {
if (isReqSuccess) {
return resolve(data)
resolve(data)
}
reject(new Error(JSON.stringify({ errorCode, errorMessage })))
})
......
const userAgent = () => {
if (!process.client) return {}
const u = navigator.userAgent.toLowerCase()
const json = {
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
const path = require('path')
const { defineConfig } = require('@vue/cli-service');
const path = require('path');
const fs = require('fs');
/* config 配置下载 */
const { downloadConfigFile } = require('@gdyfe/config')
const { log } = require('console')
/* 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, './public/config.js')
path: path.resolve(__dirname, `${assetsDirPath}/config.js`),
})
.then(() => {
console.log('$$ config file downloaded $$')
console.log('$$ config file downloaded $$');
})
.catch(err => {
console.log('$$ config file download failed $$', err)
})
const BASE_URL = '/job/'
.catch((err) => {
console.log('$$ config file download failed $$', err);
});
module.exports = {
publicPath: BASE_URL, // vue-cli3 从baseUrl更名为publicPath
productionSourceMap: false,
chainWebpack: config => {
module.exports = defineConfig({
publicPath: BASE_URL,
assetsDir,
transpileDependencies: true,
chainWebpack: (config) => {
// 别名
config.resolve.alias.set('assets', path.resolve('src/assets')).set('public', path.resolve(__dirname, 'public')).set('@', path.resolve(__dirname, 'src'))
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 => {
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)
}
return args
})
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.parallel = 4
args[0].terserOptions.cache = true
args[0].terserOptions.compress.drop_console = true
args[0].terserOptions.compress.drop_debugger = true
return args
})
config.optimization.minimizer('terser').tap((args) => {
args[0].terserOptions.compress.drop_console = true;
args[0].terserOptions.compress.drop_debugger = true;
return args;
});
}
},
configureWebpack: {
plugins: [],
// 警告 webpack 的性能提示
performance: {
hints: false
}
},
runtimeCompiler: true,
devServer: {
disableHostCheck: true
},
css: {
sourceMap: false,
loaderOptions: {
less: {
// 配置less(其他样式解析用法一致)
lessOptions:{
javascriptEnabled: true,
}
},
postcss: {
plugins: [
require('postcss-pxtorem')({
rootValue: 75,
selectorBlackList: [/^html$/, /^body$/], // 忽略转换正则匹配项
propList: ['*'],
})
]
},
}
},
lintOnSave: false
}
});
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