From 90d9a3b8bbd6bb5faee7de719761bb13ee050164 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Tue, 15 Oct 2019 09:54:52 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20getKycInfo=EF=BC=8C?= =?UTF-8?q?=E5=B0=9A=E6=9C=AA=E6=88=90=E5=8A=9F=E3=80=82=E5=8F=96=E6=B6=88?= =?UTF-8?q?commit=E6=97=B6=E7=9A=84tslint=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - src/models/user.ts | 7 +++++++ src/pages/identity/index.tsx | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index eff5f97..1402022 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,6 @@ }, "lint-staged": { "*.{ts,tsx}": [ - "tslint --fix", "git add" ] }, diff --git a/src/models/user.ts b/src/models/user.ts index 43ce708..8016409 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -60,6 +60,13 @@ const model: Model = { setLocale(lang, false); 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: { diff --git a/src/pages/identity/index.tsx b/src/pages/identity/index.tsx index 1aa1dbb..9698888 100644 --- a/src/pages/identity/index.tsx +++ b/src/pages/identity/index.tsx @@ -3,7 +3,7 @@ * Routes: * - ./src/pages/routes */ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { connect, DispatchProp, routerRedux } from 'dva'; import { formatMessage } from 'umi-plugin-locale'; import { Button, Modal, Input, Select } from 'antd'; @@ -56,6 +56,11 @@ const IdentityPage: React.FC const [realname, setRealname] = useState(); const [idNo, setIdNo] = useState(); + useEffect( () => { + console.info('实名认证中') + dispatch({ type: 'user/getKycInfo'}) + }, []); + const preview = (type) => { const pic1 = picCover.current; const pic2 = picBack.current; From f637a3c71d7f443fc0cdeac1aa645f954f984d54 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Thu, 24 Oct 2019 15:16:48 +0800 Subject: [PATCH 02/11] add webserver --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1402022..f41d28d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "dev": "umi dev", "dist": "umi build", "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", + "daemon4test.pm2": "cross-env NODE_ENV=production pm2 start ./node_modules/webserver/server.js --name vic.h5 -- -H server4test.vic.yuanjin.net -P http" }, "dependencies": { "@types/react-virtualized-auto-sizer": "^1.0.0", @@ -62,7 +63,8 @@ "tslint-react": "^4.0.0", "umi": "^2.8.20", "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": { "*.{ts,tsx}": [ From e8ad2705380b38427002ed3e7af0935f1080039e Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Thu, 24 Oct 2019 23:30:09 +0800 Subject: [PATCH 03/11] add Config*.js --- ConfigBasic.js | 22 ++++++++++++++++++++++ ConfigCustom.js | 6 ++++++ 2 files changed, 28 insertions(+) create mode 100644 ConfigBasic.js create mode 100644 ConfigCustom.js diff --git a/ConfigBasic.js b/ConfigBasic.js new file mode 100644 index 0000000..ebb50e6 --- /dev/null +++ b/ConfigBasic.js @@ -0,0 +1,22 @@ +module.exports={ + protocol: 'httpall', + 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`, // 登录用户私钥文件 + }, +} \ No newline at end of file diff --git a/ConfigCustom.js b/ConfigCustom.js new file mode 100644 index 0000000..cc4072b --- /dev/null +++ b/ConfigCustom.js @@ -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, +} \ No newline at end of file From 40bbe173c092bcb5706e1c42374b3bc07f72241f Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Thu, 24 Oct 2019 23:35:09 +0800 Subject: [PATCH 04/11] add daemon.pm2 script --- ConfigBasic.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ConfigBasic.js b/ConfigBasic.js index ebb50e6..1c7ca7b 100644 --- a/ConfigBasic.js +++ b/ConfigBasic.js @@ -1,5 +1,5 @@ module.exports={ - protocol: 'httpall', + protocol: 'https', host: 'server.vic.yuanjin.net', port: undefined, // 如果使用 https 协议,必须填写以下内容,或在命令行参数中设置: diff --git a/package.json b/package.json index f41d28d..fd0f22a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dist": "umi build", "deploy": "node ./node_modules/deployer/deploy.js --type git --repo 'https://github.com/vichome/webapp' --local 'dist'", "allinone": "npm run dist && npm run deploy", - "daemon4test.pm2": "cross-env NODE_ENV=production pm2 start ./node_modules/webserver/server.js --name vic.h5 -- -H server4test.vic.yuanjin.net -P http" + "daemon.pm2": "cross-env NODE_ENV=production pm2 start ./node_modules/webserver/server.js --name vic.h5" }, "dependencies": { "@types/react-virtualized-auto-sizer": "^1.0.0", From 214f483a1cf11de51a33c7cfa5507747d13edf5e Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Thu, 24 Oct 2019 23:38:59 +0800 Subject: [PATCH 05/11] only http is supported, since 443 is occupied by vic.server --- ConfigBasic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConfigBasic.js b/ConfigBasic.js index 1c7ca7b..04ae72d 100644 --- a/ConfigBasic.js +++ b/ConfigBasic.js @@ -1,5 +1,5 @@ module.exports={ - protocol: 'https', + protocol: 'http', host: 'server.vic.yuanjin.net', port: undefined, // 如果使用 https 协议,必须填写以下内容,或在命令行参数中设置: From a2aa7266ecb90bc3526e7a911a7c986e4bbdec8b Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Fri, 25 Oct 2019 00:25:46 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=9C=A8=20github=20=E4=B8=8A=E5=BB=BA?= =?UTF-8?q?=E7=AB=8B=20vichome/imo4test=EF=BC=8C=E7=9B=B8=E5=BA=94?= =?UTF-8?q?=E5=9C=A8=20dev=20=E5=88=86=E6=94=AF=E9=87=8C=20deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd0f22a..219d6b6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "lint:ts": "tslint \"src/**/*.ts\" \"src/**/*.tsx\"", "dev": "umi dev", "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/imo4test' --local 'dist'", "allinone": "npm run dist && npm run deploy", "daemon.pm2": "cross-env NODE_ENV=production pm2 start ./node_modules/webserver/server.js --name vic.h5" }, From 784c521bf470bc35040c160ac936031a667fbb9a Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Fri, 25 Oct 2019 09:36:07 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=8A=8A=20pub.js=20=EF=BC=88=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E5=88=B0=20github=20pages=EF=BC=89=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=88=B0=20deployer=20=E5=BA=93=E9=87=8C?= =?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4=E5=8E=9F=E6=9D=A5=E7=9A=84=20script?= =?UTF-8?q?s/*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/config.js | 45 ------------- scripts/pub.js | 161 ---------------------------------------------- 2 files changed, 206 deletions(-) delete mode 100644 scripts/config.js delete mode 100644 scripts/pub.js diff --git a/scripts/config.js b/scripts/config.js deleted file mode 100644 index a620c58..0000000 --- a/scripts/config.js +++ /dev/null @@ -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; -}; diff --git a/scripts/pub.js b/scripts/pub.js deleted file mode 100644 index 5ca86b5..0000000 --- a/scripts/pub.js +++ /dev/null @@ -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: \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(); From 7dd844f1661759a2b957a7a6562de7cd6174774e Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Fri, 25 Oct 2019 09:36:58 +0800 Subject: [PATCH 08/11] =?UTF-8?q?[package.json]=20=E5=88=A0=E9=99=A4=20npm?= =?UTF-8?q?=20run=20pub=20=E7=9A=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 219d6b6..191b0b6 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "start": "umi dev", "build": "umi build", "pub": "node scripts/pub.js", - "all": "npm run build && npm run pub", "test": "umi test", "lint:es": "eslint --ext .js src mock tests", "lint:ts": "tslint \"src/**/*.ts\" \"src/**/*.tsx\"", From 67310a3783b5d00846ee48173f29a3a2f2266186 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Fri, 25 Oct 2019 09:37:26 +0800 Subject: [PATCH 09/11] =?UTF-8?q?[package.json]=20=E5=88=A0=E9=99=A4=20npm?= =?UTF-8?q?=20run=20pub=20=E7=9A=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 191b0b6..abc7e30 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "scripts": { "start": "umi dev", "build": "umi build", - "pub": "node scripts/pub.js", "test": "umi test", "lint:es": "eslint --ext .js src mock tests", "lint:ts": "tslint \"src/**/*.ts\" \"src/**/*.tsx\"", From aad6b587dde24ad4c27870b5b79de4efe45233de Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 27 Oct 2019 12:41:29 +0800 Subject: [PATCH 10/11] =?UTF-8?q?[transform.ts]=20=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E7=9F=BF=E6=99=B6=E7=9A=84=E5=B8=81=E7=A7=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=BA=20VIC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.ts | 2 +- src/locales/zh-CN.ts | 2 +- src/utils/transform.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 609fba0..45c9b4f 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -100,7 +100,7 @@ export default { 'mine.origin': 'Please choose coin type', 'mine.calc': 'Exchange Calculator', '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', 'draw.title': 'Withdraw', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index e2364ba..5be3f0b 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -100,7 +100,7 @@ export default { 'mine.origin': '请选择来源币种', 'mine.calc': '汇率计算器:', 'mine.mine': '[VIC]', - 'mine.addressTitle': '充值 {label} 到您的专属地址(最低20起;20以下无效且无法退还)。扫描二维码或点击地址复制:', + 'mine.addressTitle': '充值 {label} 到您的专属地址(最低1000起;否则无效且无法退还)。扫描二维码或点击地址复制:', 'mine.info': '充值到达目标账户后,请回到上一页矿场点击刷新,平台查账确认后,您即可获得矿晶。', 'draw.title': '提币转账', diff --git a/src/utils/transform.ts b/src/utils/transform.ts index 04668f4..fbe86bb 100644 --- a/src/utils/transform.ts +++ b/src/utils/transform.ts @@ -58,7 +58,7 @@ export function displayTime(time: string | Moment): string { export function displayLabel(label?: string | null): string | null | undefined { if (label && label.toLowerCase().startsWith('usdt')) { - return 'USDT(erc20)'; + return 'VIC'; } return label; } From 7aab6a623feede5d7197b1f482a669e41ba836b6 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 27 Oct 2019 12:50:42 +0800 Subject: [PATCH 11/11] improve text --- src/locales/en-US.ts | 2 +- src/locales/zh-CN.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 45c9b4f..b946b37 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -101,7 +101,7 @@ export default { 'mine.calc': 'Exchange Calculator', 'mine.mine': '[VIC]', '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.selection': 'Please choose coin type', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 5be3f0b..bc162be 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -101,7 +101,7 @@ export default { 'mine.calc': '汇率计算器:', 'mine.mine': '[VIC]', 'mine.addressTitle': '充值 {label} 到您的专属地址(最低1000起;否则无效且无法退还)。扫描二维码或点击地址复制:', - 'mine.info': '充值到达目标账户后,请回到上一页矿场点击刷新,平台查账确认后,您即可获得矿晶。', + 'mine.info': '充值到达目标账户后,请回到上一页矿场点击刷新,您即可获得矿晶并每日收益。', 'draw.title': '提币转账', 'draw.selection': '请选择提取币种',