Skip to content

Commit 26a91da

Browse files
committed
chore: fix eslint
1 parent 7109459 commit 26a91da

File tree

4 files changed

+72
-68
lines changed

4 files changed

+72
-68
lines changed

.eslintrc.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ module.exports = {
1616
'arrow-parens': 'off',
1717
'comma-dangle': [ 'error', 'always-multiline' ],
1818
'comma-spacing': 'error',
19-
'curly': 'off',
20-
'indent': [ 'error', 2 ],
19+
curly: 'off',
20+
indent: [ 'error', 2 ],
2121
'key-spacing': 'error',
2222
'keyword-spacing': 'error',
2323
'linebreak-style': [ 'error', 'unix' ],
@@ -30,14 +30,14 @@ module.exports = {
3030
'no-unused-vars': 'warn',
3131
'nuxt/no-cjs-in-config': 'off',
3232
'object-curly-spacing': [ 'error', 'always' ],
33-
'quotes': [ 'error', 'single' ],
34-
'semi': [ 'error', 'never', { beforeStatementContinuationChars: 'always' } ],
33+
quotes: [ 'error', 'single' ],
34+
semi: [ 'error', 'never', { beforeStatementContinuationChars: 'always' } ],
3535
'space-before-blocks': [ 'error', 'always' ],
3636
'space-before-function-paren': [ 'error', 'always' ],
3737
'space-in-parens': 'error',
3838
'space-infix-ops': 'error',
3939
'space-unary-ops': 'error',
4040
'spaced-comment': [ 'error', 'always', { exceptions: [ '*' ] } ],
4141
'vue/singleline-html-element-content-newline': 'off',
42-
}
42+
},
4343
}

nuxt.config.js

+20-18
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,27 @@ module.exports = {
3131
htmlAttrs: { lang: 'zh-CN' },
3232
},
3333
render: {
34-
csp: process.env.NODE_ENV === 'development' && !process.env.DEBUG_CSP ? false : {
35-
reportOnly: false,
36-
hashAlgorithm: 'sha256',
37-
policies: {
38-
'default-src': [ '\'self\'', cdnOrigin, '\'report-sample\'' ],
39-
'img-src': [ '\'self\'', 'data:', jsdelivr, `https://*.${ALI_OSS_REGION}.aliyuncs.com`, 'https://keeer.net', 'https://*.keeer.net', 'https://www.google-analytics.com', 'https://payjs.cn' ],
40-
'script-src': [
41-
'\'self\'', cdnOrigin, jsdelivr, 'https://idframe.keeer.net', 'https://www.google-analytics.com', 'https://ssl.google-analytics.com', '\'report-sample\'',
42-
...(process.env.NODE_ENV === 'development' ? [ '\'unsafe-eval\'' ] : []),
43-
],
44-
'style-src': [ '\'self\'', jsdelivr, cdnOrigin, '\'unsafe-inline\'', '\'report-sample\'' ],
45-
'font-src': [ '\'self\'', jsdelivr, cdnOrigin, '\'report-sample\'' ],
46-
'object-src': [ '\'none\'' ],
47-
'form-action': [ '\'self\'', '\'report-sample\'' ],
48-
'frame-ancestors': [ '\'self\'' ],
49-
'connect-src': [ '\'self\'', 'https://www.google-analytics.com' ],
50-
'report-uri': [ '/csp-vio' ],
34+
csp: process.env.NODE_ENV === 'development' && !process.env.DEBUG_CSP
35+
? false
36+
: {
37+
reportOnly: false,
38+
hashAlgorithm: 'sha256',
39+
policies: {
40+
'default-src': [ '\'self\'', cdnOrigin, '\'report-sample\'' ],
41+
'img-src': [ '\'self\'', 'data:', jsdelivr, `https://*.${ALI_OSS_REGION}.aliyuncs.com`, 'https://keeer.net', 'https://*.keeer.net', 'https://www.google-analytics.com', 'https://payjs.cn' ],
42+
'script-src': [
43+
'\'self\'', cdnOrigin, jsdelivr, 'https://idframe.keeer.net', 'https://www.google-analytics.com', 'https://ssl.google-analytics.com', '\'report-sample\'',
44+
...(process.env.NODE_ENV === 'development' ? [ '\'unsafe-eval\'' ] : []),
45+
],
46+
'style-src': [ '\'self\'', jsdelivr, cdnOrigin, '\'unsafe-inline\'', '\'report-sample\'' ],
47+
'font-src': [ '\'self\'', jsdelivr, cdnOrigin, '\'report-sample\'' ],
48+
'object-src': [ '\'none\'' ],
49+
'form-action': [ '\'self\'', '\'report-sample\'' ],
50+
'frame-ancestors': [ '\'self\'' ],
51+
'connect-src': [ '\'self\'', 'https://www.google-analytics.com' ],
52+
'report-uri': [ '/csp-vio' ],
53+
},
5154
},
52-
},
5355
},
5456
loading: { color: '#f5fafd' },
5557
build: {

package.json

+44-44
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
{
2-
"name": "node-kas",
3-
"version": "1.0.1",
4-
"description": "A drop-in replacement for KAS.",
5-
"author": "Alan-Liang",
6-
"private": true,
7-
"scripts": {
8-
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
9-
"build": "cross-env NODE_ENV=production nuxt build",
10-
"start": "cross-env NODE_ENV=production node server/index.js",
11-
"generate": "nuxt generate",
12-
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
13-
},
14-
"dependencies": {
15-
"@keeer/libphonenumber": "^1.7.44-keeer1",
16-
"@koa/router": "^8.0.8",
17-
"@nuxtjs/dotenv": "^1.4.0",
18-
"ali-oss": "^6.5.1",
19-
"ali-sms": "^1.0.3",
20-
"cross-env": "^5.2.0",
21-
"email-validator": "^2.0.4",
22-
"koa": "^2.6.2",
23-
"koa-body": "^4.1.1",
24-
"koa2-winston": "^3.1.1",
25-
"maxmind": "^4.3.1",
26-
"node-fetch": "^2.6.0",
27-
"nodemailer": "^6.4.6",
28-
"nuxt": "^2.13.3",
29-
"pg": "^8.0.0",
30-
"ua-parser-js": "^0.7.23",
31-
"uuid": "^7.0.2",
32-
"winston": "^3.2.1"
33-
},
34-
"devDependencies": {
35-
"@nuxtjs/eslint-config": "^5.0.0",
36-
"@nuxtjs/eslint-module": "^3.0.0",
37-
"@nuxtjs/google-analytics": "^2.3.0",
38-
"@nuxtjs/vuetify": "^1.0.0",
39-
"@types/uuid": "^7.0.2",
40-
"babel-eslint": "^10.0.1",
41-
"eslint": "^7.0.0",
42-
"eslint-plugin-nuxt": ">=0.4.2",
43-
"inquirer": "^7.1.0",
44-
"nodemon": "^1.18.9"
45-
}
2+
"name": "node-kas",
3+
"version": "1.0.1",
4+
"description": "A drop-in replacement for KAS.",
5+
"author": "Alan-Liang",
6+
"private": true,
7+
"scripts": {
8+
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server",
9+
"build": "cross-env NODE_ENV=production nuxt build",
10+
"start": "cross-env NODE_ENV=production node server/index.js",
11+
"generate": "nuxt generate",
12+
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
13+
},
14+
"dependencies": {
15+
"@keeer/libphonenumber": "^1.7.44-keeer1",
16+
"@koa/router": "^8.0.8",
17+
"@nuxtjs/dotenv": "^1.4.0",
18+
"ali-oss": "^6.5.1",
19+
"ali-sms": "^1.0.3",
20+
"cross-env": "^5.2.0",
21+
"email-validator": "^2.0.4",
22+
"koa": "^2.6.2",
23+
"koa-body": "^4.1.1",
24+
"koa2-winston": "^3.1.1",
25+
"maxmind": "^4.3.1",
26+
"node-fetch": "^2.6.0",
27+
"nodemailer": "^6.4.6",
28+
"nuxt": "^2.13.3",
29+
"pg": "^8.0.0",
30+
"ua-parser-js": "^0.7.23",
31+
"uuid": "^7.0.2",
32+
"winston": "^3.2.1"
33+
},
34+
"devDependencies": {
35+
"@nuxtjs/eslint-config": "^5.0.0",
36+
"@nuxtjs/eslint-module": "^3.0.0",
37+
"@nuxtjs/google-analytics": "^2.3.0",
38+
"@nuxtjs/vuetify": "^1.0.0",
39+
"@types/uuid": "^7.0.2",
40+
"babel-eslint": "^10.0.1",
41+
"eslint": "^7.0.0",
42+
"eslint-plugin-nuxt": ">=0.4.2",
43+
"inquirer": "^7.1.0",
44+
"nodemon": "^1.18.9"
45+
}
4646
}

pages/login.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default {
110110
password: '',
111111
agreeTerms: false,
112112
busy: false,
113-
title: '登录您的 KEEER 账户',
113+
title: '登录您的 KEEER 帐号',
114114
logoSrc: 'https://keeer.net/img/logo/light-square.jpg',
115115
backgroundUrl: 'https://nodekas-production.oss-cn-beijing.aliyuncs.com/assets/login-background.jpg',
116116
backgroundCopyright: '背景图片:CC BY-SA 4.0',
@@ -131,6 +131,8 @@ export default {
131131
mounted () {
132132
this.tab = location.hash === '#login' ? 'login' : 'signup'
133133
this.$nextTick(() => this.loadTabs = true)
134+
},
135+
created () {
134136
if (this.useCustom && this.useCustom !== 'redirect' && this.useCustom !== 'git') {
135137
for (const k of [ 'title', 'logoSrc', 'backgroundUrl' ]) this[k] = this.useCustom[k] || this[k]
136138
if (this.useCustom.logoSrc) this.customLogo = true

0 commit comments

Comments
 (0)