Merge branch 'dev'

为了切换到存币生息模型
This commit is contained in:
Luk Lu
2019-10-27 12:59:22 +08:00
10 changed files with 50 additions and 217 deletions

22
ConfigBasic.js Normal file
View File

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

6
ConfigCustom.js Normal file
View File

@@ -0,0 +1,6 @@
module.exports={
sslType: 'file',
sslKey: '/etc/letsencrypt/live/server4test.vic.yuanjin.net/privkey.pem', // ssl key file,
sslCert: '/etc/letsencrypt/live/server4test.vic.yuanjin.net/fullchain.pem', // ssl cert file,
sslCA: '/etc/letsencrypt/live/server4test.vic.yuanjin.net/bundle.pem', // ssl ca file,
}

View File

@@ -4,15 +4,14 @@
"scripts": { "scripts": {
"start": "umi dev", "start": "umi dev",
"build": "umi build", "build": "umi build",
"pub": "node scripts/pub.js",
"all": "npm run build && npm run pub",
"test": "umi test", "test": "umi test",
"lint:es": "eslint --ext .js src mock tests", "lint:es": "eslint --ext .js src mock tests",
"lint:ts": "tslint \"src/**/*.ts\" \"src/**/*.tsx\"", "lint:ts": "tslint \"src/**/*.ts\" \"src/**/*.tsx\"",
"dev": "umi dev", "dev": "umi dev",
"dist": "umi build", "dist": "umi build",
"deploy": "node ./node_modules/deployer/deploy.js --type git --repo 'https://github.com/vichome/webapp' --local 'dist'", "deploy": "node ./node_modules/deployer/deploy.js --type git --repo 'https://github.com/vichome/webapp' --local 'dist'",
"allinone": "npm run dist && npm run deploy" "allinone": "npm run dist && npm run deploy",
"daemon.pm2": "cross-env NODE_ENV=production pm2 start ./node_modules/webserver/server.js --name vic.h5"
}, },
"dependencies": { "dependencies": {
"@types/react-virtualized-auto-sizer": "^1.0.0", "@types/react-virtualized-auto-sizer": "^1.0.0",
@@ -62,11 +61,11 @@
"tslint-react": "^4.0.0", "tslint-react": "^4.0.0",
"umi": "^2.8.20", "umi": "^2.8.20",
"umi-plugin-react": "^1.9.19", "umi-plugin-react": "^1.9.19",
"umi-types": "^0.3.17" "umi-types": "^0.3.17",
"webserver": "git+https://git.faronear.org/npm/webserver"
}, },
"lint-staged": { "lint-staged": {
"*.{ts,tsx}": [ "*.{ts,tsx}": [
"tslint --fix",
"git add" "git add"
] ]
}, },

View File

@@ -1,45 +0,0 @@
'use strict';
const rRepoURL = /^(?:(?:git|https?|git\+https|git\+ssh):\/\/)?(?:[^@]+@)?([^\/]+?)[\/:](.+?)\.git$/; // eslint-disable-line no-useless-escape
const rGithubPage = /\.github\.(io|com)$/;
function parseRepo(repo) {
const split = repo.split(',');
const url = split.shift();
let branch = split[0];
if (!branch && rRepoURL.test(url)) {
const match = url.match(rRepoURL);
const host = match[1];
const path = match[2];
if (host === 'github.com') {
branch = rGithubPage.test(path) ? 'master' : 'gh-pages';
} else if (host === 'coding.net') {
branch = 'coding-pages';
}
}
return {
url: url,
branch: branch || 'master'
};
}
module.exports = function(args) {
const repo = args.repo || args.repository;
if (!repo) throw new TypeError('repo is required!');
if (typeof repo === 'string') {
const data = parseRepo(repo);
data.branch = args.branch || data.branch;
return [data];
}
const result = Object.keys(repo).map(key => {
return parseRepo(repo[key]);
});
return result;
};

View File

@@ -1,161 +0,0 @@
'use strict';
const pathFn = require('path');
const fs = require('hexo-fs');
const chalk = require('chalk');
const swig = require('swig-templates');
const moment = require('moment');
const Promise = require('bluebird');
const spawn = require('hexo-util/lib/spawn');
const parseConfig = require('./config');
const swigHelpers = {
now: function(format) {
return moment().format(format);
}
};
const args = {
repo: 'git@github.com:vichome/webapp',
name: 'Limo Saplf',
email: 'limosaplf@gmail.com',
};
function exec() {
const baseDir = '';
const deployDir = pathFn.join(baseDir, '.deploy_git');
const publicDir = 'dist';
let extendDirs = args.extend_dirs;
const ignoreHidden = args.ignore_hidden;
const ignorePattern = args.ignore_pattern;
const message = commitMessage(args);
const verbose = !args.silent;
if (!args.repo && process.env.HEXO_DEPLOYER_REPO) {
args.repo = process.env.HEXO_DEPLOYER_REPO;
}
if (!args.repo && !args.repository) {
let help = '';
help += 'You have to configure the deployment settings in _config.yml first!\n\n';
help += 'Example:\n';
help += ' deploy:\n';
help += ' type: git\n';
help += ' repo: <repository url>\n';
help += ' branch: [branch]\n';
help += ' message: [message]\n\n';
help += ' extend_dirs: [extend directory]\n\n';
help += 'For more help, you can check the docs: ' + chalk.underline('http://hexo.io/docs/deployment.html');
console.log(help);
return;
}
function git(...args) {
return spawn('git', args, {
cwd: deployDir,
verbose: verbose,
stdio: 'inherit'
});
}
function setup() {
const userName = args.name || args.user || args.userName || '';
const userEmail = args.email || args.userEmail || '';
// Create a placeholder for the first commit
return fs.writeFile(pathFn.join(deployDir, 'placeholder'), '').then(() => {
return git('init');
}).then(() => {
return userName && git('config', 'user.name', userName);
}).then(() => {
return userEmail && git('config', 'user.email', userEmail);
}).then(() => {
return git('add', '-A');
}).then(() => {
return git('commit', '-m', 'First commit');
});
}
function push(repo) {
return git('add', '-A').then(() => {
return git('commit', '-m', message).catch(() => {
// Do nothing. It's OK if nothing to commit.
});
}).then(() => {
return git('push', '-u', repo.url, 'HEAD:' + repo.branch, '--force');
});
}
return fs.exists(deployDir).then(function(exist) {
if (exist) return;
// log.info('Setting up Git deployment...');
return setup();
}).then(() => {
// log.info('Clearing .deploy_git folder...');
return fs.emptyDir(deployDir);
}).then(() => {
const opts = {};
// log.info('Copying files from public folder...');
if (typeof ignoreHidden === 'object') {
opts.ignoreHidden = ignoreHidden.public;
} else {
opts.ignoreHidden = ignoreHidden;
}
if (typeof ignorePattern === 'string') {
opts.ignorePattern = new RegExp(ignorePattern);
} else if (typeof ignorePattern === 'object' && Reflect.apply(Object.prototype.hasOwnProperty, ignorePattern, ['public'])) {
opts.ignorePattern = new RegExp(ignorePattern.public);
}
return fs.copyDir(publicDir, deployDir, opts);
}).then(() => {
// log.info('Copying files from extend dirs...');
if (!extendDirs) {
return;
}
if (typeof extendDirs === 'string') {
extendDirs = [extendDirs];
}
const mapFn = function(dir) {
const opts = {};
const extendPath = pathFn.join(baseDir, dir);
const extendDist = pathFn.join(deployDir, dir);
if (typeof ignoreHidden === 'object') {
opts.ignoreHidden = ignoreHidden[dir];
} else {
opts.ignoreHidden = ignoreHidden;
}
if (typeof ignorePattern === 'string') {
opts.ignorePattern = new RegExp(ignorePattern);
} else if (typeof ignorePattern === 'object' && Reflect.apply(Object.prototype.hasOwnProperty, ignorePattern, [dir])) {
opts.ignorePattern = new RegExp(ignorePattern[dir]);
}
return fs.copyDir(extendPath, extendDist, opts);
};
return Promise.map(extendDirs, mapFn, {
concurrency: 2
});
}).then(() => {
return parseConfig(args);
}).each(function(repo) {
return push(repo);
});
};
function commitMessage(args) {
const message = args.m || args.msg || args.message || 'Site updated: {{ now(\'YYYY-MM-DD HH:mm:ss\') }}';
return swig.compile(message)(swigHelpers);
}
exec();

View File

@@ -100,8 +100,8 @@ export default {
'mine.origin': 'Please choose coin type', 'mine.origin': 'Please choose coin type',
'mine.calc': 'Exchange Calculator', 'mine.calc': 'Exchange Calculator',
'mine.mine': '[VIC]', 'mine.mine': '[VIC]',
'mine.addressTitle': 'Deposit >20 {label} to your address. Please scan QR code or click url to copy: ', 'mine.addressTitle': 'Deposit {label} to your address (at least 1000). Please scan QR code or click url to copy: ',
'mine.info': 'After the deposit, please click "Refresh" on the previous page to inform the platform. Crystals will become valid after the platform gets informed and confirms your deposit', 'mine.info': 'After the deposit, please click "Refresh" on the previous page, thereafter you\'ll get crystals and daily income',
'draw.title': 'Withdraw', 'draw.title': 'Withdraw',
'draw.selection': 'Please choose coin type', 'draw.selection': 'Please choose coin type',

View File

@@ -100,8 +100,8 @@ export default {
'mine.origin': '请选择来源币种', 'mine.origin': '请选择来源币种',
'mine.calc': '汇率计算器:', 'mine.calc': '汇率计算器:',
'mine.mine': '[VIC]', 'mine.mine': '[VIC]',
'mine.addressTitle': '充值 {label} 到您的专属地址(最低20起20以下无效且无法退还)。扫描二维码或点击地址复制:', 'mine.addressTitle': '充值 {label} 到您的专属地址(最低1000起否则无效且无法退还)。扫描二维码或点击地址复制:',
'mine.info': '充值到达目标账户后,请回到上一页矿场点击刷新,平台查账确认后,您即可获得矿晶。', 'mine.info': '充值到达目标账户后,请回到上一页矿场点击刷新,您即可获得矿晶并每日收益。',
'draw.title': '提币转账', 'draw.title': '提币转账',
'draw.selection': '请选择提取币种', 'draw.selection': '请选择提取币种',

View File

@@ -60,6 +60,13 @@ const model: Model = {
setLocale(lang, false); setLocale(lang, false);
yield put({ type: 'onUpdateState', payload: { lang } }); yield put({ type: 'onUpdateState', payload: { lang } });
}, },
*getKycInfo (_, { get }) {
// const data = await http.post('/user/verify', formData);
// yield get({type: 'user/verifyInfo'})
console.info('inside getKycInfo')
},
}, },
reducers: { reducers: {

View File

@@ -3,7 +3,7 @@
* Routes: * Routes:
* - ./src/pages/routes * - ./src/pages/routes
*/ */
import React, { useState } from 'react'; import React, { useState, useEffect } from 'react';
import { connect, DispatchProp, routerRedux } from 'dva'; import { connect, DispatchProp, routerRedux } from 'dva';
import { formatMessage } from 'umi-plugin-locale'; import { formatMessage } from 'umi-plugin-locale';
import { Button, Modal, Input, Select } from 'antd'; import { Button, Modal, Input, Select } from 'antd';
@@ -56,6 +56,11 @@ const IdentityPage: React.FC<DispatchProp & UserModelState & IdentityModelState>
const [realname, setRealname] = useState(); const [realname, setRealname] = useState();
const [idNo, setIdNo] = useState(); const [idNo, setIdNo] = useState();
useEffect( () => {
console.info('实名认证中')
dispatch({ type: 'user/getKycInfo'})
}, []);
const preview = (type) => { const preview = (type) => {
const pic1 = picCover.current; const pic1 = picCover.current;
const pic2 = picBack.current; const pic2 = picBack.current;

View File

@@ -58,7 +58,7 @@ export function displayTime(time: string | Moment): string {
export function displayLabel(label?: string | null): string | null | undefined { export function displayLabel(label?: string | null): string | null | undefined {
if (label && label.toLowerCase().startsWith('usdt')) { if (label && label.toLowerCase().startsWith('usdt')) {
return 'USDT(erc20)'; return 'VIC';
} }
return label; return label;
} }