diff --git a/README.md b/README.md index 5bf77bc..93d19cd 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ - 自动买入并自动挂止盈止损单 ![合约通知](./img/feature_notice.jpg) + +#### 行情监听 +TODO + ### 使用注意事项 - 网络必须处于大陆之外(因为币安接口大陆正常无法访问) - 申请api_key地址: [币安API管理页面](https://www.binance.com/cn/usercenter/settings/api-management) @@ -171,7 +175,8 @@ bee pack -be GOOS=windows - [X] 添加独立的币种配置收益率 - [X] 添加一键修改所有币种的配置 - [X] 系统首页显示(那些服务开启和关闭) -- [ ] 添加新的交易策略 -- [ ] 添加定时自动交易(吃资金费用) -- [ ] 监听币种在3分钟之内变化幅度大于(2%),报警通知 -- [ ] 学习蜡烛图结合其它数据,报警通知 \ No newline at end of file +- [ ] 添加新的自动交易策略 +- [ ] 添加定时自动交易(现货买入和一倍合约等价格对冲,吃资金费用) +- [ ] 监听币种的价格突变情况,报警通知 +- [ ] 学习蜡烛图结合其它数据,报警通知 +- [ ] 监控资金流入流出,报警通知 \ No newline at end of file diff --git a/conf/app.conf.example b/conf/app.conf.example index 06f2c15..c3b15f8 100644 --- a/conf/app.conf.example +++ b/conf/app.conf.example @@ -47,6 +47,10 @@ new_enable = 0 # 设定的价格提醒币种 enable = 0 +[listen_coin] +# 监听的币种 +enable = 0 + [web] # 监听端口 port = 3333 diff --git a/controllers/index.go b/controllers/index.go index 3f469fb..f7f0952 100644 --- a/controllers/index.go +++ b/controllers/index.go @@ -27,6 +27,8 @@ func (ctrl *IndexController) GetServiceConfig() { var noticeCoinEnable, _ = config.String("notice_coin::enable") + var listenCoinEnable, _ = config.String("listen_coin::enable") + ctrl.Ctx.Resp(map[string]interface{} { "code": 200, "data": map[string]interface{} { @@ -46,6 +48,8 @@ func (ctrl *IndexController) GetServiceConfig() { "spotNewEnable": spotNewEnable, "noticeCoinEnable": noticeCoinEnable, + + "listenCoinEnable": listenCoinEnable, }, "msg": "success", }) diff --git a/controllers/listenCoin.go b/controllers/listenCoin.go new file mode 100644 index 0000000..41b8b09 --- /dev/null +++ b/controllers/listenCoin.go @@ -0,0 +1,116 @@ +package controllers + +import ( + "strconv" + + "go_binance_futures/models" + "go_binance_futures/utils" + + "github.com/beego/beego/v2/client/orm" + "github.com/beego/beego/v2/server/web" +) + +type ListenCoinController struct { + web.Controller +} + +func (ctrl *ListenCoinController) Get() { + paramsType := ctrl.GetString("type", "") + + o := orm.NewOrm() + var symbols []models.ListenSymbols + query := o.QueryTable("listen_symbols") + if paramsType != "" { + query = query.Filter("Type", paramsType) + } + _, err := query.OrderBy("ID").All(&symbols) + if err != nil { + ctrl.Ctx.Resp(utils.ResJson(400, nil, err.Error())) + } + + ctrl.Ctx.Resp(map[string]interface{} { + "code": 200, + "data": symbols, + "msg": "success", + }) +} + +func (ctrl *ListenCoinController) Edit() { + id := ctrl.Ctx.Input.Param(":id") + var symbols models.ListenSymbols + o := orm.NewOrm() + o.QueryTable("listen_symbols").Filter("Id", id).One(&symbols) + + ctrl.BindJSON(&symbols) + + _, err := o.Update(&symbols) // _ 是受影响的条数 + if err != nil { + // 处理错误 + ctrl.Ctx.Resp(utils.ResJson(400, nil, "修改失败")) + return + } + ctrl.Ctx.Resp(map[string]interface{} { + "code": 200, + "data": symbols, + "msg": "success", + }) +} + +func (ctrl *ListenCoinController) Delete() { + id := ctrl.Ctx.Input.Param(":id") + symbols := new(models.ListenSymbols) + intId, _ := strconv.ParseInt(id, 10, 64) + symbols.ID = intId + o := orm.NewOrm() + + _, err := o.Delete(symbols) + if err != nil { + // 处理错误 + ctrl.Ctx.Resp(utils.ResJson(400, nil, "删除错误")) + return + } + ctrl.Ctx.Resp(map[string]interface{} { + "code": 200, + "msg": "success", + }) +} + +func (ctrl *ListenCoinController) Post() { + symbols := new(models.ListenSymbols) + ctrl.BindJSON(&symbols) + + symbols.Enable = 0 // 默认不开启 + symbols.KlineInterval = "1m" // 默认k线周期 + symbols.ChangePercent = "1.1" // 1.1% 默认变化幅度 + symbols.LastNoticeTime = 0 // 最后一次通知时间 + symbols.NoticeLimitMin = 5 // 最小通知间隔 + + o := orm.NewOrm() + id, err := o.Insert(symbols) + + if err != nil { + // 处理错误 + ctrl.Ctx.Resp(utils.ResJson(400, nil, "新增失败")) + return + } + symbols.ID = id + + ctrl.Ctx.Resp(map[string]interface{} { + "code": 200, + "data": symbols, + "msg": "success", + }) +} + +func (ctrl *ListenCoinController) UpdateEnable() { + flag := ctrl.Ctx.Input.Param(":flag") + + o := orm.NewOrm() + _, err := o.Raw("UPDATE listen_symbols SET enable = ?", flag).Exec() + if err != nil { + // 处理错误 + ctrl.Ctx.Resp(utils.ResJson(400, nil, "更新错误")) + return + } + ctrl.Ctx.Resp(utils.ResJson(200, nil)) +} \ No newline at end of file diff --git a/controllers/noticeCoin.go b/controllers/noticeCoin.go index 782b41b..785d1c5 100644 --- a/controllers/noticeCoin.go +++ b/controllers/noticeCoin.go @@ -132,7 +132,7 @@ func (ctrl *NoticeCoinController) UpdateEnable() { flag := ctrl.Ctx.Input.Param(":flag") o := orm.NewOrm() - _, err := o.Raw("UPDATE newSymbols SET enable = ?", flag).Exec() + _, err := o.Raw("UPDATE notice_symbols SET enable = ?", flag).Exec() if err != nil { // 处理错误 ctrl.Ctx.Resp(utils.ResJson(400, nil, "更新错误")) diff --git a/db/coin.db b/db/coin.db index bbda700..c784482 100644 Binary files a/db/coin.db and b/db/coin.db differ diff --git a/feature/feature_listen.go b/feature/feature_listen.go new file mode 100644 index 0000000..9012ba6 --- /dev/null +++ b/feature/feature_listen.go @@ -0,0 +1,53 @@ +package feature + +import ( + "go_binance_futures/feature/api/binance" + "go_binance_futures/feature/notify" + "go_binance_futures/models" + "strconv" + + "github.com/beego/beego/v2/client/orm" + "github.com/beego/beego/v2/core/logs" +) + +func ListenCoin() { + o := orm.NewOrm() + var coins []models.ListenSymbols + o.QueryTable("listen_symbols").OrderBy("ID").Filter("enable", 1).Filter("type", 2).All(&coins) // 通知币列表 + + for _, coin := range coins { + logs.Info("监听合约币种:", coin.Symbol) + kline_1, err1 := binance.GetKlineData(coin.Symbol, coin.KlineInterval, 10) + if err1 != nil { + logs.Error("k线错误, 合约币种是:", coin.Symbol) + continue + } + + percentLimit, _ := strconv.ParseFloat(coin.ChangePercent, 64) + percentLimit = percentLimit / 100 // 变化幅度 + + lastOpenPrice, _ := strconv.ParseFloat(kline_1[1].Open, 64) // 上一根 k 线的开盘价 + nowPrice, _ := strconv.ParseFloat(kline_1[0].Close, 64) // 当前价格 + + if (nowPrice > lastOpenPrice) && + (nowPrice - lastOpenPrice) / lastOpenPrice >= percentLimit && + ((kline_1[0].CloseTime - coin.LastNoticeTime >= 60 * 1000 * coin.NoticeLimitMin && coin.LastNoticeType == "up") || coin.LastNoticeType != "up") { + // 价格上涨 + coin.LastNoticeTime = kline_1[0].CloseTime + coin.LastNoticeType = "up" + orm.NewOrm().Update(&coin) + + notify.ListenFutureCoin(coin.Symbol, "极速上涨", (nowPrice - lastOpenPrice) / lastOpenPrice) + } + if (nowPrice < lastOpenPrice) && + (lastOpenPrice - nowPrice) / lastOpenPrice >= percentLimit && + ((kline_1[0].CloseTime - coin.LastNoticeTime >= 60 * 1000 * coin.NoticeLimitMin && coin.LastNoticeType == "down") || coin.LastNoticeType != "down") { + // 价格下跌 + coin.LastNoticeTime = kline_1[0].CloseTime + coin.LastNoticeType = "down" + orm.NewOrm().Update(&coin) + + notify.ListenFutureCoin(coin.Symbol, "极速下跌", (lastOpenPrice - nowPrice) / lastOpenPrice) + } + } +} diff --git a/feature/notify/dingding.go b/feature/notify/dingding.go index 71558d8..61b77bb 100644 --- a/feature/notify/dingding.go +++ b/feature/notify/dingding.go @@ -149,4 +149,16 @@ func NoticeFutureCoin(symbol string, side string, price string, autoOrder string > author ` DingDing(fmt.Sprintf(text, symbol, symbol, side, price, autoOrder, time.Now().Format("2006-01-02 15:04:05"))) +} + +func ListenFutureCoin(symbol string, listenType string, percent float64) { + text := ` +## %s合约k线监控通知 +#### **币种**:%s +#### **类型**:%s +#### **当前变化率**:%f +#### **时间**:%s + +> author ` + DingDing(fmt.Sprintf(text, symbol, symbol, listenType, percent, time.Now().Format("2006-01-02 15:04:05"))) } \ No newline at end of file diff --git a/main.go b/main.go index 9304c6f..55afc53 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,7 @@ var tradeEnable, _ = config.String("trade::future_enable") var tradeNewEnable, _ = config.String("trade::new_enable") var spotNewEnable, _ = config.String("spot::new_enable") var noticeCoinEnable, _ = config.String("notice_coin::enable") +var listenCoinEnable, _ = config.String("listen_coin::enable") var taskSleepTimeInt, _ = strconv.Atoi(taskSleepTime) func init() { @@ -42,6 +43,7 @@ func registerModels() { orm.RegisterModel(new(models.Symbols)) orm.RegisterModel(new(models.NewSymbols)) orm.RegisterModel(new(models.NoticeSymbols)) + orm.RegisterModel(new(models.ListenSymbols)) orm.RegisterDriver("sqlite3", orm.DRSqlite) orm.RegisterDataBase("default", "sqlite3", "./db/coin.db") @@ -130,6 +132,19 @@ func main() { }() } + if listenCoinEnable == "1" { + logs.Info("行情监听通知开启") + go func() { + for { + spot.ListenCoin() + feature.ListenCoin() + + // 等待 taskSleepTimeInt 秒再继续执行 + time.Sleep(time.Millisecond * 500) + } + }() + } + // web web.Run(":" + webPort) } diff --git a/models/tableStruct.go b/models/tableStruct.go index 522c0e6..1e249fa 100644 --- a/models/tableStruct.go +++ b/models/tableStruct.go @@ -79,6 +79,20 @@ type NoticeSymbols struct { UpdateTime int64 `orm:"column(updateTime)" json:"updateTime"` } +type ListenSymbols struct { + ID int64 `orm:"column(id)" json:"id"` + Symbol string `orm:"column(symbol)" json:"symbol"` + Enable int `orm:"column(enable)" json:"enable"` // 是否开启 + Type int64 `orm:"column(type)" json:"type"` // 1:币币交易 2:合约交易 + KlineInterval string `orm:"column(kline_interval)" json:"kline_interval"` // 选定的k线周期 + ChangePercent string `orm:"column(change_percent)" json:"change_percent"` // 通知的变化百分比阈值 + LastNoticeTime int64 `orm:"column(last_notice_time)" json:"last_notice_time"` // 上一次通知的时间 + LastNoticeType string `orm:"column(last_notice_type)" json:"last_notice_type"` // 上一次通知的类型(up/down) + NoticeLimitMin int64 `orm:"column(notice_limit_min)" json:"notice_limit_min"` // 通知频率限制(分钟) + CreateTime int64 `orm:"column(createTime)" json:"createTime"` + UpdateTime int64 `orm:"column(updateTime)" json:"updateTime"` +} + func (u *Order) TableName() string { return "order" } @@ -94,3 +108,7 @@ func (u *NewSymbols) TableName() string { func (u *NoticeSymbols) TableName() string { return "notice_symbols" } + +func (u *ListenSymbols) TableName() string { + return "listen_symbols" +} diff --git a/routers/router.go b/routers/router.go index d955682..c9385c6 100644 --- a/routers/router.go +++ b/routers/router.go @@ -24,6 +24,10 @@ func init() { web.Router("/notice/coin/:id", &controllers.NoticeCoinController{}, "delete:Delete;put:Edit") // 更新和删除 web.Router("/notice/coin/enable/:flag", &controllers.NoticeCoinController{}, "put:UpdateEnable") // 修改所有的交易对开启关闭 + web.Router("/listen/coin", &controllers.ListenCoinController{}, "get:Get;post:Post") // 列表查询和新增 + web.Router("/listen/coin/:id", &controllers.ListenCoinController{}, "delete:Delete;put:Edit") // 更新和删除 + web.Router("/listen/coin/enable/:flag", &controllers.ListenCoinController{}, "put:UpdateEnable") // 修改所有的交易对开启关闭 + web.Router("/orders", &controllers.OrderController{}, "get:Get;delete:DeleteAll") // order list 和 删除所有 order web.Router("/config", &controllers.ConfigController{}, "get:Get;put:Edit") // config get and edit diff --git a/spot/api/binance/index.go b/spot/api/binance/index.go index efce421..97b5d4f 100644 --- a/spot/api/binance/index.go +++ b/spot/api/binance/index.go @@ -3,6 +3,7 @@ package binance import ( "context" "go_binance_futures/utils" + "sort" "strconv" "github.com/adshao/go-binance/v2" @@ -37,6 +38,23 @@ func GetExchangeInfo(symbols ...string)(res *binance.ExchangeInfo, err error) { return res, err } +// @param symbol 交易对名称,例如:BTCUSDT +// @param interval K线的时间间隔,例如:1m, 3m, 5m, 15m, 30m, 1h等 +// @param limit 返回的K线数据条数 +// @returns /doc/kine.js +func GetKlineData(symbol string, interval string, limit int) (klines []*binance.Kline, err error) { + klines, err = client.NewKlinesService().Symbol(symbol).Interval(interval).Limit(limit).Do(context.Background()) + if err != nil { + logs.Error(err) + return nil, err + } + sort.Slice(klines, func(i, j int) bool { + return klines[i].OpenTime > klines[j].OpenTime // 按照时间降序() + }) + // logs.Info(utils.ToJson(klines)) + return klines, err +} + // 获取交易价格 func GetTickerPrice(symbol string) (res []*binance.SymbolPrice, err error) { res, err = client.NewListPricesService().Symbol(symbol).Do(context.Background()) diff --git a/spot/notify/dingding.go b/spot/notify/dingding.go index 791bb44..01c6148 100644 --- a/spot/notify/dingding.go +++ b/spot/notify/dingding.go @@ -109,3 +109,14 @@ func NoticeSpotCoin(symbol string, side string, price string, autoOrder string) DingDing(fmt.Sprintf(text, symbol, symbol, side, price, autoOrder, time.Now().Format("2006-01-02 15:04:05"))) } +func ListenSpotCoin(symbol string, listenType string, percent float64) { + text := ` +## %s现货k线监控通知 +#### **币种**:%s +#### **类型**:%s +#### **当前变化率**:%f +#### **时间**:%s + +> author ` + DingDing(fmt.Sprintf(text, symbol, symbol, listenType, percent, time.Now().Format("2006-01-02 15:04:05"))) +} \ No newline at end of file diff --git a/spot/spot.go b/spot/spot.go index bfc6d27..9ccfec4 100644 --- a/spot/spot.go +++ b/spot/spot.go @@ -208,4 +208,46 @@ func trySellMarket(symbol string, quantity string, stepSize string) (res *spot_a notify.SellOrderSuccess(symbol, quantity_float64, res.Price) } return res, err +} + +func ListenCoin() { + o := orm.NewOrm() + var coins []models.ListenSymbols + o.QueryTable("listen_symbols").OrderBy("ID").Filter("enable", 1).Filter("type", 1).All(&coins) // 通知币列表 + + for _, coin := range coins { + logs.Info("监听现货币种:", coin.Symbol) + kline_1, err1 := binance.GetKlineData(coin.Symbol, coin.KlineInterval, 10) + if err1 != nil { + logs.Error("k线错误, 现货币种是:", coin.Symbol) + continue + } + + percentLimit, _ := strconv.ParseFloat(coin.ChangePercent, 64) + percentLimit = percentLimit / 100 // 变化幅度 + + lastOpenPrice, _ := strconv.ParseFloat(kline_1[1].Open, 64) // 上一根 k 线的开盘价 + nowPrice, _ := strconv.ParseFloat(kline_1[0].Close, 64) // 当前价格 + + if (nowPrice > lastOpenPrice) && + (nowPrice - lastOpenPrice) / lastOpenPrice >= percentLimit && + ((kline_1[0].CloseTime - coin.LastNoticeTime >= 60 * 1000 * coin.NoticeLimitMin && coin.LastNoticeType == "up") || coin.LastNoticeType != "up") { + // 价格上涨 + coin.LastNoticeTime = kline_1[0].CloseTime + coin.LastNoticeType = "up" + orm.NewOrm().Update(&coin) + + notify.ListenSpotCoin(coin.Symbol, "极速上涨", (nowPrice - lastOpenPrice) / lastOpenPrice) + } + if (nowPrice < lastOpenPrice) && + (lastOpenPrice - nowPrice) / lastOpenPrice >= percentLimit && + ((kline_1[0].CloseTime - coin.LastNoticeTime >= 60 * 1000 * coin.NoticeLimitMin && coin.LastNoticeType == "down") || coin.LastNoticeType != "down") { + // 价格下跌 + coin.LastNoticeTime = kline_1[0].CloseTime + coin.LastNoticeType = "down" + orm.NewOrm().Update(&coin) + + notify.ListenSpotCoin(coin.Symbol, "极速下跌", (lastOpenPrice - nowPrice) / lastOpenPrice) + } + } } \ No newline at end of file diff --git a/static/css/chunk-005c2717.ba12ce9c.css b/static/css/chunk-005c2717.ba12ce9c.css new file mode 100644 index 0000000..078ef73 --- /dev/null +++ b/static/css/chunk-005c2717.ba12ce9c.css @@ -0,0 +1 @@ +.dashboard-container[data-v-2698e298]{margin:30px}.dashboard-text[data-v-2698e298]{font-size:30px;line-height:46px}.red[data-v-2698e298]{color:red}.green[data-v-2698e298]{color:green} \ No newline at end of file diff --git a/static/css/chunk-467a0df3.08a8cef4.css b/static/css/chunk-467a0df3.08a8cef4.css deleted file mode 100644 index 9bc3e26..0000000 --- a/static/css/chunk-467a0df3.08a8cef4.css +++ /dev/null @@ -1 +0,0 @@ -.dashboard-container[data-v-532243b1]{margin:30px}.dashboard-text[data-v-532243b1]{font-size:30px;line-height:46px}.red[data-v-532243b1]{color:red}.green[data-v-532243b1]{color:green} \ No newline at end of file diff --git a/static/index.html b/static/index.html index 062600f..4422cc2 100644 --- a/static/index.html +++ b/static/index.html @@ -1 +1 @@ -币安量化交易
\ No newline at end of file +币安量化交易
\ No newline at end of file diff --git a/static/js/app.52cfce12.js b/static/js/app.8cb44872.js similarity index 67% rename from static/js/app.52cfce12.js rename to static/js/app.8cb44872.js index 38c6ad0..a0ec523 100644 --- a/static/js/app.52cfce12.js +++ b/static/js/app.8cb44872.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"028b":function(e,t,n){"use strict";n("3f4d")},"186a":function(e,t,n){"use strict";n("9df4")},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"331a":function(e,t){var n={admin:{token:"admin-token"},editor:{token:"editor-token"}},a={"admin-token":{roles:["admin"],introduction:"I am a super administrator",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Super Admin"},"editor-token":{roles:["editor"],introduction:"I am an editor",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Normal Editor"}};e.exports=[{url:"/vue-admin-template/user/login",type:"post",response:function(e){var t=e.body.username,a=n[t];return a?{code:2e4,data:a}:{code:60204,message:"Account and password are incorrect."}}},{url:"/vue-admin-template/user/info.*",type:"get",response:function(e){var t=e.query.token,n=a[t];return n?{code:2e4,data:n}:{code:50008,message:"Login failed, unable to get user details."}}},{url:"/vue-admin-template/user/logout",type:"post",response:function(e){return{code:2e4,data:"success"}}}]},"34c8":function(e,t,n){"use strict";n("f30b")},"3f4d":function(e,t,n){},4360:function(e,t,n){"use strict";var a=n("2b0e"),i=n("2f62"),o=(n("b0c0"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name}}),r=o,s=n("a78e"),c=n.n(s),u={sidebar:{opened:!c.a.get("sidebarStatus")||!!+c.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},l={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?c.a.set("sidebarStatus",1):c.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){c.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},d={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)}},m={namespaced:!0,state:u,mutations:l,actions:d},f=n("83d6"),p=n.n(f),h=p.a.showSettings,b=p.a.fixedHeader,v=p.a.sidebarLogo,g={showSettings:h,fixedHeader:b,sidebarLogo:v},w={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},x={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},y={namespaced:!0,state:g,mutations:w,actions:x},k=(n("d3b7"),n("498a"),n("b775"));function C(e){return Object(k["a"])({url:"/login",method:"post",data:e})}function O(e){return Object(k["a"])({url:"/vue-admin-template/user/info",method:"get",params:{token:e}})}function _(){return Object(k["a"])({url:"/vue-admin-template/user/logout",method:"post"})}var S=n("5f87"),E=n("a18c"),z=function(){return{token:Object(S["a"])(),name:"",avatar:""}},H=z(),T={RESET_STATE:function(e){Object.assign(e,z())},SET_TOKEN:function(e,t){e.token=t},SET_NAME:function(e,t){e.name=t},SET_AVATAR:function(e,t){e.avatar=t}},M={login:function(e,t){var n=e.commit,a=t.username,i=t.password;return new Promise((function(e,t){C({username:a.trim(),password:i}).then((function(t){var a=t.data;n("SET_TOKEN",a.token),Object(S["c"])(a.token),e()})).catch((function(e){console.log(e),t(e)}))}))},getInfo:function(e){var t=e.commit,n=e.state;return new Promise((function(e,a){O(n.token).then((function(n){var i=n.data;if(!i)return a("Verification failed, please Login again.");var o=i.name,r=i.avatar;t("SET_NAME",o),t("SET_AVATAR",r),e(i)})).catch((function(e){a(e)}))}))},logout:function(e){var t=e.commit,n=e.state;return new Promise((function(e,a){_(n.token).then((function(){Object(S["b"])(),Object(E["b"])(),t("RESET_STATE"),e()})).catch((function(e){a(e)}))}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){Object(S["b"])(),t("RESET_STATE"),e()}))}},B={namespaced:!0,state:H,mutations:T,actions:M};a["default"].use(i["a"]);var j=new i["a"].Store({modules:{app:m,settings:y,user:B},getters:r});t["a"]=j},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},"4b0f":function(e,t,n){var a=n("6374").default,i=n("448a").default;n("99af"),n("4d63"),n("ac1f"),n("25f0");var o=n("96eb"),r=n("8a60"),s=r.param2Obj,c=n("331a"),u=n("a0bc"),l=[].concat(i(c),i(u));function d(){function e(e){return function(t){var n=null;if(e instanceof Function){var a=t.body,i=t.type,r=t.url;n=e({method:i,body:JSON.parse(a),query:s(r)})}else n=e;return o.mock(n)}}o.XHR.prototype.proxy_send=o.XHR.prototype.send,o.XHR.prototype.send=function(){this.custom.xhr&&(this.custom.xhr.withCredentials=this.withCredentials||!1,this.responseType&&(this.custom.xhr.responseType=this.responseType)),this.proxy_send.apply(this,arguments)};var t,n=a(l);try{for(n.s();!(t=n.n()).done;){var i=t.value;o.mock(new RegExp(i.url),i.type||"get",e(i.response))}}catch(r){n.e(r)}finally{n.f()}}e.exports={mocks:l,mockXHR:d}},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(s);t["default"]=s},"51ff":function(e,t,n){var a={"./dashboard.svg":"f782","./example.svg":"30c3","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./link.svg":"18f0","./nested.svg":"dcf8","./password.svg":"2a3d","./table.svg":"47f1","./tree.svg":"93cd","./user.svg":"b3b5"};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},"56d7":function(e,t,n){"use strict";n.r(t);n("e623"),n("e379"),n("5dc8"),n("37e1");var a=n("2b0e"),i=(n("f5df1"),n("5c96")),o=n.n(i),r=(n("0fae"),n("f0d9")),s=n.n(r),c=(n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),u=[],l={name:"App"},d=l,m=n("2877"),f=Object(m["a"])(d,c,u,!1,null,null,null),p=f.exports,h=n("4360"),b=n("a18c"),v=(n("d81d"),n("d3b7"),n("ddb0"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{"xlink:href":e.iconName}})])}),g=[],w=n("61f7"),x={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(w["a"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},y=x,k=(n("68fa"),Object(m["a"])(y,v,g,!1,null,"f9f7fefc",null)),C=k.exports;a["default"].component("svg-icon",C);var O=n("51ff"),_=function(e){return e.keys().map(e)};_(O);var S=n("1da1"),E=(n("96cf"),n("323e")),z=n.n(E),H=(n("a5d8"),n("5f87")),T=(n("99af"),n("83d6")),M=n.n(T),B=M.a.title||"Vue Admin Template";function j(e){return e?"".concat(e," - ").concat(B):"".concat(B)}z.a.configure({showSpinner:!1});var A=["/login"];b["a"].beforeEach(function(){var e=Object(S["a"])(regeneratorRuntime.mark((function e(t,n,a){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:z.a.start(),document.title=j(t.meta.title),i=Object(H["a"])(),i?"/login"===t.path?(a({path:"/"}),z.a.done()):a():-1!==A.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),z.a.done());case 4:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}()),b["a"].afterEach((function(){z.a.done()}));var L=n("4b0f"),V=L.mockXHR;V(),a["default"].use(o.a,{locale:s.a}),a["default"].config.productionTip=!1,new a["default"]({el:"#app",router:b["a"],store:h["a"],render:function(e){return e(p)}})},"5f87":function(e,t,n){"use strict";function a(){return localStorage.getItem("_token")}function i(e){localStorage.setItem("_token",e)}function o(){localStorage.setItem("_token","")}n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}))},"605c":function(e,t,n){},"61f7":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));n("498a");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}function i(e){var t=["admin","editor"];return t.indexOf(e.trim())>=0}},"68fa":function(e,t,n){"use strict";n("eae4")},"6b31":function(e,t,n){"use strict";n("d346")},"709d":function(e,t,n){},"83d6":function(e,t){e.exports={title:"币安量化交易",fixedHeader:!1,sidebarLogo:!1}},"8a60":function(e,t,n){function a(e){var t=decodeURIComponent(e.split("?")[1]).replace(/\+/g," ");if(!t)return{};var n={},a=t.split("&");return a.forEach((function(e){var t=e.indexOf("=");if(-1!==t){var a=e.substring(0,t),i=e.substring(t+1,e.length);n[a]=i}})),n}n("ac1f"),n("5319"),n("1276"),n("159b"),e.exports={param2Obj:a}},"93cd":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-tree",use:"icon-tree-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},9874:function(e,t,n){},"9df4":function(e,t,n){},"9f2b":function(e,t,n){"use strict";n("709d")},a0bc:function(e,t,n){var a=n("96eb"),i=a.mock({"items|30":[{id:"@id",title:"@sentence(10, 20)","status|1":["published","draft","deleted"],author:"name",display_time:"@datetime",pageviews:"@integer(300, 5000)"}]});e.exports=[{url:"/vue-admin-template/table/list",type:"get",response:function(e){var t=i.items;return{code:2e4,data:{total:t.length,items:t}}}}]},a18c:function(e,t,n){"use strict";n.d(t,"b",(function(){return Be}));n("d3b7"),n("3ca3"),n("ddb0");var a,i,o=n("2b0e"),r=n("8c4f"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),n("sidebar",{staticClass:"sidebar-container"}),n("div",{staticClass:"main-container"},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar")],1),n("app-main")],1)],1)},c=[],u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"navbar"},[n("hamburger",{staticClass:"hamburger-container",attrs:{"is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),n("breadcrumb",{staticClass:"breadcrumb-container"}),n("div",{staticClass:"right-menu"},[n("el-dropdown",{staticClass:"avatar-container",attrs:{trigger:"click"}},[n("div",{staticClass:"avatar-wrapper"},[n("img",{staticClass:"user-avatar",attrs:{src:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80"}}),n("i",{staticClass:"el-icon-caret-bottom"})]),n("el-dropdown-menu",{staticClass:"user-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.logout(t)}}},[n("span",{staticStyle:{display:"block"}},[e._v("登出")])])],1)],1)],1)],1)},l=[],d=n("1da1"),m=n("5530"),f=(n("96cf"),n("2f62")),p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,(function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])})),1)],1)},h=[],b=(n("4de4"),n("99af"),n("b0c0"),n("498a"),n("bd11")),v=n.n(b),g={data:function(){return{levelList:null}},watch:{$route:function(){this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter((function(e){return e.meta&&e.meta.title})),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter((function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb}))},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=v.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},w=g,x=(n("34c8"),n("2877")),y=Object(x["a"])(w,p,h,!1,null,"62cc9144",null),k=y.exports,C=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},O=[],_={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},S=_,E=(n("186a"),Object(x["a"])(S,C,O,!1,null,"49e15297",null)),z=E.exports,H=n("5f87"),T={components:{Breadcrumb:k,Hamburger:z},computed:Object(m["a"])({},Object(f["b"])(["sidebar","avatar"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=this;return Object(d["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:Object(H["b"])(),e.$router.push("/login?redirect=".concat(e.$route.fullPath));case 2:case"end":return t.stop()}}),t)})))()}}},M=T,B=(n("c293"),Object(x["a"])(M,u,l,!1,null,"d7871576",null)),j=B.exports,A=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.routes,(function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})})),1)],1)],1)},L=[],V=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])])],1)],1)},$=[],I={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"Vue Admin Template",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},P=I,R=(n("6b31"),Object(x["a"])(P,V,$,!1,null,"5bb1c0e2",null)),N=R.exports,D=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._l(e.item.children,(function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})}))],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},q=[],G=n("df7c"),U=n.n(G),X=n("61f7"),F=(n("caad6"),n("2532"),{name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&(a.includes("el-icon")?o.push(e("i",{class:[a,"sub-el-icon"]})):o.push(e("svg-icon",{attrs:{"icon-class":a}}))),i&&o.push(e("span",{slot:"title"},[i])),o}}),J=F,K=(n("bf4f"),Object(x["a"])(J,a,i,!1,null,"18eeea00",null)),W=K.exports,Q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(e.type,e._b({tag:"component"},"component",e.linkProps(e.to),!1),[e._t("default")],2)},Y=[],Z={props:{to:{type:String,required:!0}},computed:{isExternal:function(){return Object(X["a"])(this.to)},type:function(){return this.isExternal?"a":"router-link"}},methods:{linkProps:function(e){return this.isExternal?{href:e,target:"_blank",rel:"noopener"}:{to:e}}}},ee=Z,te=Object(x["a"])(ee,Q,Y,!1,null,null,null),ne=te.exports,ae={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},ie={name:"SidebarItem",components:{Item:W,AppLink:ne},mixins:[ae],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter((function(t){return!t.hidden&&(e.onlyOneChild=t,!0)}));return 1===a.length||0===a.length&&(this.onlyOneChild=Object(m["a"])(Object(m["a"])({},n),{},{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(X["a"])(e)?e:Object(X["a"])(this.basePath)?this.basePath:U.a.resolve(this.basePath,e)}}},oe=ie,re=Object(x["a"])(oe,D,q,!1,null,null,null),se=re.exports,ce=n("cf1e"),ue=n.n(ce),le={components:{SidebarItem:se,Logo:N},computed:Object(m["a"])(Object(m["a"])({},Object(f["b"])(["sidebar"])),{},{routes:function(){return this.$router.options.routes},activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return ue.a},isCollapse:function(){return!this.sidebar.opened}})},de=le,me=Object(x["a"])(de,A,L,!1,null,null,null),fe=me.exports,pe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("router-view",{key:e.key})],1)],1)},he=[],be={name:"AppMain",computed:{key:function(){return this.$route.path}}},ve=be,ge=(n("e4de"),n("028b"),Object(x["a"])(ve,pe,he,!1,null,"64cf4d83",null)),we=ge.exports,xe=n("4360"),ye=document,ke=ye.body,Ce=992,Oe={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&xe["a"].dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(xe["a"].dispatch("app/toggleDevice","mobile"),xe["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=ke.getBoundingClientRect();return e.width-1'});r.a.add(s);t["default"]=s},b775:function(e,t,n){"use strict";n("d3b7");var a=n("bc3a"),i=n.n(a),o=n("5c96"),r=n("4360"),s=n("5f87"),c=i.a.create({baseURL:"",timeout:5e3});c.interceptors.request.use((function(e){return r["a"].getters.token&&(e.headers["Authorization"]=Object(s["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),c.interceptors.response.use((function(e){var t=e.data;return 200!==t.code?(Object(o["Message"])({message:t.msg||"Error",type:"error",duration:5e3}),Promise.reject(new Error(t.msg||"Error"))):t}),(function(e){return console.log("err"+e),Object(o["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=c},bf4f:function(e,t,n){"use strict";n("9874")},c293:function(e,t,n){"use strict";n("605c")},c763:function(e,t,n){},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d346:function(e,t,n){},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(s);t["default"]=s},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},e4de:function(e,t,n){"use strict";n("c763")},eae4:function(e,t,n){},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(s);t["default"]=s},f30b:function(e,t,n){},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),s=new i.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 128 100",content:''});r.a.add(s);t["default"]=s}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"028b":function(e,t,n){"use strict";n("3f4d")},"186a":function(e,t,n){"use strict";n("9df4")},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},"331a":function(e,t){var n={admin:{token:"admin-token"},editor:{token:"editor-token"}},a={"admin-token":{roles:["admin"],introduction:"I am a super administrator",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Super Admin"},"editor-token":{roles:["editor"],introduction:"I am an editor",avatar:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",name:"Normal Editor"}};e.exports=[{url:"/vue-admin-template/user/login",type:"post",response:function(e){var t=e.body.username,a=n[t];return a?{code:2e4,data:a}:{code:60204,message:"Account and password are incorrect."}}},{url:"/vue-admin-template/user/info.*",type:"get",response:function(e){var t=e.query.token,n=a[t];return n?{code:2e4,data:n}:{code:50008,message:"Login failed, unable to get user details."}}},{url:"/vue-admin-template/user/logout",type:"post",response:function(e){return{code:2e4,data:"success"}}}]},"34c8":function(e,t,n){"use strict";n("f30b")},"3f4d":function(e,t,n){},4360:function(e,t,n){"use strict";var a=n("2b0e"),i=n("2f62"),o=(n("b0c0"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name}}),r=o,c=n("a78e"),s=n.n(c),u={sidebar:{opened:!s.a.get("sidebarStatus")||!!+s.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},l={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?s.a.set("sidebarStatus",1):s.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){s.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},d={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)}},m={namespaced:!0,state:u,mutations:l,actions:d},f=n("83d6"),p=n.n(f),h=p.a.showSettings,b=p.a.fixedHeader,v=p.a.sidebarLogo,g={showSettings:h,fixedHeader:b,sidebarLogo:v},w={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},x={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},y={namespaced:!0,state:g,mutations:w,actions:x},k=(n("d3b7"),n("498a"),n("b775"));function C(e){return Object(k["a"])({url:"/login",method:"post",data:e})}function O(e){return Object(k["a"])({url:"/vue-admin-template/user/info",method:"get",params:{token:e}})}function _(){return Object(k["a"])({url:"/vue-admin-template/user/logout",method:"post"})}var S=n("5f87"),E=n("a18c"),z=function(){return{token:Object(S["a"])(),name:"",avatar:""}},H=z(),T={RESET_STATE:function(e){Object.assign(e,z())},SET_TOKEN:function(e,t){e.token=t},SET_NAME:function(e,t){e.name=t},SET_AVATAR:function(e,t){e.avatar=t}},M={login:function(e,t){var n=e.commit,a=t.username,i=t.password;return new Promise((function(e,t){C({username:a.trim(),password:i}).then((function(t){var a=t.data;n("SET_TOKEN",a.token),Object(S["c"])(a.token),e()})).catch((function(e){console.log(e),t(e)}))}))},getInfo:function(e){var t=e.commit,n=e.state;return new Promise((function(e,a){O(n.token).then((function(n){var i=n.data;if(!i)return a("Verification failed, please Login again.");var o=i.name,r=i.avatar;t("SET_NAME",o),t("SET_AVATAR",r),e(i)})).catch((function(e){a(e)}))}))},logout:function(e){var t=e.commit,n=e.state;return new Promise((function(e,a){_(n.token).then((function(){Object(S["b"])(),Object(E["b"])(),t("RESET_STATE"),e()})).catch((function(e){a(e)}))}))},resetToken:function(e){var t=e.commit;return new Promise((function(e){Object(S["b"])(),t("RESET_STATE"),e()}))}},B={namespaced:!0,state:H,mutations:T,actions:M};a["default"].use(i["a"]);var j=new i["a"].Store({modules:{app:m,settings:y,user:B},getters:r});t["a"]=j},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},"4b0f":function(e,t,n){var a=n("6374").default,i=n("448a").default;n("99af"),n("4d63"),n("ac1f"),n("25f0");var o=n("96eb"),r=n("8a60"),c=r.param2Obj,s=n("331a"),u=n("a0bc"),l=[].concat(i(s),i(u));function d(){function e(e){return function(t){var n=null;if(e instanceof Function){var a=t.body,i=t.type,r=t.url;n=e({method:i,body:JSON.parse(a),query:c(r)})}else n=e;return o.mock(n)}}o.XHR.prototype.proxy_send=o.XHR.prototype.send,o.XHR.prototype.send=function(){this.custom.xhr&&(this.custom.xhr.withCredentials=this.withCredentials||!1,this.responseType&&(this.custom.xhr.responseType=this.responseType)),this.proxy_send.apply(this,arguments)};var t,n=a(l);try{for(n.s();!(t=n.n()).done;){var i=t.value;o.mock(new RegExp(i.url),i.type||"get",e(i.response))}}catch(r){n.e(r)}finally{n.f()}}e.exports={mocks:l,mockXHR:d}},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(c);t["default"]=c},"51ff":function(e,t,n){var a={"./dashboard.svg":"f782","./example.svg":"30c3","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./link.svg":"18f0","./nested.svg":"dcf8","./password.svg":"2a3d","./table.svg":"47f1","./tree.svg":"93cd","./user.svg":"b3b5"};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},"56d7":function(e,t,n){"use strict";n.r(t);n("e623"),n("e379"),n("5dc8"),n("37e1");var a=n("2b0e"),i=(n("f5df1"),n("5c96")),o=n.n(i),r=(n("0fae"),n("f0d9")),c=n.n(r),s=(n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),u=[],l={name:"App"},d=l,m=n("2877"),f=Object(m["a"])(d,s,u,!1,null,null,null),p=f.exports,h=n("4360"),b=n("a18c"),v=(n("d81d"),n("d3b7"),n("ddb0"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal?n("div",e._g({staticClass:"svg-external-icon svg-icon",style:e.styleExternalIcon},e.$listeners)):n("svg",e._g({class:e.svgClass,attrs:{"aria-hidden":"true"}},e.$listeners),[n("use",{attrs:{"xlink:href":e.iconName}})])}),g=[],w=n("61f7"),x={name:"SvgIcon",props:{iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExternal:function(){return Object(w["a"])(this.iconClass)},iconName:function(){return"#icon-".concat(this.iconClass)},svgClass:function(){return this.className?"svg-icon "+this.className:"svg-icon"},styleExternalIcon:function(){return{mask:"url(".concat(this.iconClass,") no-repeat 50% 50%"),"-webkit-mask":"url(".concat(this.iconClass,") no-repeat 50% 50%")}}}},y=x,k=(n("68fa"),Object(m["a"])(y,v,g,!1,null,"f9f7fefc",null)),C=k.exports;a["default"].component("svg-icon",C);var O=n("51ff"),_=function(e){return e.keys().map(e)};_(O);var S=n("1da1"),E=(n("96cf"),n("323e")),z=n.n(E),H=(n("a5d8"),n("5f87")),T=(n("99af"),n("83d6")),M=n.n(T),B=M.a.title||"Vue Admin Template";function j(e){return e?"".concat(e," - ").concat(B):"".concat(B)}z.a.configure({showSpinner:!1});var A=["/login"];b["a"].beforeEach(function(){var e=Object(S["a"])(regeneratorRuntime.mark((function e(t,n,a){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:z.a.start(),document.title=j(t.meta.title),i=Object(H["a"])(),i?"/login"===t.path?(a({path:"/"}),z.a.done()):a():-1!==A.indexOf(t.path)?a():(a("/login?redirect=".concat(t.path)),z.a.done());case 4:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}()),b["a"].afterEach((function(){z.a.done()}));var L=n("4b0f"),V=L.mockXHR;V(),a["default"].use(o.a,{locale:c.a}),a["default"].config.productionTip=!1,new a["default"]({el:"#app",router:b["a"],store:h["a"],render:function(e){return e(p)}})},"5f87":function(e,t,n){"use strict";function a(){return localStorage.getItem("_token")}function i(e){localStorage.setItem("_token",e)}function o(){localStorage.setItem("_token","")}n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}))},"605c":function(e,t,n){},"61f7":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));n("498a");function a(e){return/^(https?:|mailto:|tel:)/.test(e)}function i(e){var t=["admin","editor"];return t.indexOf(e.trim())>=0}},"68fa":function(e,t,n){"use strict";n("eae4")},"6b31":function(e,t,n){"use strict";n("d346")},"709d":function(e,t,n){},"83d6":function(e,t){e.exports={title:"币安量化交易",fixedHeader:!1,sidebarLogo:!1}},"8a60":function(e,t,n){function a(e){var t=decodeURIComponent(e.split("?")[1]).replace(/\+/g," ");if(!t)return{};var n={},a=t.split("&");return a.forEach((function(e){var t=e.indexOf("=");if(-1!==t){var a=e.substring(0,t),i=e.substring(t+1,e.length);n[a]=i}})),n}n("ac1f"),n("5319"),n("1276"),n("159b"),e.exports={param2Obj:a}},"93cd":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-tree",use:"icon-tree-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},9874:function(e,t,n){},"9df4":function(e,t,n){},"9f2b":function(e,t,n){"use strict";n("709d")},a0bc:function(e,t,n){var a=n("96eb"),i=a.mock({"items|30":[{id:"@id",title:"@sentence(10, 20)","status|1":["published","draft","deleted"],author:"name",display_time:"@datetime",pageviews:"@integer(300, 5000)"}]});e.exports=[{url:"/vue-admin-template/table/list",type:"get",response:function(e){var t=i.items;return{code:2e4,data:{total:t.length,items:t}}}}]},a18c:function(e,t,n){"use strict";n.d(t,"b",(function(){return Be}));n("d3b7"),n("3ca3"),n("ddb0");var a,i,o=n("2b0e"),r=n("8c4f"),c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),n("sidebar",{staticClass:"sidebar-container"}),n("div",{staticClass:"main-container"},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar")],1),n("app-main")],1)],1)},s=[],u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"navbar"},[n("hamburger",{staticClass:"hamburger-container",attrs:{"is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),n("breadcrumb",{staticClass:"breadcrumb-container"}),n("div",{staticClass:"right-menu"},[n("el-dropdown",{staticClass:"avatar-container",attrs:{trigger:"click"}},[n("div",{staticClass:"avatar-wrapper"},[n("img",{staticClass:"user-avatar",attrs:{src:"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80"}}),n("i",{staticClass:"el-icon-caret-bottom"})]),n("el-dropdown-menu",{staticClass:"user-dropdown",attrs:{slot:"dropdown"},slot:"dropdown"},[n("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.logout(t)}}},[n("span",{staticStyle:{display:"block"}},[e._v("登出")])])],1)],1)],1)],1)},l=[],d=n("1da1"),m=n("5530"),f=(n("96cf"),n("2f62")),p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,(function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])})),1)],1)},h=[],b=(n("4de4"),n("99af"),n("b0c0"),n("498a"),n("bd11")),v=n.n(b),g={data:function(){return{levelList:null}},watch:{$route:function(){this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter((function(e){return e.meta&&e.meta.title})),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter((function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb}))},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=v.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},w=g,x=(n("34c8"),n("2877")),y=Object(x["a"])(w,p,h,!1,null,"62cc9144",null),k=y.exports,C=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},O=[],_={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},S=_,E=(n("186a"),Object(x["a"])(S,C,O,!1,null,"49e15297",null)),z=E.exports,H=n("5f87"),T={components:{Breadcrumb:k,Hamburger:z},computed:Object(m["a"])({},Object(f["b"])(["sidebar","avatar"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},logout:function(){var e=this;return Object(d["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:Object(H["b"])(),e.$router.push("/login?redirect=".concat(e.$route.fullPath));case 2:case"end":return t.stop()}}),t)})))()}}},M=T,B=(n("c293"),Object(x["a"])(M,u,l,!1,null,"d7871576",null)),j=B.exports,A=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.routes,(function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})})),1)],1)],1)},L=[],V=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])])],1)],1)},$=[],I={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"Vue Admin Template",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},P=I,R=(n("6b31"),Object(x["a"])(P,V,$,!1,null,"5bb1c0e2",null)),N=R.exports,D=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._l(e.item.children,(function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})}))],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},q=[],G=n("df7c"),F=n.n(G),U=n("61f7"),X=(n("caad6"),n("2532"),{name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&(a.includes("el-icon")?o.push(e("i",{class:[a,"sub-el-icon"]})):o.push(e("svg-icon",{attrs:{"icon-class":a}}))),i&&o.push(e("span",{slot:"title"},[i])),o}}),J=X,K=(n("bf4f"),Object(x["a"])(J,a,i,!1,null,"18eeea00",null)),W=K.exports,Q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(e.type,e._b({tag:"component"},"component",e.linkProps(e.to),!1),[e._t("default")],2)},Y=[],Z={props:{to:{type:String,required:!0}},computed:{isExternal:function(){return Object(U["a"])(this.to)},type:function(){return this.isExternal?"a":"router-link"}},methods:{linkProps:function(e){return this.isExternal?{href:e,target:"_blank",rel:"noopener"}:{to:e}}}},ee=Z,te=Object(x["a"])(ee,Q,Y,!1,null,null,null),ne=te.exports,ae={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},ie={name:"SidebarItem",components:{Item:W,AppLink:ne},mixins:[ae],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter((function(t){return!t.hidden&&(e.onlyOneChild=t,!0)}));return 1===a.length||0===a.length&&(this.onlyOneChild=Object(m["a"])(Object(m["a"])({},n),{},{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return Object(U["a"])(e)?e:Object(U["a"])(this.basePath)?this.basePath:F.a.resolve(this.basePath,e)}}},oe=ie,re=Object(x["a"])(oe,D,q,!1,null,null,null),ce=re.exports,se=n("cf1e"),ue=n.n(se),le={components:{SidebarItem:ce,Logo:N},computed:Object(m["a"])(Object(m["a"])({},Object(f["b"])(["sidebar"])),{},{routes:function(){return this.$router.options.routes},activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return ue.a},isCollapse:function(){return!this.sidebar.opened}})},de=le,me=Object(x["a"])(de,A,L,!1,null,null,null),fe=me.exports,pe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("router-view",{key:e.key})],1)],1)},he=[],be={name:"AppMain",computed:{key:function(){return this.$route.path}}},ve=be,ge=(n("e4de"),n("028b"),Object(x["a"])(ve,pe,he,!1,null,"64cf4d83",null)),we=ge.exports,xe=n("4360"),ye=document,ke=ye.body,Ce=992,Oe={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&xe["a"].dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(xe["a"].dispatch("app/toggleDevice","mobile"),xe["a"].dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=ke.getBoundingClientRect();return e.width-1'});r.a.add(c);t["default"]=c},b775:function(e,t,n){"use strict";n("d3b7");var a=n("bc3a"),i=n.n(a),o=n("5c96"),r=n("4360"),c=n("5f87"),s=i.a.create({baseURL:"",timeout:5e3});s.interceptors.request.use((function(e){return r["a"].getters.token&&(e.headers["Authorization"]=Object(c["a"])()),e}),(function(e){return console.log(e),Promise.reject(e)})),s.interceptors.response.use((function(e){var t=e.data;return 200!==t.code?(Object(o["Message"])({message:t.msg||"Error",type:"error",duration:5e3}),Promise.reject(new Error(t.msg||"Error"))):t}),(function(e){return console.log("err"+e),Object(o["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)})),t["a"]=s},bf4f:function(e,t,n){"use strict";n("9874")},c293:function(e,t,n){"use strict";n("605c")},c763:function(e,t,n){},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409eff",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d346:function(e,t,n){},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(c);t["default"]=c},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},e4de:function(e,t,n){"use strict";n("c763")},eae4:function(e,t,n){},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},f30b:function(e,t,n){},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 128 100",content:''});r.a.add(c);t["default"]=c}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/static/js/chunk-005c2717.aa388d1b.js b/static/js/chunk-005c2717.aa388d1b.js new file mode 100644 index 0000000..9307823 --- /dev/null +++ b/static/js/chunk-005c2717.aa388d1b.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-005c2717"],{"91d0":function(a,s,t){"use strict";t("fba0")},9406:function(a,s,t){"use strict";t.r(s);var n=function(){var a=this,s=a.$createElement,t=a._self._c||s;return t("div",{staticClass:"dashboard-container"},[t("div",{staticClass:"dashboard-text"},[t("span",[a._v("debug模式: ")]),"1"===a.config.debug?t("span",{staticClass:"red"},[a._v("是")]):t("span",{staticClass:"green"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启币币新币抢购: ")]),"1"===a.config.spotNewEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启合约新币抢购: ")]),"1"===a.config.tradeNewEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启币种通知信息: ")]),"1"===a.config.noticeCoinEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启行情监听通知信息: ")]),"1"===a.config.listenCoinEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启自动合约交易: ")]),"1"===a.config.tradeFutureEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")]),t("div",{staticStyle:{"margin-left":"20px"}},[t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否允许做多: ")]),a.config.coinAllowLong?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否允许做空: ")]),a.config.coinAllowShort?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("自动交易策略: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.tradeStrategyTrade))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("选币策略: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.tradeStrategyCoin))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("最大持仓数量限制: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.coinMaxCount))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("排除自动交易的币: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.coinExcludeSymbols))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("下单类型: ")]),t("span",{staticClass:"green"},[a._v(a._s("LIMIT"===a.config.coinOrderType?"限价(根据价格深度取平均价挂单,有可能无法买入)":"市价"))])])])])])},e=[],i=t("1da1"),r=(t("96cf"),t("b775"));function c(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r["a"])({url:"/service/config",method:"get",params:a})}var o={name:"Dashboard",data:function(){return{config:{}}},created:function(){var a=this;return Object(i["a"])(regeneratorRuntime.mark((function s(){return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return s.next=2,a.fetchConfig();case 2:case"end":return s.stop()}}),s)})))()},methods:{fetchConfig:function(){var a=this;return Object(i["a"])(regeneratorRuntime.mark((function s(){var t,n;return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return s.next=2,c();case 2:t=s.sent,n=t.data,console.log(n),a.config=n;case 6:case"end":return s.stop()}}),s)})))()}}},d=o,l=(t("91d0"),t("2877")),v=Object(l["a"])(d,n,e,!1,null,"2698e298",null);s["default"]=v.exports},fba0:function(a,s,t){}}]); \ No newline at end of file diff --git a/static/js/chunk-43aa6520.0e3e0f17.js b/static/js/chunk-43aa6520.0e3e0f17.js new file mode 100644 index 0000000..81efc21 --- /dev/null +++ b/static/js/chunk-43aa6520.0e3e0f17.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-43aa6520"],{"0ccb":function(e,t,n){var r=n("50c4"),a=n("1148"),i=n("1d80"),o=Math.ceil,c=function(e){return function(t,n,c){var l,s,u=String(i(t)),f=u.length,d=void 0===c?" ":String(c),p=r(n);return p<=f||""==d?u:(l=p-f,s=a.call(d,o(l/d.length)),s.length>l&&(s=s.slice(0,l)),e?u+s:s+u)}};e.exports={start:c(!1),end:c(!0)}},1148:function(e,t,n){"use strict";var r=n("a691"),a=n("1d80");e.exports="".repeat||function(e){var t=String(a(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},"26dc":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{staticStyle:{"margin-bottom":"10px"}},[n("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(t){return e.openDialog()}}},[e._v(" 新增 ")]),n("el-button",{attrs:{type:"primary",size:"mini",loading:e.listLoading},on:{click:function(t){return e.fetchData()}}},[e._v(" 刷新 ")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"Loading",border:"",fit:"",size:"mini","row-key":e.rowKey,"expand-row-keys":e.expandKeys,"highlight-current-row":""},on:{"sort-change":e.sortChange,"expand-change":e.expandChange}},[n("el-table-column",{attrs:{label:"币种",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.symbol)+" ")]}}])}),n("el-table-column",{attrs:{label:"k线周期",align:"center",width:"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-select",{attrs:{size:"small"},on:{change:function(n){return e.edit(t.row)}},model:{value:t.row.kline_interval,callback:function(n){e.$set(t.row,"kline_interval",n)},expression:"scope.row.kline_interval"}},[n("el-option",{attrs:{label:"1m",value:"1m"}}),n("el-option",{attrs:{label:"3m",value:"3m"}}),n("el-option",{attrs:{label:"5m",value:"5m"}}),n("el-option",{attrs:{label:"15m",value:"15m"}}),n("el-option",{attrs:{label:"30m",value:"30m"}}),n("el-option",{attrs:{label:"1h",value:"1h"}}),n("el-option",{attrs:{label:"2h",value:"2h"}}),n("el-option",{attrs:{label:"4h",value:"4h"}}),n("el-option",{attrs:{label:"6h",value:"6h"}}),n("el-option",{attrs:{label:"8h",value:"8h"}}),n("el-option",{attrs:{label:"12h",value:"12h"}}),n("el-option",{attrs:{label:"1d",value:"1d"}}),n("el-option",{attrs:{label:"3d",value:"3d"}}),n("el-option",{attrs:{label:"1w",value:"1w"}}),n("el-option",{attrs:{label:"1M",value:"1M"}})],1)]}}])}),n("el-table-column",{attrs:{label:"变化幅度%",align:"center",width:"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-input",{staticClass:"edit-input",attrs:{size:"small"},on:{blur:function(n){return e.edit(t.row)}},model:{value:t.row.change_percent,callback:function(n){e.$set(t.row,"change_percent",n)},expression:"scope.row.change_percent"}})]}}])}),n("el-table-column",{attrs:{label:"通知间隔(min)",align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-input",{staticClass:"edit-input",attrs:{size:"small"},on:{blur:function(n){return e.edit(t.row)}},model:{value:t.row.notice_limit_min,callback:function(n){e.$set(t.row,"notice_limit_min",n)},expression:"scope.row.notice_limit_min"}})]}}])}),n("el-table-column",{attrs:{label:"上次通知信息",align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(0!==t.row.last_notice_time?e.parseTime(t.row.last_notice_time):"无")+" "+e._s(e.typeText(t.row.last_notice_type))+" ")]}}])}),n("el-table-column",{attrs:{label:"开启",align:"center",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#dcdfe6"},on:{change:function(t){return e.isChangeBuy(t,r)}},model:{value:r.enable,callback:function(t){e.$set(r,"enable",t)},expression:"row.enable"}})]}}])}),n("el-table-column",{attrs:{label:"操作",align:"center",width:"80","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.del(r)}}},[e._v("删除 ")])]}}])})],1),n("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[n("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{model:e.info,"label-position":"left","label-width":"100px"}},[n("el-form-item",{attrs:{label:"币种",prop:"symbol"}},[n("el-input",{model:{value:e.info.symbol,callback:function(t){e.$set(e.info,"symbol",t)},expression:"info.symbol"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取消")]),n("el-button",{attrs:{type:"primary",loading:e.dialogLoading},on:{click:function(t){return e.addCoin(e.info)}}},[e._v("确定")])],1)],1)],1)},a=[],i=n("5530"),o=n("1da1"),c=(n("d81d"),n("4e82"),n("a9e3"),n("96cf"),n("d377")),l=n("ed08"),s={data:function(){return{list:[],tickets:{},sort:"+",listLoading:!1,enableLoading:!1,dialogFormVisible:!1,dialogLoading:!1,dialogTitle:"新增币种信息",info:{},rowKey:function(e){return e.symbol},expandKeys:[]}},created:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.fetchData();case 2:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){},methods:{typeText:function(e){return{up:"上涨",down:"下跌"}[e]||""},parseTime:l["a"],expandChange:function(e,t){this.expandKeys=t.map((function(e){return e.symbol}))},sortChange:function(e){var t=e.order;this.sort="ascending"===t?"+":"-",this.fetchData()},fetchData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(c["d"])({sort:e.sort,type:1});case 2:n=t.sent,r=n.data,e.list=r.map((function(e){return Object(i["a"])(Object(i["a"])({},e),{},{enable:1==e.enable})}));case 5:case"end":return t.stop()}}),t)})))()},edit:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){var r,a,i,o,l;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.id,a=e.enable,i=e.kline_interval,o=e.notice_limit_min,l=e.change_percent,n.prev=1,n.next=4,Object(c["e"])(r,{kline_interval:i,notice_limit_min:Number(o),change_percent:l,enable:a?1:0});case 4:return t.$message({message:"修改成功",type:"success"}),n.next=7,t.fetchData();case 7:n.next=12;break;case 9:n.prev=9,n.t0=n["catch"](1),t.$message({message:"修改失败",type:"success"});case 12:case"end":return n.stop()}}),n,null,[[1,9]])})))()},del:function(e){var t=this;this.$confirm("确认要删除".concat(e.symbol,"吗?")).then(Object(o["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(c["b"])(e.id);case 3:return t.$message({message:"删除成功",type:"success"}),n.next=6,t.fetchData();case 6:n.next=11;break;case 8:n.prev=8,n.t0=n["catch"](0),t.$message({message:"删除失败",type:"success"});case 11:case"end":return n.stop()}}),n,null,[[0,8]])})))).catch((function(){}))},enableAll:function(e){var t=this;this.$confirm("确认要".concat(1===e?"启用":"停用","所有吗?")).then(Object(o["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(c["c"])(e);case 3:return t.$message({message:"操作成功",type:"success"}),n.next=6,t.fetchData();case 6:n.next=11;break;case 8:n.prev=8,n.t0=n["catch"](0),t.$message({message:"操作失败",type:"success"});case 11:case"end":return n.stop()}}),n,null,[[0,8]])})))).catch((function(){}))},isChangeBuy:function(e,t){var n=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n.edit(t);case 2:case"end":return e.stop()}}),e)})))()},openDialog:function(){this.dialogTitle="新增币种信息",this.dialogFormVisible=!0},addCoin:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=Object(i["a"])(Object(i["a"])({},e),{},{type:1,createTime:+new Date,updateTime:+new Date}),n.next=3,Object(c["a"])(r);case 3:return n.next=5,t.fetchData();case 5:t.dialogFormVisible=!1;case 6:case"end":return n.stop()}}),n)})))()}}},u=s,f=n("2877"),d=Object(f["a"])(u,r,a,!1,null,null,null);t["default"]=d.exports},"4d90":function(e,t,n){"use strict";var r=n("23e7"),a=n("0ccb").start,i=n("9a0c");r({target:"String",proto:!0,forced:i},{padStart:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"4e82":function(e,t,n){"use strict";var r=n("23e7"),a=n("1c0b"),i=n("7b0b"),o=n("d039"),c=n("a640"),l=[],s=l.sort,u=o((function(){l.sort(void 0)})),f=o((function(){l.sort(null)})),d=c("sort"),p=u||!f||!d;r({target:"Array",proto:!0,forced:p},{sort:function(e){return void 0===e?s.call(i(this)):s.call(i(this),a(e))}})},"9a0c":function(e,t,n){var r=n("342f");e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)},a9e3:function(e,t,n){"use strict";var r=n("83ab"),a=n("da84"),i=n("94ca"),o=n("6eeb"),c=n("5135"),l=n("c6b6"),s=n("7156"),u=n("c04e"),f=n("d039"),d=n("7c73"),p=n("241c").f,m=n("06cf").f,b=n("9bf2").f,g=n("58a8").trim,h="Number",v=a[h],w=v.prototype,y=l(d(w))==h,_=function(e){var t,n,r,a,i,o,c,l,s=u(e,!1);if("string"==typeof s&&s.length>2)if(s=g(s),t=s.charCodeAt(0),43===t||45===t){if(n=s.charCodeAt(2),88===n||120===n)return NaN}else if(48===t){switch(s.charCodeAt(1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+s}for(i=s.slice(2),o=i.length,c=0;ca)return NaN;return parseInt(i,r)}return+s};if(i(h,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var x,k=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof k&&(y?f((function(){w.valueOf.call(n)})):l(n)!=h)?s(new v(_(t)),n,k):_(t)},S=r?p(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),O=0;S.length>O;O++)c(v,x=S[O])&&!c(k,x)&&b(k,x,m(v,x));k.prototype=w,w.constructor=k,o(a,h,k)}},d377:function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l}));var r=n("b775");function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r["a"])({url:"/listen/coin",method:"get",params:e})}function i(e,t){return Object(r["a"])({url:"/listen/coin/".concat(e),method:"put",data:t})}function o(e){return Object(r["a"])({url:"/listen/coin",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/listen/coin/".concat(e),method:"delete"})}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return Object(r["a"])({url:"/listen/coin/enable/".concat(e),method:"put"})}},ed08:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0");function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n("ac1f"),n("5319"),n("4d63"),n("25f0"),n("4d90"),n("1276"),n("159b");function a(e,t){if(0===arguments.length||!e)return null;var n,a=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"===r(e)?n=e:("string"===typeof e&&(e=/^[0-9]+$/.test(e)?parseInt(e):e.replace(new RegExp(/-/gm),"/")),"number"===typeof e&&10===e.toString().length&&(e*=1e3),n=new Date(e));var i={y:n.getFullYear(),m:n.getMonth()+1,d:n.getDate(),h:n.getHours(),i:n.getMinutes(),s:n.getSeconds(),a:n.getDay()},o=a.replace(/{([ymdhisa])+}/g,(function(e,t){var n=i[t];return"a"===t?["日","一","二","三","四","五","六"][n]:n.toString().padStart(2,"0")}));return o}}}]); \ No newline at end of file diff --git a/static/js/chunk-467a0df3.22a9c876.js b/static/js/chunk-467a0df3.22a9c876.js deleted file mode 100644 index fe7e8ff..0000000 --- a/static/js/chunk-467a0df3.22a9c876.js +++ /dev/null @@ -1 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-467a0df3"],{9406:function(a,s,t){"use strict";t.r(s);var e=function(){var a=this,s=a.$createElement,t=a._self._c||s;return t("div",{staticClass:"dashboard-container"},[t("div",{staticClass:"dashboard-text"},[t("span",[a._v("debug模式: ")]),"1"===a.config.debug?t("span",{staticClass:"red"},[a._v("是")]):t("span",{staticClass:"green"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启币币新币抢购: ")]),"1"===a.config.spotNewEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启合约新币抢购: ")]),"1"===a.config.tradeNewEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启币种通知信息: ")]),"1"===a.config.noticeCoinEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否开启自动合约交易: ")]),"1"===a.config.tradeFutureEnable?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")]),t("div",{staticStyle:{"margin-left":"20px"}},[t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否允许做多: ")]),a.config.coinAllowLong?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("是否允许做空: ")]),a.config.coinAllowShort?t("span",{staticClass:"green"},[a._v("是")]):t("span",{staticClass:"red"},[a._v("否")])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("自动交易策略: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.tradeStrategyTrade))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("选币策略: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.tradeStrategyCoin))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("最大持仓数量限制: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.coinMaxCount))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("排除自动交易的币: ")]),t("span",{staticClass:"green"},[a._v(a._s(a.config.coinExcludeSymbols))])]),t("div",{staticClass:"dashboard-text"},[t("span",[a._v("下单类型: ")]),t("span",{staticClass:"green"},[a._v(a._s("LIMIT"===a.config.coinOrderType?"限价(根据价格深度取平均价挂单,有可能无法买入)":"市价"))])])])])])},n=[],i=t("1da1"),r=(t("96cf"),t("b775"));function c(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r["a"])({url:"/service/config",method:"get",params:a})}var o={name:"Dashboard",data:function(){return{config:{}}},created:function(){var a=this;return Object(i["a"])(regeneratorRuntime.mark((function s(){return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return s.next=2,a.fetchConfig();case 2:case"end":return s.stop()}}),s)})))()},methods:{fetchConfig:function(){var a=this;return Object(i["a"])(regeneratorRuntime.mark((function s(){var t,e;return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return s.next=2,c();case 2:t=s.sent,e=t.data,console.log(e),a.config=e;case 6:case"end":return s.stop()}}),s)})))()}}},d=o,l=(t("9ab0"),t("2877")),v=Object(l["a"])(d,e,n,!1,null,"532243b1",null);s["default"]=v.exports},"9ab0":function(a,s,t){"use strict";t("e2e7")},e2e7:function(a,s,t){}}]); \ No newline at end of file diff --git a/static/js/chunk-fd6b1cb0.831a55d0.js b/static/js/chunk-fd6b1cb0.831a55d0.js new file mode 100644 index 0000000..9d075cd --- /dev/null +++ b/static/js/chunk-fd6b1cb0.831a55d0.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fd6b1cb0"],{"0ccb":function(e,t,n){var r=n("50c4"),a=n("1148"),i=n("1d80"),o=Math.ceil,c=function(e){return function(t,n,c){var l,s,u=String(i(t)),f=u.length,d=void 0===c?" ":String(c),p=r(n);return p<=f||""==d?u:(l=p-f,s=a.call(d,o(l/d.length)),s.length>l&&(s=s.slice(0,l)),e?u+s:s+u)}};e.exports={start:c(!1),end:c(!0)}},1148:function(e,t,n){"use strict";var r=n("a691"),a=n("1d80");e.exports="".repeat||function(e){var t=String(a(this)),n="",i=r(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},"4d90":function(e,t,n){"use strict";var r=n("23e7"),a=n("0ccb").start,i=n("9a0c");r({target:"String",proto:!0,forced:i},{padStart:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"4e82":function(e,t,n){"use strict";var r=n("23e7"),a=n("1c0b"),i=n("7b0b"),o=n("d039"),c=n("a640"),l=[],s=l.sort,u=o((function(){l.sort(void 0)})),f=o((function(){l.sort(null)})),d=c("sort"),p=u||!f||!d;r({target:"Array",proto:!0,forced:p},{sort:function(e){return void 0===e?s.call(i(this)):s.call(i(this),a(e))}})},7552:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{staticStyle:{"margin-bottom":"10px"}},[n("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(t){return e.openDialog()}}},[e._v(" 新增 ")]),n("el-button",{attrs:{type:"primary",size:"mini",loading:e.listLoading},on:{click:function(t){return e.fetchData()}}},[e._v(" 刷新 ")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"Loading",border:"",fit:"",size:"mini","row-key":e.rowKey,"expand-row-keys":e.expandKeys,"highlight-current-row":""},on:{"sort-change":e.sortChange,"expand-change":e.expandChange}},[n("el-table-column",{attrs:{label:"币种",align:"center","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.symbol)+" ")]}}])}),n("el-table-column",{attrs:{label:"k线周期",align:"center",width:"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-select",{attrs:{size:"small"},on:{change:function(n){return e.edit(t.row)}},model:{value:t.row.kline_interval,callback:function(n){e.$set(t.row,"kline_interval",n)},expression:"scope.row.kline_interval"}},[n("el-option",{attrs:{label:"1m",value:"1m"}}),n("el-option",{attrs:{label:"3m",value:"3m"}}),n("el-option",{attrs:{label:"5m",value:"5m"}}),n("el-option",{attrs:{label:"15m",value:"15m"}}),n("el-option",{attrs:{label:"30m",value:"30m"}}),n("el-option",{attrs:{label:"1h",value:"1h"}}),n("el-option",{attrs:{label:"2h",value:"2h"}}),n("el-option",{attrs:{label:"4h",value:"4h"}}),n("el-option",{attrs:{label:"6h",value:"6h"}}),n("el-option",{attrs:{label:"8h",value:"8h"}}),n("el-option",{attrs:{label:"12h",value:"12h"}}),n("el-option",{attrs:{label:"1d",value:"1d"}}),n("el-option",{attrs:{label:"3d",value:"3d"}}),n("el-option",{attrs:{label:"1w",value:"1w"}}),n("el-option",{attrs:{label:"1M",value:"1M"}})],1)]}}])}),n("el-table-column",{attrs:{label:"变化幅度%",align:"center",width:"110"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-input",{staticClass:"edit-input",attrs:{size:"small"},on:{blur:function(n){return e.edit(t.row)}},model:{value:t.row.change_percent,callback:function(n){e.$set(t.row,"change_percent",n)},expression:"scope.row.change_percent"}})]}}])}),n("el-table-column",{attrs:{label:"通知间隔(min)",align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-input",{staticClass:"edit-input",attrs:{size:"small"},on:{blur:function(n){return e.edit(t.row)}},model:{value:t.row.notice_limit_min,callback:function(n){e.$set(t.row,"notice_limit_min",n)},expression:"scope.row.notice_limit_min"}})]}}])}),n("el-table-column",{attrs:{label:"上次通知信息",align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(0!==t.row.last_notice_time?e.parseTime(t.row.last_notice_time):"无")+" "+e._s(e.typeText(t.row.last_notice_type))+" ")]}}])}),n("el-table-column",{attrs:{label:"开启",align:"center",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("el-switch",{attrs:{"active-color":"#13ce66","inactive-color":"#dcdfe6"},on:{change:function(t){return e.isChangeBuy(t,r)}},model:{value:r.enable,callback:function(t){e.$set(r,"enable",t)},expression:"row.enable"}})]}}])}),n("el-table-column",{attrs:{label:"操作",align:"center",width:"80","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[n("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(t){return e.del(r)}}},[e._v("删除 ")])]}}])})],1),n("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[n("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{model:e.info,"label-position":"left","label-width":"100px"}},[n("el-form-item",{attrs:{label:"币种",prop:"symbol"}},[n("el-input",{model:{value:e.info.symbol,callback:function(t){e.$set(e.info,"symbol",t)},expression:"info.symbol"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取消")]),n("el-button",{attrs:{type:"primary",loading:e.dialogLoading},on:{click:function(t){return e.addCoin(e.info)}}},[e._v("确定")])],1)],1)],1)},a=[],i=n("5530"),o=n("1da1"),c=(n("d81d"),n("4e82"),n("a9e3"),n("96cf"),n("d377")),l=n("ed08"),s={data:function(){return{list:[],tickets:{},sort:"+",listLoading:!1,enableLoading:!1,dialogFormVisible:!1,dialogLoading:!1,dialogTitle:"新增币种信息",info:{},rowKey:function(e){return e.symbol},expandKeys:[]}},created:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.fetchData();case 2:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){},methods:{typeText:function(e){return{up:"上涨",down:"下跌"}[e]||""},parseTime:l["a"],expandChange:function(e,t){this.expandKeys=t.map((function(e){return e.symbol}))},sortChange:function(e){var t=e.order;this.sort="ascending"===t?"+":"-",this.fetchData()},fetchData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(c["d"])({sort:e.sort,type:2});case 2:n=t.sent,r=n.data,e.list=r.map((function(e){return Object(i["a"])(Object(i["a"])({},e),{},{enable:1==e.enable})}));case 5:case"end":return t.stop()}}),t)})))()},edit:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){var r,a,i,o,l;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.id,a=e.enable,i=e.kline_interval,o=e.notice_limit_min,l=e.change_percent,n.prev=1,n.next=4,Object(c["e"])(r,{kline_interval:i,notice_limit_min:Number(o),change_percent:l,enable:a?1:0});case 4:return t.$message({message:"修改成功",type:"success"}),n.next=7,t.fetchData();case 7:n.next=12;break;case 9:n.prev=9,n.t0=n["catch"](1),t.$message({message:"修改失败",type:"success"});case 12:case"end":return n.stop()}}),n,null,[[1,9]])})))()},del:function(e){var t=this;this.$confirm("确认要删除".concat(e.symbol,"吗?")).then(Object(o["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(c["b"])(e.id);case 3:return t.$message({message:"删除成功",type:"success"}),n.next=6,t.fetchData();case 6:n.next=11;break;case 8:n.prev=8,n.t0=n["catch"](0),t.$message({message:"删除失败",type:"success"});case 11:case"end":return n.stop()}}),n,null,[[0,8]])})))).catch((function(){}))},enableAll:function(e){var t=this;this.$confirm("确认要".concat(1===e?"启用":"停用","所有吗?")).then(Object(o["a"])(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(c["c"])(e);case 3:return t.$message({message:"操作成功",type:"success"}),n.next=6,t.fetchData();case 6:n.next=11;break;case 8:n.prev=8,n.t0=n["catch"](0),t.$message({message:"操作失败",type:"success"});case 11:case"end":return n.stop()}}),n,null,[[0,8]])})))).catch((function(){}))},isChangeBuy:function(e,t){var n=this;return Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n.edit(t);case 2:case"end":return e.stop()}}),e)})))()},openDialog:function(){this.dialogTitle="新增币种信息",this.dialogFormVisible=!0},addCoin:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=Object(i["a"])(Object(i["a"])({},e),{},{type:2,createTime:+new Date,updateTime:+new Date}),n.next=3,Object(c["a"])(r);case 3:return n.next=5,t.fetchData();case 5:t.dialogFormVisible=!1;case 6:case"end":return n.stop()}}),n)})))()}}},u=s,f=n("2877"),d=Object(f["a"])(u,r,a,!1,null,null,null);t["default"]=d.exports},"9a0c":function(e,t,n){var r=n("342f");e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)},a9e3:function(e,t,n){"use strict";var r=n("83ab"),a=n("da84"),i=n("94ca"),o=n("6eeb"),c=n("5135"),l=n("c6b6"),s=n("7156"),u=n("c04e"),f=n("d039"),d=n("7c73"),p=n("241c").f,m=n("06cf").f,b=n("9bf2").f,g=n("58a8").trim,h="Number",v=a[h],w=v.prototype,y=l(d(w))==h,_=function(e){var t,n,r,a,i,o,c,l,s=u(e,!1);if("string"==typeof s&&s.length>2)if(s=g(s),t=s.charCodeAt(0),43===t||45===t){if(n=s.charCodeAt(2),88===n||120===n)return NaN}else if(48===t){switch(s.charCodeAt(1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+s}for(i=s.slice(2),o=i.length,c=0;ca)return NaN;return parseInt(i,r)}return+s};if(i(h,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var x,k=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof k&&(y?f((function(){w.valueOf.call(n)})):l(n)!=h)?s(new v(_(t)),n,k):_(t)},S=r?p(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),O=0;S.length>O;O++)c(v,x=S[O])&&!c(k,x)&&b(k,x,m(v,x));k.prototype=w,w.constructor=k,o(a,h,k)}},d377:function(e,t,n){"use strict";n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l}));var r=n("b775");function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r["a"])({url:"/listen/coin",method:"get",params:e})}function i(e,t){return Object(r["a"])({url:"/listen/coin/".concat(e),method:"put",data:t})}function o(e){return Object(r["a"])({url:"/listen/coin",method:"post",data:e})}function c(e){return Object(r["a"])({url:"/listen/coin/".concat(e),method:"delete"})}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return Object(r["a"])({url:"/listen/coin/enable/".concat(e),method:"put"})}},ed08:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0");function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n("ac1f"),n("5319"),n("4d63"),n("25f0"),n("4d90"),n("1276"),n("159b");function a(e,t){if(0===arguments.length||!e)return null;var n,a=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"===r(e)?n=e:("string"===typeof e&&(e=/^[0-9]+$/.test(e)?parseInt(e):e.replace(new RegExp(/-/gm),"/")),"number"===typeof e&&10===e.toString().length&&(e*=1e3),n=new Date(e));var i={y:n.getFullYear(),m:n.getMonth()+1,d:n.getDate(),h:n.getHours(),i:n.getMinutes(),s:n.getSeconds(),a:n.getDay()},o=a.replace(/{([ymdhisa])+}/g,(function(e,t){var n=i[t];return"a"===t?["日","一","二","三","四","五","六"][n]:n.toString().padStart(2,"0")}));return o}}}]); \ No newline at end of file