删除对 configSec.js 的需求,直接嵌入代码

This commit is contained in:
luk.lu
2019-10-09 10:55:25 +08:00
parent 8291a5cb81
commit 152783fe8e
3 changed files with 10 additions and 12 deletions

View File

@@ -1,22 +1,21 @@
module.exports = { module.exports = {
protocol: 'http', protocol: 'https',
host: 'localhost', host: 'server.vic.yuanjin.net',
port: undefined, port: undefined,
// 如果使用 https 协议,必须填写以下内容,或在命令行参数中设置: // 如果使用 https 协议,必须填写以下内容,或在命令行参数中设置:
sslType: 'file', // file|greenlock sslType: 'file', // file|greenlock
sslDomainList: [], sslDomainList: [],
sslKey: 'ssl/privkey.pem', // ssl key file, sslKey: '/etc/letsencrypt/live/server.vic.yuanjin.net/privkey.pem', // ssl key file,
sslCert: 'ssl/fullchain.pem', // ssl cert file, sslCert: '/etc/letsencrypt/live/server.vic.yuanjin.net/fullchain.pem', // ssl cert file,
sslCA: 'ssl/client-cert.pem', // ssl ca file, sslCA: '/etc/letsencrypt/live/server.vic.yuanjin.net/cert.pem', // ssl ca file,
deploy: { deploy: {
type: 'web', type: 'web',
host: '', // 待部署到的主机 host: 'server.vic.yuanjin.net', // 待部署到的主机
port: '22', // 带部署到的主机的 SSH 端口 port: '22', // 带部署到的主机的 SSH 端口
dir: '/home/tic/node.console.web', // 待部署到的目录路径 dir: '/home/adot/vic-admin', // 待部署到的目录路径
dist: 'dist', // 待部署到的文件夹 dist: 'dist', // 待部署到的文件夹
user: 'tic', // 登录用户名 user: 'adot', // 登录用户名
password: '', // 登录用户密码 password: '', // 登录用户密码
key: `${process.env.HOME}/.ssh/id_rsa`, // 登录用户私钥文件 key: `${process.env.HOME}/.ssh/id_rsa`, // 登录用户私钥文件
}, },

View File

@@ -8,7 +8,7 @@
"deploy": "node ./node_modules/deployer/deploy.js", "deploy": "node ./node_modules/deployer/deploy.js",
"daemon": "cross-env NODE_ENV=production node server.js", "daemon": "cross-env NODE_ENV=production node server.js",
"daemon.sup": "cross-env NODE_ENV=production supervisor -i data.log,node_modules,dist -- server.js", "daemon.sup": "cross-env NODE_ENV=production supervisor -i data.log,node_modules,dist -- server.js",
"daemon.pm2": "cross-env NODE_ENV=production pm2 start server.js -name node.console.web", "daemon.pm2": "cross-env NODE_ENV=production pm2 start server.js --name vic.admin",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit" "test:unit": "vue-cli-service test:unit"
}, },

View File

@@ -5,7 +5,6 @@ import _ from 'lodash'
import ticCrypto from 'tic.crypto' import ticCrypto from 'tic.crypto'
import axios from 'axios' import axios from 'axios'
import * as Ticrypto from 'tic.crypto' import * as Ticrypto from 'tic.crypto'
import { tokenSec } from '../../../configSec'
export default { export default {
namespaced: true, namespaced: true,
@@ -51,7 +50,7 @@ export default {
const passwd = Ticrypto.hash(state.passwd) const passwd = Ticrypto.hash(state.passwd)
const ts = Date.now() const ts = Date.now()
const path = '/admin/in' const path = '/admin/in'
const sig = ticCrypto.hash(ts + path + tokenSec, { hasher: 'md5' }) const sig = ticCrypto.hash(ts + path + 'LimitSaltLOL8080', { hasher: 'md5' })
let result = await axios.post('admin/in', { name: state.username, passwd }, { headers: { ts, sig } }) let result = await axios.post('admin/in', { name: state.username, passwd }, { headers: { ts, sig } })
commit('updateSign', false) commit('updateSign', false)
if (result.data.code === 0) { if (result.data.code === 0) {