git: init+修改node版本

This commit is contained in:
2025-12-22 13:10:24 +08:00
parent 502359be4a
commit a7dbf76500
314 changed files with 88508 additions and 11 deletions

81
src/App.vue Normal file
View File

@@ -0,0 +1,81 @@
<template>
<div id="app">
<demo-error-modal/>
<demo-conditional-modal/>
<v-dialog/>
<router-view></router-view>
</div>
</template>
<script type="text/ecmascript-6">
import DemoErrorModal from "./components/vote/comportents/DemoErrorModal";
import DemoConditionalModal from "./components/vote/comportents/ConditionalModal";
import VModal from "vue-js-modal";
export default {
components: {
DemoErrorModal,
DemoConditionalModal
}
}
</script>
<style lang="stylus" rel="stylesheet/stylus">
html{
position: relative;
}
html, body , #app{
height: auto;
min-height: 100%;
}
/* 重定义element UI 表单placeholder样式 */
.el-input__inner::-webkit-input-placeholder {
color #aaabb1
}
.el-input__inner:-ms-input-placeholder { // IE10+
color #aaabb1
}
.el-input__inner:-moz-placeholder { // Firefox4-18
color #aaabb1
}
.el-input__inner::-moz-placeholder { // Firefox19+
color #aaabb1
}
.el-dropdown-menu__item:focus,
.el-dropdown-menu__item:not(.is-disabled):hover {
background-color #e9eeff !important
color #7392FF !important
}
.flip-list-item {
list-style-type: none;
/**
* 可以在v-enter-active和v-move中分别用transition过渡也可以在item中用transition包含了这两项
* 要用all不用transform有可能是因为splice删除效果不是transform
*/
/* transition: all 1s; */
}
.flip-list-enter-active, .flip-list-leave-active {
transition: all 1s;
}
.flip-list-move {
transition: all 1s;
}
.flip-list-enter, .flip-list-leave-to {
opacity: 0;
transform: translateX(50px);
}
/**
* 要让删除的元素先脱离文档流,旁边的元素才能过渡过来
*/
.flip-list-leave-active {
position: absolute;
}
</style>

137
src/api/common.js Normal file
View File

@@ -0,0 +1,137 @@
import request from "./request";
/*
* 公共接口 V3
*/
export const commonApi = {
SMS_TYPE: {
//修改手机号码
CHANGE_PHONE_VERIFY: "CHANGE_PHONE_VERIFY",
//修改登录密码
CHANGE_LOGIN_PWD_VERIFY: "CHANGE_LOGIN_PWD_VERIFY",
//修改交易密码
CHANGE_PAY_PWD_VERIFY: "CHANGE_PAY_PWD_VERIFY",
//用户手机注册验证
REGISTER_VERIFY: "REGISTER_VERIFY",
// 用户找回密码验证
FORGOT_VERIFY: "FORGOT_VERIFY",
// 用户找回交易密码
FORGOT_PAY_PWD_VERIFY: "FORGOT_PAY_PWD_VERIFY",
// 注册成为代理商用户
REGISTER_AGENT: "REGISTER_AGENT",
// 线下充值拒绝短信
UNDER_LINE_REFUSE: "UNDER_LINE_REFUSE",
// 线下充值成功短信
UNDER_LINE_SUCCESS: "UNDER_LINE_SUCCESS",
// 提币申请
WITHDRAW_APPLY: "WITHDRAW_APPLY",
// 提币成功
WITHDRAW_SUCCESS: "WITHDRAW_SUCCESS",
// 提现申请
CASH_WITHDRAWS: "CASH_WITHDRAWS",
// 登录
LOGIN: "LOGIN",
// 验证老手机或 邮箱
VERIFY_OLD_PHONE:"VERIFY_OLD_PHONE"
},
checkMobile(mobile, countryCode) {
return request({
url: '/user/users/checkTel',
method: 'get',
params: {mobile, countryCode}
})
},
checkEmail(email) {
return request({
url: '/user/user/checkEmail',
method: 'get',
params: {email}
})
},
// 用户信息
serverUserinfo(token) {
return request({
url: '/user/users/current/info',
method: 'get',
headers: {
'Authorization': token,
},
})
},
// 刷新token
refreshToken(token) {
return request({
url: '/user/refreshToken',
method: 'get',
headers: {
'Authorization': token,
},
})
},
// 改变语言
changeLanguage(lang) {
return request({
url: '/user/user/lang?lang=' + lang
})
},
sendSms(mobile, templateCode, countryCode = '+86', validateType) {
let data = {}
if (validateType === 1) {
data = {email: mobile, templateCode}
} else {
data = {mobile, templateCode, countryCode}
}
return request({
url: '/user/sms/sendTo',
method: "post",
data: data
})
},
// 提交工单
addWorkIssue(question, token) {
return request({
url: '/admin/workIssues/addWorkIssue',
method: "post",
headers: {
'Authorization': token,
},
data: {
question
}
})
},
// 获取工单列表
getWorkIssueList(current, size, token) {
return request({
url: `/admin/workIssues/issueList`,
params: {
current: current,
size: size
},
method: 'get',
headers: {
'Authorization': token
}
})
},
uuid(){
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
},
}

16
src/api/config.js Normal file
View File

@@ -0,0 +1,16 @@
export const commonParams = {
g_tk: 1928093487,
inCharset: 'utf-8',
outCharset: 'utf-8',
notice: 0,
format: 'jsonp'
}
export const options = {
param: 'jsonpCallback'
}
export const ERR_OK = 0
export const OK = 0
export const STATUSCODE = 'statuscode'

119
src/api/exchange.js Normal file
View File

@@ -0,0 +1,119 @@
import axios from 'axios'
let qs = require('qs')
import request from './request'
//创新交易
export const exchangeApi = {
// 资金账户
accountFunds(coinId,token) {
return request({
url: `/v2/s/account/funds/${coinId}`,
method: 'get',
headers: {
'Authorization': token,
}
})
},
forexMarketList() {
const url = '/v2/s/forex/market'
return axios({
url : url,
method: 'get'
}).then((res) => {
return Promise.resolve(res.data)
})
},
forexMarketArea(){
return request({
url : '/v2/s/forex_area',
method : 'get',
})
},
// 委托下单
entrustOrder(data, token) {
return request({
url : '/v2/s/forex/order/entrusts',
method: 'post',
headers:{
'Authorization': token,
},
data : data
})
},
// 撤销委托
entrustCancel(orderId, token) {
return request({
url : `/v2/s/forex/order/entrusts/${orderId}`,
method: 'delete',
headers:{
'Authorization': token,
},
})
},
serverFavorite(token) {
return request({
url: '/v2/s/forex/market/favorite',
method: 'get',
headers:{
'Authorization': token,
},
})
},
// 持仓明细
orderHolds(token) {
return request({
url: '/v2/s/forex/order/holds',
method: 'get',
headers: {
'Authorization': token,
}
})
},
// 持仓汇总
orderGathers(token) {
return request({
url: '/v2/s/forex/order/gathers',
method: 'get',
headers: {
'Authorization': token,
}
})
},
// 今日平仓
todayCloseout(token) {
return request({
url: '/v2/s/forex/order/today_closeout',
method: 'get',
headers: {
'Authorization': token,
}
})
},
// 今日委托
todayEntrusts(token) {
return request({
url: '/v2/s/forex/order/today_entrusts',
method: 'get',
headers: {
'Authorization': token,
}
})
},
// 今日成交
todayTurnovers(token) {
return request({
url: '/v2/s/forex/order/today_turnovers',
method: 'get',
headers: {
'Authorization': token,
}
})
}
}

332
src/api/finance.js Normal file
View File

@@ -0,0 +1,332 @@
import request from "./request";
let qs = require('qs');
import md5 from 'js-md5';
export const financeApi = {
/**
* 获取银行卡列表
*/
serverUserBank(token) {
return request({
url : '/user/userBanks/current',
method : 'get',
headers:{
'Authorization': token,
},
})
},
/**
* 获取cny充值记录
*/
serverSearchPaymentList(size, current, status, token) {
if(status == 4){
status = null ;
}
return request({
url : '/finance/cashRecharges/user/records',
method : 'get',
headers:{
'Authorization': token,
},
params: {
'size': size ,
'current': current ,
'status': status
},
});
},
/**
* 获取用户资产
*/
getUserAssets(data, token) {
let url = '/finance/account/asset';
if(data) {
url = '?'+qs.stringify(data)
}
return request({
url: url,
method: 'get',
headers:{
'Authorization': token,
},
})
},
/**
* 获取cny提现记录
*/
serverSearchWithdrawalsList(size, current, status, token) {
if(status==4){
status = null ;
}
return request({
url : '/finance/cashWithdrawals/user/records',
method : 'get',
headers:{
'Authorization': token,
},
params: {
'size': size ,
'current': current ,
'status': status
},
})
},
getCoinAsset (coinName, token) {
return request({
url : `/finance/account/${coinName}`,
method : 'get',
headers:{
'Authorization': token,
},
})
},
/**
* 卖出
*
* coinId 卖出币种
* mum 提现金额
* num 卖出数量
* payPassword 支付密码
* validateCode 验证码
*/
serverCreateWithdrawals(coinId, mum, num, payPassword, validateCode, token) {
let data = {
coinId,
mum,
num,
payPassword : md5(payPassword),
validateCode
};
return request({
url : '/finance/cashWithdrawals/sell',
method : 'post',
headers: {
'Authorization': token,
},
data,
});
},
/**
* 获取充值备注信息
*/
serverRecharge(coinId, mum, num, token) {
let data = {
coinId,
mum,
num,
};
return request({
url : '/finance/cashRecharges/buy',
method : 'post',
headers: {
'Authorization': token,
},
data,
});
},
serverAccount(token) {
return request({
url : '/finance/account/total',
method : 'get',
headers: {
'Authorization': token,
},
})
},
/**
* 添加银行卡
* bankCard 银行开号
* bankName 开户银行
* branchName 支行
* city 开户行所在城市
* name 开户名
* address 银行地址
* privince 开户行所在省
*/
serverCreateUserBank(id, realName, remark, bank, bankCard, payPassword, token) {
let data = {
id : id,
realName : realName,
remark : remark,
bank : bank,
/* bankProv : bankProv,
bankCity : bankCity,
bankAddr : bankAddr,*/
bankCard : bankCard,
payPassword: md5(payPassword),
}
return request({
url : '/user/userBanks/bind',
method : 'post',
headers: {
'Authorization': token,
},
data,
})
},
// 充值钱包地址
serverRechargeAddress(coidId, token) {
return request({
url : '/user/userAddress/getCoinAddress/'+coidId,
method : 'get',
headers: {
'Authorization': token,
},
})
},
/**
* 钱包币列表
*/
getWalletCoinList() {
return request({
url : '/v2/s/coin/trade/wallet',
method : 'get',
});
},
// 基础币列表
getBaseCoinList() {
return request({
url : '/finance/coins/all?status=1',
method : 'get',
})
},
/**
* 钱包币地址列表
*/
walletList(coinId, token) {
return request({
url : '/user/userWallets/getCoinAddress/'+coinId,
method : 'get',
headers: {
'Authorization': token,
},
})
},
/**
* 增加钱包地址
*/
serverAddWallet(coinId, name, addr, payPassword, token) {
let data = {
coinId,
name,
addr,
payPassword : md5(payPassword)
}
return request({
url : '/user/userWallets',
method : 'post',
headers: {
'Authorization': token,
},
data,
});
},
//资产管理 充值记录
serverInWalletRecord(size, current, coinId, token) {
if(coinId == 0){
coinId = null ;
}
let data = {
size,
current,
coinId
}
return request({
url : '/finance/coinRecharges/user/record?'+qs.stringify(data),
method : 'get',
headers: {
'Authorization': token,
},
});
},
//资产管理 提现记录
serverOutWalletRecord(size, current, coinId, token) {
if(coinId==0){
coinId = null ;
}
let data = {
size,
current,
coinId
}
return request({
url : '/finance/coinWithdraws/user/record?'+qs.stringify(data),
method : 'get',
headers: {
'Authorization': token,
},
});
},
/**
* 删除钱包地址
*/
serverdeleteWalletAddress(addressId, payPassword, token) {
return request({
url : '/user/userWallets/deleteAddress',
method : 'post',
headers: {
'Authorization': token,
},
params:{
addressId: addressId ,
payPassword: md5(payPassword)
},
});
},
// 提现
serverWithdraw (addressId, amount, coinId, payPassword, verifyCode, token) {
let data = {
addressId,
amount,
coinId,
payPassword : md5(payPassword),
verifyCode
}
return request({
url : '/v2/s/withdraw',
method : 'post',
headers: {
'Authorization': token,
},
data,
});
},
// 获取矿池资产 /reward/info
/**
user_id
amount 总冻结
thawed 已经解冻量
freeze 冻结奖励
can_defrost 可解冻奖励
*/
getRewardInfo() {
return request({
url : '/v2/s/reward/info',
method : 'get'
});
},
// 解冻资金
unfreezeReward() {
return request({
url : '/v2/s/reward/unfreeze',
method : 'post'
});
}
}

353
src/api/geetest.gt.js Normal file
View File

@@ -0,0 +1,353 @@
"v0.4.8 Geetest Inc.";
(function (window) {
"use strict";
if (typeof window === 'undefined') {
throw new Error('Geetest requires browser environment');
}
var document = window.document;
var Math = window.Math;
var head = document.getElementsByTagName("head")[0];
function _Object(obj) {
this._obj = obj;
}
_Object.prototype = {
_each: function (process) {
var _obj = this._obj;
for (var k in _obj) {
if (_obj.hasOwnProperty(k)) {
process(k, _obj[k]);
}
}
return this;
}
};
function Config(config) {
var self = this;
new _Object(config)._each(function (key, value) {
self[key] = value;
});
}
Config.prototype = {
api_server: 'api.geetest.com',
protocol: 'http://',
typePath: '/gettype.php',
fallback_config: {
slide: {
static_servers: ["static.geetest.com", "dn-staticdown.qbox.me"],
type: 'slide',
slide: '/static/js/geetest.0.0.0.js'
},
fullpage: {
static_servers: ["static.geetest.com", "dn-staticdown.qbox.me"],
type: 'fullpage',
fullpage: '/static/js/fullpage.0.0.0.js'
}
},
_get_fallback_config: function () {
var self = this;
if (isString(self.type)) {
return self.fallback_config[self.type];
} else if (self.new_captcha) {
return self.fallback_config.fullpage;
} else {
return self.fallback_config.slide;
}
},
_extend: function (obj) {
var self = this;
new _Object(obj)._each(function (key, value) {
self[key] = value;
})
}
};
var isNumber = function (value) {
return (typeof value === 'number');
};
var isString = function (value) {
return (typeof value === 'string');
};
var isBoolean = function (value) {
return (typeof value === 'boolean');
};
var isObject = function (value) {
return (typeof value === 'object' && value !== null);
};
var isFunction = function (value) {
return (typeof value === 'function');
};
var MOBILE = /Mobi/i.test(navigator.userAgent);
var pt = MOBILE ? 3 : 0;
var callbacks = {};
var status = {};
var nowDate = function () {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
if (month >= 1 && month <= 9) {
month = '0' + month;
}
if (day >= 0 && day <= 9) {
day = '0' + day;
}
if (hours >= 0 && hours <= 9) {
hours = '0' + hours;
}
if (minutes >= 0 && minutes <= 9) {
minutes = '0' + minutes;
}
if (seconds >= 0 && seconds <= 9) {
seconds = '0' + seconds;
}
var currentdate = year + '-' + month + '-' + day + " " + hours + ":" + minutes + ":" + seconds;
return currentdate;
}
var random = function () {
return parseInt(Math.random() * 10000) + (new Date()).valueOf();
};
var loadScript = function (url, cb) {
var script = document.createElement("script");
script.charset = "UTF-8";
script.async = true;
// 瀵筭eetest鐨勯潤鎬佽祫婧愭坊鍔<E59D8A> crossOrigin
if ( /static\.geetest\.com/g.test(url)) {
script.crossOrigin = "anonymous";
}
script.onerror = function () {
cb(true);
};
var loaded = false;
script.onload = script.onreadystatechange = function () {
if (!loaded &&
(!script.readyState ||
"loaded" === script.readyState ||
"complete" === script.readyState)) {
loaded = true;
setTimeout(function () {
cb(false);
}, 0);
}
};
script.src = url;
head.appendChild(script);
};
var normalizeDomain = function (domain) {
// special domain: uems.sysu.edu.cn/jwxt/geetest/
// return domain.replace(/^https?:\/\/|\/.*$/g, ''); uems.sysu.edu.cn
return domain.replace(/^https?:\/\/|\/$/g, ''); // uems.sysu.edu.cn/jwxt/geetest
};
var normalizePath = function (path) {
path = path.replace(/\/+/g, '/');
if (path.indexOf('/') !== 0) {
path = '/' + path;
}
return path;
};
var normalizeQuery = function (query) {
if (!query) {
return '';
}
var q = '?';
new _Object(query)._each(function (key, value) {
if (isString(value) || isNumber(value) || isBoolean(value)) {
q = q + encodeURIComponent(key) + '=' + encodeURIComponent(value) + '&';
}
});
if (q === '?') {
q = '';
}
return q.replace(/&$/, '');
};
var makeURL = function (protocol, domain, path, query) {
domain = normalizeDomain(domain);
var url = normalizePath(path) + normalizeQuery(query);
if (domain) {
url = protocol + domain + url;
}
return url;
};
var load = function (config, send, protocol, domains, path, query, cb) {
var tryRequest = function (at) {
var url = makeURL(protocol, domains[at], path, query);
loadScript(url, function (err) {
if (err) {
if (at >= domains.length - 1) {
cb(true);
// report gettype error
if (send) {
config.error_code = 508;
var url = protocol + domains[at] + path;
reportError(config, url);
}
} else {
tryRequest(at + 1);
}
} else {
cb(false);
}
});
};
tryRequest(0);
};
var jsonp = function (domains, path, config, callback) {
if (isObject(config.getLib)) {
config._extend(config.getLib);
callback(config);
return;
}
if (config.offline) {
callback(config._get_fallback_config());
return;
}
var cb = "geetest_" + random();
window[cb] = function (data) {
if (data.status == 'success') {
callback(data.data);
} else if (!data.status) {
callback(data);
} else {
callback(config._get_fallback_config());
}
window[cb] = undefined;
try {
delete window[cb];
} catch (e) {
}
};
load(config, true, config.protocol, domains, path, {
gt: config.gt,
callback: cb
}, function (err) {
if (err) {
callback(config._get_fallback_config());
}
});
};
var reportError = function (config, url) {
load(config, false, config.protocol, ['monitor.geetest.com'], '/monitor/send', {
time: nowDate(),
captcha_id: config.gt,
challenge: config.challenge,
pt: pt,
exception_url: url,
error_code: config.error_code
}, function (err) {})
}
var throwError = function (errorType, config) {
var errors = {
networkError: '缃戠粶閿欒',
gtTypeError: 'gt瀛楁涓嶆槸瀛楃涓茬被鍨<E8A2AB>'
};
if (typeof config.onError === 'function') {
config.onError(errors[errorType]);
} else {
throw new Error(errors[errorType]);
}
};
var detect = function () {
return window.Geetest || document.getElementById("gt_lib");
};
if (detect()) {
status.slide = "loaded";
}
window.initGeetest = function (userConfig, callback) {
var config = new Config(userConfig);
if (userConfig.https) {
config.protocol = 'https://';
} else if (!userConfig.protocol) {
config.protocol = window.location.protocol + '//';
}
// for KFC
if (userConfig.gt === '050cffef4ae57b5d5e529fea9540b0d1' ||
userConfig.gt === '3bd38408ae4af923ed36e13819b14d42') {
config.apiserver = 'yumchina.geetest.com/'; // for old js
config.api_server = 'yumchina.geetest.com';
}
if(userConfig.gt){
window.GeeGT = userConfig.gt
}
if(userConfig.challenge){
window.GeeChallenge = userConfig.challenge
}
if (isObject(userConfig.getType)) {
config._extend(userConfig.getType);
}
jsonp([config.api_server || config.apiserver], config.typePath, config, function (newConfig) {
var type = newConfig.type;
var init = function () {
config._extend(newConfig);
callback(new window.Geetest(config));
};
callbacks[type] = callbacks[type] || [];
var s = status[type] || 'init';
if (s === 'init') {
status[type] = 'loading';
callbacks[type].push(init);
load(config, true, config.protocol, newConfig.static_servers || newConfig.domains, newConfig[type] || newConfig.path, null, function (err) {
if (err) {
status[type] = 'fail';
throwError('networkError', config);
} else {
status[type] = 'loaded';
var cbs = callbacks[type];
for (var i = 0, len = cbs.length; i < len; i = i + 1) {
var cb = cbs[i];
if (isFunction(cb)) {
cb();
}
}
callbacks[type] = [];
}
});
} else if (s === "loaded") {
init();
} else if (s === "fail") {
throwError('networkError', config);
} else if (s === "loading") {
callbacks[type].push(init);
}
});
};
})(window);

16
src/api/geetest.js Normal file
View File

@@ -0,0 +1,16 @@
import gtInit from './geetest.gt'
import request from "./request";
export default {
getGtCaptcha (uuid) {
if(!uuid){
uuid = 'liang'
}
let url = '/user/gt/register';
return request({
method: 'get',
url: url,
params: {uuid}
})
},
}

52
src/api/home.js Normal file
View File

@@ -0,0 +1,52 @@
import request from "./request";
import axios from 'axios'
let qs = require('qs')
export const homeApi = {
// 新的首页 包含交易区的market接口
getMarketListNew(){
return request({
url : '/exchange/tradeAreas/markets',
method : 'get',
})
},
getMarketList(){
return request({
// url : '/v2/s/trade/market/all',
url : '/exchange/markets/all',
method : 'get',
}).then((res) => {
return Promise.resolve(res.data)
})
},
// 获取banner
getBanner(){
return request({
url : '/admin/webConfigs/banners',
method : 'get'
})
},
getDoucments(){
return request({
url : '/admin/webConfigs/documents',
method : 'get'
})
},
getNoticeList (current,size) {
return request({
url : `/admin/notices/simple`,
method : 'get',
params:{
current: current ,
size: size
}
})
},
getNoticeDetail (noticeId) {
return request({
url : `/admin/notices/simple/${noticeId}`,
method : 'get'
})
}
}

97
src/api/loginRegist.js Normal file
View File

@@ -0,0 +1,97 @@
import request from "./request";
import md5 from 'js-md5';
/*
* 注册登录
*/
export const loginRegist = {
/**
* 登录
*/
login(data) {
data.password = md5(data.password);
return request({
url: '/user/login',
method: 'post',
data,
})
},
/**
* 注册
*/
register(data, geetest_challenge,uuid, geetest_validate, geetest_seccode ,registType) {
let {countryCode, password, invitationCode, validateCode,email,mobile} = data;
alert(uuid)
let reqData = {
countryCode,
password : md5(password),
invitionCode: invitationCode,
validateCode,
geetest_challenge,
geetest_validate,
uuid,
geetest_seccode
}
if(registType === 0 ){
reqData.mobile = mobile
}else{
reqData.email = email
}
return request({
url: '/user/users/register',
method: 'post',
data: reqData
})
},
/**
* 获取图片验证码
*/
getValidateCodeImg() {
console.log('getValidateCodeImg')
const url = '/platform/user/getValidateCodeImg.m?t=' + Math.random()
return axios.get(url).then((res) => {
return Promise.resolve(res.data)
})
},
/**
* 获取usessionid
*/
getUsessionId() {
console.log('getUsessionId')
const url = '/platform/user/getUsessionId.m'
return axios.get(url).then((res) => {
return Promise.resolve(res.data)
})
},
/**
*
*获取用户信息
*/
serverGetUser() {
console.log('serverGetUser')
const url = '/trade/home/serverGetUser.o'
return axios.get(url).then((res) => {
return Promise.resolve(res.data)
})
},
/**
*
*退出登录
*/
logout() {
return request({
url: '/user/logout',
method: 'get',
})
},
// 设置新的登录密码
setPassword(data){
data.password = md5(data.password);
return request({
url: '/user/users/setPassword',
method: 'post',
data,
});
},
}

57
src/api/order.js Normal file
View File

@@ -0,0 +1,57 @@
import request from "./request";
let qs = require('qs');
export const orderApi = {
/**
* 获取成交记录
* type 0 全部
* 1 买入
* 2 卖出
* 3 自买自卖
*
*/
serverGetTurnoverOrderList(size, current, symbol, type, token) {
let data = {
size,
current,
symbol,
type,
};
return request({
url: '/exchange/turnoverOrders',
method: 'post',
headers: {
'Authorization': token,
},
params: data
});
},
/**
* 获取委托记录
*/
serverGetEntrustOrderList(size, current, symbol, type, token)
{
let data = {
size,
current,
symbol,
type
}
return request({
url : '/exchange/entrustOrders',
method : 'get',
headers: {
'Authorization': token,
},
params: data
});
},
}

105
src/api/request.js Normal file
View File

@@ -0,0 +1,105 @@
import axios from 'axios'
import {Message} from 'element-ui'
import {errorCodeMap} from "../common/js/errorCodeMap";
import {commonApi} from "./common";
import store from "../store";
import router from '../router'
// create an axios instance
const service = axios.create({
baseURL: process.env.BASE_API, // api的base_url
timeout: 10000 // request timeout
})
// 刷新token的url
const refreshTokenUrl = "/user/login/refreshToken";
// 请求创新交易资金的url
const requestForexFunds = "/v2/s/account/funds/"
// request interceptor
service.interceptors.request.use(config => {
const data = getExpireTime();
if (data) {
let {expire, updateTime} = data;
let nowTime = +new Date();
let activeTime = (nowTime - updateTime);
// console.log("activeTime", activeTime,expire,new Date(nowTime),new Date(updateTime));
// 如果当前活跃时间减去令牌更新时间小于过期时间(毫秒)
if (activeTime < expire) {
// 避免频繁调用接口 当快过期的时候刷新
if(activeTime>=(4*expire/5)){
let token = store.getters.refreshToken
// 当前接口不是刷新token 和轮训资产的接口 且token不为空
if (config.url.indexOf(refreshTokenUrl) ===-1 &&config.url.indexOf(requestForexFunds)===-1 && token !== "") {
refreshToken(token)
}
}
} else {
// 在刷新之前需要先清空token
store.commit('SET_EXPIRE_TIME', '')
store.comiit("SET_TOKEN",'')
}
}
// Do something before request is sent
if (store.getters.token) {
config.headers['Authorization'] = store.getters.token // 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
}
return config
}, error => {
// Do something with request error
console.log("interceptor", error) // for debug
Promise.reject(error)
})
// respone interceptor
service.interceptors.response.use(
response => {
const res = response.data;
let currentLang = localStorage.getItem("lang") || "zh-CN"
let errMsg = errorCodeMap[currentLang][res.code]
if (res.code !== 200) {
Message({
message: errMsg ? errMsg : res.errmsg,
type: 'error',
duration: 1000
});
if (res.errcode === 40001) {
router.push("/login")
}
return Promise.reject(res);
} else {
return res;
}
},
error => {
console.log('请求失败:' , error)// for debug
if(error.response.status === 429){
Message({
message: "请求太频繁,请稍后再试!",
type: 'error',
duration: 1 * 1000
})
}
return Promise.reject(error)
})
function getExpireTime() {
let data = store.getters.expireTime
return (data) ? JSON.parse(data) : null;
}
function refreshToken(token) {
commonApi.refreshToken(token).then(res => {
let data = res.data;
let expireTime = JSON.stringify({
updateTime: +new Date(),
// expire:5*1000
expire: data.expire * 1000
});
store.commit('SET_EXPIRE_TIME', expireTime)
store.commit('SET_TOKEN', data.access_token)
})
}
export default service

96
src/api/trade.js Normal file
View File

@@ -0,0 +1,96 @@
import request from './request'
export const tradeApi = {
// 未完成委托
serverGetEntrustOrderList(current, size, symbol, token) {
return request({
url: `/exchange/entrustOrders/${symbol}`,
method: 'get',
headers: {
'Authorization': token,
},
params:{
current: current ,
size: size
}
})
},
// 历史委托订单
serverGetTurnoverOrderList(current, size, symbol, token) {
return request({
url: `/exchange/entrustOrders/history/${symbol}`,
method: 'get',
headers: {
'Authorization': token,
},
params:{
current: current ,
size: size
}
})
},
// 币币交易 委托下单
serverCreateOrder(price, symbol, type, volume, token) {
let data = {
price,
symbol,
type,
volume,
};
return request({
url: '/exchange/entrustOrders',
method: 'post',
headers: {
'Authorization': token,
},
data,
})
},
//撤销委托
serverCancelOrder(orderId, token) {
return request({
url: `/exchange/entrustOrders/${orderId}`,
method: 'delete',
headers: {
'Authorization': token,
},
})
},
//获取当前用户当前市场 可交易额度
getUserAccount(symbol, token) {
return request({
url: '/finance/account/asset/' + symbol,
method: 'get',
headers: {
'Authorization': token,
},
})
},
//个人收藏交易市场信息
serverFavorite(token) {
return request({
url: '/exchange/tradeAreas/market/favorite',
method: 'get',
headers: {
'Authorization': token,
},
})
},
//获取深度数据
getDepth(symbol,mergeType) {
return request({
url: `/exchange/markets/depth/${symbol}/${mergeType}`,
method: 'get',
})
},
// 获取最新成交列表
getTrades(symbol) {
return request({
url: `/exchange/markets/trades/${symbol}`,
method: 'get',
})
}
}

13
src/api/uploadApi.js Normal file
View File

@@ -0,0 +1,13 @@
import request from './request'
export const uploadApi = {
aliyunUrl: process.env.BASE_API + "/v2/s/image/AliYunImgUpload",
normalUrl: process.env.BASE_API + "/v2/s/image/commonImgUpload",
aliyunFileUrl:'https://coin-exchange-imgs.oss-cn-beijing.aliyuncs.com/',
getPreUpload() {
return request({
url: `/admin/image/pre/upload`,
method: 'get'
})
}
};

234
src/api/usercenter.js Normal file
View File

@@ -0,0 +1,234 @@
import request from "./request";
import md5 from 'js-md5';
import axios from "axios"
/*
* 用户中心
*/
//修改绑定手机
export function serverBindMobile(countryCode, newMobilePhone, validateCode,oldValidateCode) {
const url = '/user/users/updatePhone';
let data = {
countryCode,
newMobilePhone,
validateCode,
oldValidateCode,
};
return request({
url : url,
method : 'post',
data,
})
}
//修改绑定邮箱
export function updateEmail(oldEmail, newEmail, validateCode) {
const url = '/user/users/updateEmail';
let data = {
oldEmail,
newEmail,
validateCode
};
return request({
url : url,
method : 'post',
data,
})
}
//验证老手机
export function verifyOldPhone(oldPhone, newPhone, validateCode) {
const url = '/user/verify/old/phone';
let data = {
oldPhone,
newPhone,
validateCode
};
return request({
url : url,
method : 'post',
data,
})
}
//验证老邮箱
export function verifyOldEmail(oldEmail, newEmail, validateCode) {
const url = '/user/verify/old/email';
let data = {
oldEmail,
newEmail,
validateCode
};
return request({
url : url,
method : 'post',
data,
})
}
export function getchilds (token) {
return request({
url : '/user/users/invites',
method: 'get',
headers:{
'Authorization': token,
},
})
}
//修改登录密码
export function updateUserPassword(data, token,countryCode) {
data.oldpassword = md5(data.oldpassword);
data.newpassword = md5(data.newpassword);
return request({
url : '/user/users/updateLoginPassword',
method:'post',
headers:{
'Authorization': token,
},
data,
})
}
//修改交易密码
export function updatePayPassword(data, token) {
data.oldpassword = md5(data.oldpassword);
data.newpassword = md5(data.newpassword);
return request({
url : '/user/users/updatePayPassword',
method:'post',
headers:{
'Authorization': token,
},
data,
})
}
//实名认证
export function setAuth(data, token) {
return request({
url : '/user/users/authAccount',
method : 'post',
headers:{
'Authorization': token,
},
data,
})
}
//高级认证
export function seniorAuth(data, token) {
return request({
url : '/user/users/authUser',
method : 'post',
headers:{
'Authorization': token,
},
data,
})
}
export function setUserBaseInfo(email, payPassword, username, token) {
let data = {
email,
payPassword : md5(payPassword),
username
};
return request({
url : '/user/user/userBase',
method : 'post',
headers:{
'Authorization': token,
},
data,
})
}
export function setPayPassword(data, token) {
data.payPassword = md5(data.payPassword);
return request({
url : '/user/users/setPayPassword',
method : 'post',
headers:{
'Authorization': token,
},
data,
})
}
// 添加自选
export function serverAddFavorite(symbol, type, token) {
let data = {
symbol,
type
};
return request({
url : '/exchange/userFavorites/addFavorite',
method: 'post',
headers:{
'Authorization': token,
},
data,
})
}
export function serverDeleteFavorite(symbol, type, token) {
return request({
url : '/exchange/userFavorites/'+ symbol,
method: 'delete',
headers:{
'Authorization': token,
},
})
}
export function gaGenerate(token) {
return request({
url : '/user/user/ga/generate',
method: 'get',
headers:{
'Authorization': token,
}
})
}
export function gaVerify(code,secret,token) {
return request({
url : '/user/user/ga/verify',
method: 'post',
headers:{
'Authorization': token,
},
data:{code,secret}
})
}
// 关闭google 验证
export function closeGaVerify(code) {
return request({
url : '/user/user/ga/cancel',
method: 'post',
data:{code}
})
}
/**
* 创建矿池
*/
export function createPool(data) {
return request({
url: '/v2/s/mine/pool',
method: 'post',
data,
})
}
/**
* 矿池列表
*/
export function minePool() {
return request({
url: '/v2/s/mine/pool',
method: 'get',
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
/**
* Created by zhouqt on 2018/4/14.
*/
export const rawData2 = [['2015/12/31','3570.47','3539.18','-33.69','-0.94%','3538.35','3580.6','176963664','25403106','-'],['2015/12/30','3566.73','3572.88','9.14','0.26%','3538.11','3573.68','187889600','26778766','-'],['2015/12/29','3528.4','3563.74','29.96','0.85%','3515.52','3564.17','182551920','25093890','-'],['2015/12/28','3635.77','3533.78','-94.13','-2.59%','3533.78','3641.59','269983264','36904280','-'],['2015/12/25','3614.05','3627.91','15.43','0.43%','3601.74','3635.26','198451120','27466004','-'],['2015/12/24','3631.31','3612.49','-23.6','-0.65%','3572.28','3640.22','227785216','31542126','-'],['2015/12/23','3653.28','3636.09','-15.68','-0.43%','3633.03','3684.57','298201792','41990292','-'],['2015/12/22','3645.99','3651.77','9.3','0.26%','3616.87','3652.63','261178752','36084604','-'],['2015/12/21','3568.58','3642.47','63.51','1.77%','3565.75','3651.06','299849280','39831696','-'],['2015/12/18','3574.94','3578.96','-1.03','-0.03%','3568.16','3614.7','273707904','36538580','-'],['2015/12/17','3533.63','3580','63.81','1.81%','3533.63','3583.41','283856480','38143960','-'],['2015/12/16','3522.09','3516.19','5.83','0.17%','3506.29','3538.69','193482304','26528864','-'],['2015/12/15','3518.13','3510.35','-10.31','-0.29%','3496.85','3529.96','200471344','27627494','-'],['2015/12/14','3403.51','3520.67','86.09','2.51%','3399.28','3521.78','215374624','27921354','-'],['2015/12/11','3441.6','3434.58','-20.91','-0.61%','3410.92','3455.55','182908880','24507642','-']].reverse();

View File

@@ -0,0 +1,12 @@
/**
* Created by zhouqt on 2018/4/14.
*/
export const rawData3 = [[1524033690000,'3570.47','3539.18','3539.18','3539.18'],[1524033590000,'3570.47','3539.18','3539.18','3539.18'],
[1524033440000,'3570.47','3539.18','3539.18','3539.18'],
[1524033340000,'3570.47','3539.18','3539.18','3539.18'],
[1524033240000,'3570.47','3539.18','3539.18','3539.18'],
[1524033140000,'3570.47','3539.18','3539.18','3539.18'],
];

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/exchange/up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/header/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
src/assets/help/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

BIN
src/assets/help/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
src/assets/help/11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
src/assets/help/12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
src/assets/help/13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
src/assets/help/14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
src/assets/help/15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

BIN
src/assets/help/16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

BIN
src/assets/help/17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
src/assets/help/18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
src/assets/help/19.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
src/assets/help/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
src/assets/help/20.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
src/assets/help/21.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/assets/help/22.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/assets/help/23.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/assets/help/24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
src/assets/help/25.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
src/assets/help/26.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
src/assets/help/27.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
src/assets/help/28.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

BIN
src/assets/help/29.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
src/assets/help/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
src/assets/help/30.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
src/assets/help/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

BIN
src/assets/help/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

BIN
src/assets/help/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
src/assets/help/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
src/assets/help/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
src/assets/help/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
src/assets/help/tab-1-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

BIN
src/assets/help/tab-1-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 KiB

BIN
src/assets/help/tab-1-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 KiB

BIN
src/assets/help/tab-1-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

BIN
src/assets/help/tab-1-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
src/assets/help/tab-1-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
src/assets/help/tab-2-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

BIN
src/assets/help/tab-2-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

BIN
src/assets/help/tab-2-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

BIN
src/assets/help/tab-2-4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

BIN
src/assets/help/tab-2-5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

BIN
src/assets/help/tab-2-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
src/assets/home/BFWlogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/assets/home/BTC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
src/assets/home/EOS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
src/assets/home/ETH.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
src/assets/home/IOS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 B

BIN
src/assets/home/android.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
src/assets/home/b-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/assets/home/bi-xin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/assets/home/ios-i.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
src/assets/home/light-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/assets/home/light-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/assets/home/light-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
src/assets/home/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
src/assets/home/logon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/assets/home/prodect.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

BIN
src/assets/home/windows.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

BIN
src/assets/login/code.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

BIN
src/assets/login/email.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Some files were not shown because too many files have changed in this diff Show More