diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 53cf2ba6..983d5877 100755 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -64,6 +64,10 @@ class OrderController extends Controller if (!$plan->show && !$plan->renew) { abort(500, '该订阅无法续费,请更换其他订阅'); } + + if (!(int)$plan[$request->input('cycle')]) { + abort(500, '该订阅周期无法进行购买,请选择其他周期'); + } $order = new Order(); $order->user_id = $request->session()->get('id'); diff --git a/public/p__admin__plan.async.js b/public/p__admin__plan.async.js index e1a85d6f..fb2de19a 100644 --- a/public/p__admin__plan.async.js +++ b/public/p__admin__plan.async.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[5],{Bl7J:function(e,t,a){"use strict";var i=a("q1tI"),n=a.n(i),r=a("3a4m"),s=a.n(r),l=a("/MKj"),c=a("20nU"),m=a("yWgo");class o extends n.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],t=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7ad9\u70b9\u914d\u7f6e",type:"item",href:"/admin/config/site",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-users"})}];Object(m["b"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:t}):this.setState({nav:e})}renderMenu(e,t,a,i){switch(e){case"heading":return n.a.createElement("li",{className:"nav-main-heading"},t);case"item":return n.a.createElement("li",{className:"nav-main-item"},n.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===a&&"active"),onClick:()=>{s.a.push(a),this.props.dispatch({type:"header/showNav"})}},i&&i,n.a.createElement("span",{className:"nav-main-link-name"},t)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return n.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},n.a.createElement("div",{className:"smini-visible-block"},n.a.createElement("div",{className:"content-header bg-black-10"},n.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},n.a.createElement("span",{className:"text-white-75"},"X"),n.a.createElement("span",{className:"text-white"},"H")))),n.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},n.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},n.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},n.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),n.a.createElement("div",{className:"d-lg-none"},n.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},n.a.createElement("i",{className:"fa fa-times-circle"}))))),n.a.createElement("div",{className:"content-side content-side-full"},n.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(l["c"])(e=>{var t=e.header;return{header:t}})(o),h=a("t3Un");class p extends n.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(t){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(h["a"])("/user/logout").then(e=>{s.a.push("/login")})}render(){return n.a.createElement("header",{id:"page-header"},n.a.createElement("div",{className:"content-header"},n.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"none":"block"}},n.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},n.a.createElement("i",{className:"fa fa-fw fa-bars"}))),this.props.search&&n.a.createElement("div",null,n.a.createElement("input",{type:"text",className:"form-control rounded-lg px-4",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value)})),n.a.createElement("div",null,this.state.loading?n.a.createElement("div",{className:"spinner-grow text-primary"}):n.a.createElement("div",{className:"dropdown d-inline-block"},n.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},n.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),n.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),n.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),n.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},n.a.createElement("div",{className:"p-2"},n.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:;",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",n.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))))}}var u=Object(l["c"])(e=>{var t=e.header;return{header:t}})(p);class v extends n.a.Component{render(){return n.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},n.a.createElement("div",{className:"content py-0"},n.a.createElement("div",{className:"row font-size-sm"},n.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},n.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),n.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},n.a.createElement("a",{className:"font-w600",href:"/",target:"_blank"},"V2Board v0.1"),n.a.createElement("span",{"data-toggle":"year-copy"})))))}}class g extends n.a.Component{render(){return n.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},n.a.createElement(d,this.props),n.a.createElement(u,{search:this.props.search}),this.props.loading?n.a.createElement("main",{id:"main-container"},n.a.createElement("div",{className:"content content-full"},n.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},n.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,n.a.createElement(v,null))}}t["a"]=Object(l["c"])(e=>{var t=e.header;return{header:t}})(g)},yjin:function(e,t,a){"use strict";a.r(t);var i=a("jehZ"),n=a.n(i),r=(a("2qtc"),a("kLXV")),s=(a("OaEy"),a("2fM7")),l=(a("5NDa"),a("5rEg")),c=(a("g9YV"),a("wCAj")),m=(a("/zsF"),a("PArb")),o=(a("5Dmo"),a("3S7+")),d=(a("Pwec"),a("CtXQ")),h=(a("BoS7"),a("Sdc0")),p=(a("+BJd"),a("mr32")),u=a("p0pE"),v=a.n(u),g=a("q1tI"),b=a.n(g),E=a("Bl7J"),f=a("/MKj"),y=a("t3Un");class N extends b.a.Component{constructor(){super(...arguments),this.state={plan:[],group:[],visible:!1,submit:{show:0},loading:!0}}componentDidMount(){this.fetchData()}fetchData(){Object(y["a"])("/admin/server/group").then(e=>{200===e.code&&this.setState({group:e.data})}),Object(y["a"])("/admin/plan").then(e=>{200===e.code&&(e.data.map((t,a)=>{e.data[a].month_price=e.data[a].month_price/100,e.data[a].quarter_price=e.data[a].quarter_price/100,e.data[a].half_year_price=e.data[a].half_year_price/100,e.data[a].year_price=e.data[a].year_price/100}),this.setState({plan:e.data,loading:!1}))})}create(){Object(y["b"])("/admin/plan/save",v()({},this.state.submit,{month_price:this.state.submit.month_price?100*this.state.submit.month_price:void 0,quarter_price:this.state.submit.quarter_price?100*this.state.submit.quarter_price:void 0,half_year_price:this.state.submit.half_year_price?100*this.state.submit.half_year_price:void 0,year_price:this.state.submit.year_price?100*this.state.submit.year_price:void 0})).then(e=>{200===e.code&&(this.modalVisible(),this.fetchData())})}modalVisible(){this.setState({visible:!this.state.visible},()=>{this.setState({submit:{show:0}})})}getGroup(e){this.state.group.map(t=>{if(t.id===e)return t})}priceOnChange(e,t){this.setState({submit:v()({},this.state.submit,{[e]:t})})}drop(e){Object(y["b"])("/admin/plan/drop",{id:e}).then(e=>{200===e.code&&e.data&&this.fetchData()})}edit(e){this.setState({submit:v()({},this.state.plan[e]),visible:!0})}update(e,t,a){this.setState({[e+t+"_loading"]:!0},()=>{Object(y["b"])("/admin/plan/update",{id:e,[t]:a}).then(a=>{200===a.code&&(this.fetchData(),this.setState({[e+t+"_loading"]:!1}))})})}render(){var e=[{title:"\u5957\u9910\u540d\u79f0",dataIndex:"name",key:"name"},{title:"\u6743\u9650\u7ec4",dataIndex:"group_id",key:"group_id",render:(e,t)=>{t.ext_data;var a=[];return this.state.group.map(t=>{t.id===parseInt(e)&&a.push(b.a.createElement(p["a"],null,t.name))}),a}},{title:"\u6708\u4ed8\u552e\u4ef7",dataIndex:"month_price",key:"month_price",render:e=>{return e.toFixed(2)}},{title:"\u5b63\u4ed8\u552e\u4ef7",dataIndex:"quarter_price",key:"quarter_price",render:e=>{return e.toFixed(2)}},{title:"\u534a\u5e74\u4ed8\u552e\u4ef7",dataIndex:"half_year_price",key:"half_year_price",render:e=>{return e.toFixed(2)}},{title:"\u5e74\u4ed8\u552e\u4ef7",dataIndex:"year_price",key:"year_price",render:e=>{return e.toFixed(2)}},{title:"\u9500\u552e\u72b6\u6001",dataIndex:"show",key:"show",align:"center",render:(e,t)=>{return b.a.createElement(h["a"],{loading:this.state[t.id+"show_loading"],size:"small",checked:parseInt(e),onClick:()=>this.update(t.id,"show",parseInt(e)?0:1)})}},{title:b.a.createElement("span",null,"\u7eed\u8d39 ",b.a.createElement(o["a"],{placement:"top",title:"\u5728\u8ba2\u9605\u505c\u6b62\u9500\u552e\u65f6\uff0c\u5df2\u8d2d\u7528\u6237\u662f\u5426\u53ef\u4ee5\u7eed\u8d39"},b.a.createElement(d["a"],{type:"question-circle"}))),dataIndex:"renew",key:"renew",align:"center",render:(e,t)=>{return b.a.createElement(h["a"],{loading:this.state[t.id+"renew_loading"],size:"small",checked:parseInt(e),onClick:()=>this.update(t.id,"renew",parseInt(e)?0:1)})}},{title:"\u64cd\u4f5c",dataIndex:"action",key:"action",align:"right",render:(e,t,a)=>{return b.a.createElement("div",null,b.a.createElement("a",{href:"javascript:;",onClick:()=>this.edit(a)},"\u7f16\u8f91"),b.a.createElement(m["a"],{type:"vertical"}),b.a.createElement("a",{href:"javascript:;",onClick:()=>this.drop(t.id)},"\u5220\u9664"))}}];return b.a.createElement(E["a"],n()({},this.props,{loading:this.state.loading}),b.a.createElement("main",{id:"main-container"},b.a.createElement("div",{className:"content content-full"},b.a.createElement("div",{className:"d-flex justify-content-between align-items-center"},b.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u8ba2\u9605\u7ba1\u7406"),b.a.createElement("button",{type:"button",className:"btn btn-primary btn-sm btn-primary btn-rounded px-3",onClick:()=>this.modalVisible()},"\u65b0\u5efa\u5957\u9910")),b.a.createElement("div",{className:"bg-white"},b.a.createElement(c["a"],{dataSource:this.state.plan,columns:e,pagination:!1,scroll:{x:1e3}})))),b.a.createElement(r["a"],{title:"".concat(this.state.submit.id?"\u7f16\u8f91\u8ba2\u9605":"\u65b0\u5efa\u8ba2\u9605"),visible:this.state.visible,onCancel:()=>this.modalVisible(),onOk:()=>this.create()},b.a.createElement("div",null,b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5957\u9910\u540d\u79f0"),b.a.createElement(l["a"],{placeholder:"\u8bf7\u8f93\u5165\u5957\u9910\u540d\u79f0",value:this.state.submit.name,onChange:e=>{this.setState({submit:v()({},this.state.submit,{name:e.target.value})})}})),b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5957\u9910\u63cf\u8ff0"),b.a.createElement(l["a"].TextArea,{rows:4,value:this.state.submit.content,placeholder:"\u8bf7\u8f93\u5165\u5957\u9910\u63cf\u8ff0\uff0c\u652f\u6301HTML",onChange:e=>{this.setState({submit:v()({},this.state.submit,{content:e.target.value})})}})),b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u6708\u4ed8"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.month_price,onChange:e=>this.priceOnChange("month_price",e.target.value)})),b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5b63\u4ed8"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.quarter_price,onChange:e=>this.priceOnChange("quarter_price",e.target.value)})),b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u534a\u5e74"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.half_year_price,onChange:e=>this.priceOnChange("half_year_price",e.target.value)})),b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5e74\u4ed8"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.year_price,onChange:e=>this.priceOnChange("year_price",e.target.value)}))),b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5957\u9910\u6d41\u91cf(GB)"),b.a.createElement(l["a"],{placeholder:"\u8bf7\u8f93\u5165\u5957\u9910\u6d41\u91cf",value:this.state.submit.transfer_enable,onChange:e=>{this.setState({submit:v()({},this.state.submit,{transfer_enable:e.target.value})})}})),b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u6743\u9650\u7ec4"),b.a.createElement(s["a"],{placeholder:"\u8bf7\u9009\u62e9\u6743\u9650\u7ec4",style:{width:"100%"},value:this.state.submit.group_id?["".concat(this.state.submit.group_id)]:void 0,onChange:e=>{this.setState({submit:v()({},this.state.submit,{group_id:e})})}},this.state.group.map(e=>{return b.a.createElement(s["a"].Option,{key:e.id},e.name)}))))))}}t["default"]=Object(f["c"])()(N)}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[5],{Bl7J:function(e,t,a){"use strict";var i=a("q1tI"),n=a.n(i),r=a("3a4m"),s=a.n(r),l=a("/MKj"),c=a("20nU"),m=a("yWgo");class o extends n.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],t=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7ad9\u70b9\u914d\u7f6e",type:"item",href:"/admin/config/site",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-users"})}];Object(m["b"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:n.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:t}):this.setState({nav:e})}renderMenu(e,t,a,i){switch(e){case"heading":return n.a.createElement("li",{className:"nav-main-heading"},t);case"item":return n.a.createElement("li",{className:"nav-main-item"},n.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===a&&"active"),onClick:()=>{s.a.push(a),this.props.dispatch({type:"header/showNav"})}},i&&i,n.a.createElement("span",{className:"nav-main-link-name"},t)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return n.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},n.a.createElement("div",{className:"smini-visible-block"},n.a.createElement("div",{className:"content-header bg-black-10"},n.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},n.a.createElement("span",{className:"text-white-75"},"X"),n.a.createElement("span",{className:"text-white"},"H")))),n.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},n.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},n.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},n.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),n.a.createElement("div",{className:"d-lg-none"},n.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},n.a.createElement("i",{className:"fa fa-times-circle"}))))),n.a.createElement("div",{className:"content-side content-side-full"},n.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(l["c"])(e=>{var t=e.header;return{header:t}})(o),h=a("t3Un");class p extends n.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(t){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(h["a"])("/user/logout").then(e=>{s.a.push("/login")})}render(){return n.a.createElement("header",{id:"page-header"},n.a.createElement("div",{className:"content-header"},n.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"none":"block"}},n.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},n.a.createElement("i",{className:"fa fa-fw fa-bars"}))),this.props.search&&n.a.createElement("div",null,n.a.createElement("input",{type:"text",className:"form-control rounded-lg px-4",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value)})),n.a.createElement("div",null,this.state.loading?n.a.createElement("div",{className:"spinner-grow text-primary"}):n.a.createElement("div",{className:"dropdown d-inline-block"},n.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},n.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),n.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),n.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),n.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},n.a.createElement("div",{className:"p-2"},n.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:;",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",n.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))))}}var u=Object(l["c"])(e=>{var t=e.header;return{header:t}})(p);class v extends n.a.Component{render(){return n.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},n.a.createElement("div",{className:"content py-0"},n.a.createElement("div",{className:"row font-size-sm"},n.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},n.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),n.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},n.a.createElement("a",{className:"font-w600",href:"/",target:"_blank"},"V2Board v0.1"),n.a.createElement("span",{"data-toggle":"year-copy"})))))}}class g extends n.a.Component{render(){return n.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},n.a.createElement(d,this.props),n.a.createElement(u,{search:this.props.search}),this.props.loading?n.a.createElement("main",{id:"main-container"},n.a.createElement("div",{className:"content content-full"},n.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},n.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,n.a.createElement(v,null))}}t["a"]=Object(l["c"])(e=>{var t=e.header;return{header:t}})(g)},yjin:function(e,t,a){"use strict";a.r(t);var i=a("jehZ"),n=a.n(i),r=(a("2qtc"),a("kLXV")),s=(a("OaEy"),a("2fM7")),l=(a("5NDa"),a("5rEg")),c=(a("g9YV"),a("wCAj")),m=(a("/zsF"),a("PArb")),o=(a("5Dmo"),a("3S7+")),d=(a("Pwec"),a("CtXQ")),h=(a("BoS7"),a("Sdc0")),p=(a("+BJd"),a("mr32")),u=a("p0pE"),v=a.n(u),g=a("q1tI"),b=a.n(g),E=a("Bl7J"),f=a("/MKj"),y=a("t3Un");class N extends b.a.Component{constructor(){super(...arguments),this.state={plan:[],group:[],visible:!1,submit:{show:0},loading:!0}}componentDidMount(){this.fetchData()}fetchData(){Object(y["a"])("/admin/server/group").then(e=>{200===e.code&&this.setState({group:e.data})}),Object(y["a"])("/admin/plan").then(e=>{200===e.code&&(e.data.map((t,a)=>{e.data[a].month_price=e.data[a].month_price/100,e.data[a].quarter_price=e.data[a].quarter_price/100,e.data[a].half_year_price=e.data[a].half_year_price/100,e.data[a].year_price=e.data[a].year_price/100}),this.setState({plan:e.data,loading:!1}))})}create(){Object(y["b"])("/admin/plan/save",v()({},this.state.submit,{month_price:this.state.submit.month_price?100*this.state.submit.month_price:void 0,quarter_price:this.state.submit.quarter_price?100*this.state.submit.quarter_price:void 0,half_year_price:this.state.submit.half_year_price?100*this.state.submit.half_year_price:void 0,year_price:this.state.submit.year_price?100*this.state.submit.year_price:void 0})).then(e=>{200===e.code&&(this.modalVisible(),this.fetchData())})}modalVisible(){this.setState({visible:!this.state.visible},()=>{this.setState({submit:{show:0}})})}getGroup(e){this.state.group.map(t=>{if(t.id===e)return t})}priceOnChange(e,t){this.setState({submit:v()({},this.state.submit,{[e]:t})})}drop(e){Object(y["b"])("/admin/plan/drop",{id:e}).then(e=>{200===e.code&&e.data&&this.fetchData()})}edit(e){this.setState({submit:v()({},this.state.plan[e]),visible:!0})}update(e,t,a){this.setState({[e+t+"_loading"]:!0},()=>{Object(y["b"])("/admin/plan/update",{id:e,[t]:a}).then(a=>{200===a.code&&(this.fetchData(),this.setState({[e+t+"_loading"]:!1}))})})}render(){var e=[{title:"\u5957\u9910\u540d\u79f0",dataIndex:"name",key:"name"},{title:"\u6743\u9650\u7ec4",dataIndex:"group_id",key:"group_id",render:(e,t)=>{t.ext_data;var a=[];return this.state.group.map(t=>{t.id===parseInt(e)&&a.push(b.a.createElement(p["a"],null,t.name))}),a}},{title:"\u6708\u4ed8\u552e\u4ef7",dataIndex:"month_price",key:"month_price",render:e=>{return e.toFixed(2)}},{title:"\u5b63\u4ed8\u552e\u4ef7",dataIndex:"quarter_price",key:"quarter_price",render:e=>{return e.toFixed(2)}},{title:"\u534a\u5e74\u4ed8\u552e\u4ef7",dataIndex:"half_year_price",key:"half_year_price",render:e=>{return e.toFixed(2)}},{title:"\u5e74\u4ed8\u552e\u4ef7",dataIndex:"year_price",key:"year_price",render:e=>{return e.toFixed(2)}},{title:"\u9500\u552e\u72b6\u6001",dataIndex:"show",key:"show",align:"center",render:(e,t)=>{return b.a.createElement(h["a"],{loading:this.state[t.id+"show_loading"],size:"small",checked:parseInt(e),onClick:()=>this.update(t.id,"show",parseInt(e)?0:1)})}},{title:b.a.createElement("span",null,"\u7eed\u8d39 ",b.a.createElement(o["a"],{placement:"top",title:"\u5728\u8ba2\u9605\u505c\u6b62\u9500\u552e\u65f6\uff0c\u5df2\u8d2d\u7528\u6237\u662f\u5426\u53ef\u4ee5\u7eed\u8d39"},b.a.createElement(d["a"],{type:"question-circle"}))),dataIndex:"renew",key:"renew",align:"center",render:(e,t)=>{return b.a.createElement(h["a"],{loading:this.state[t.id+"renew_loading"],size:"small",checked:parseInt(e),onClick:()=>this.update(t.id,"renew",parseInt(e)?0:1)})}},{title:"\u64cd\u4f5c",dataIndex:"action",key:"action",align:"right",render:(e,t,a)=>{return b.a.createElement("div",null,b.a.createElement("a",{href:"javascript:;",onClick:()=>this.edit(a)},"\u7f16\u8f91"),b.a.createElement(m["a"],{type:"vertical"}),b.a.createElement("a",{href:"javascript:;",onClick:()=>this.drop(t.id)},"\u5220\u9664"))}}];return b.a.createElement(E["a"],n()({},this.props,{loading:this.state.loading}),b.a.createElement("main",{id:"main-container"},b.a.createElement("div",{className:"content content-full"},b.a.createElement("div",{className:"d-flex justify-content-between align-items-center"},b.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u8ba2\u9605\u7ba1\u7406"),b.a.createElement("button",{type:"button",className:"btn btn-primary btn-sm btn-primary btn-rounded px-3",onClick:()=>this.modalVisible()},"\u65b0\u5efa\u5957\u9910")),b.a.createElement("div",{className:"bg-white"},b.a.createElement(c["a"],{dataSource:this.state.plan,columns:e,pagination:!1,scroll:{x:1e3}})))),b.a.createElement(r["a"],{title:"".concat(this.state.submit.id?"\u7f16\u8f91\u8ba2\u9605":"\u65b0\u5efa\u8ba2\u9605"),visible:this.state.visible,onCancel:()=>this.modalVisible(),onOk:()=>this.create()},b.a.createElement("div",null,b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5957\u9910\u540d\u79f0"),b.a.createElement(l["a"],{placeholder:"\u8bf7\u8f93\u5165\u5957\u9910\u540d\u79f0",value:this.state.submit.name,onChange:e=>{this.setState({submit:v()({},this.state.submit,{name:e.target.value})})}})),b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5957\u9910\u63cf\u8ff0"),b.a.createElement(l["a"].TextArea,{rows:4,value:this.state.submit.content,placeholder:"\u8bf7\u8f93\u5165\u5957\u9910\u63cf\u8ff0\uff0c\u652f\u6301HTML",onChange:e=>{this.setState({submit:v()({},this.state.submit,{content:e.target.value})})}})),b.a.createElement(m["a"],{orientation:"center"},"\u552e\u4ef7\u8bbe\u7f6e ",b.a.createElement(o["a"],{placement:"top",title:"\u5c06\u91d1\u989d\u8bbe\u7f6e0\u540e\u5219\u4e0d\u4f1a\u8fdb\u884c\u51fa\u552e"},b.a.createElement(d["a"],{type:"info-circle"}))),b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u6708\u4ed8"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.month_price,onChange:e=>this.priceOnChange("month_price",e.target.value)})),b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5b63\u4ed8"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.quarter_price,onChange:e=>this.priceOnChange("quarter_price",e.target.value)})),b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u534a\u5e74"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.half_year_price,onChange:e=>this.priceOnChange("half_year_price",e.target.value)})),b.a.createElement("div",{className:"form-group col-3"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5e74\u4ed8"),b.a.createElement(l["a"],{placeholder:"0.00",value:this.state.submit.year_price,onChange:e=>this.priceOnChange("year_price",e.target.value)}))),b.a.createElement(m["a"],null),b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u5957\u9910\u6d41\u91cf(GB)"),b.a.createElement(l["a"],{placeholder:"\u8bf7\u8f93\u5165\u5957\u9910\u6d41\u91cf",value:this.state.submit.transfer_enable,onChange:e=>{this.setState({submit:v()({},this.state.submit,{transfer_enable:e.target.value})})}})),b.a.createElement("div",{className:"form-group"},b.a.createElement("label",{for:"example-text-input-alt"},"\u6743\u9650\u7ec4"),b.a.createElement(s["a"],{placeholder:"\u8bf7\u9009\u62e9\u6743\u9650\u7ec4",style:{width:"100%"},value:this.state.submit.group_id?["".concat(this.state.submit.group_id)]:void 0,onChange:e=>{this.setState({submit:v()({},this.state.submit,{group_id:e})})}},this.state.group.map(e=>{return b.a.createElement(s["a"].Option,{key:e.id},e.name)}))))))}}t["default"]=Object(f["c"])()(N)}}]); \ No newline at end of file diff --git a/public/p__forgetpassword.async.js b/public/p__forgetpassword.async.js index cb15cd40..ad751250 100644 --- a/public/p__forgetpassword.async.js +++ b/public/p__forgetpassword.async.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[10],{"2v4S":function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return m});a("/xke");var r=a("TeRw"),s=a("q1tI"),l=a.n(s),o=a("t3Un"),i=a("3a4m"),n=a.n(i);class m extends l.a.Component{constructor(){super(...arguments),this.state={sendEmailVerifyTimeout:60}}componentDidMount(){}sendEmailVerify(){var e=this;function t(){setTimeout(()=>{0!==e.state.sendEmailVerifyTimeout?(e.setState({sendEmailVerifyTimeout:e.state.sendEmailVerifyTimeout-1}),t()):e.setState({sendEmailVerifyTimeout:60})},1e3)}Object(o["b"])("/passport/sendEmailVerify",{email:this.refs.email.value}).then(e=>{200===e.code&&t()})}submit(){if(this.refs.password.value!==this.refs.repassword.value)return r["a"]["error"]({message:"\u8bf7\u6c42\u9519\u8bef",description:"\u4e24\u6b21\u5bc6\u7801\u8f93\u5165\u4e0d\u540c",duration:1.5});Object(o["b"])("/passport/register",{email:this.refs.email.value,password:this.refs.password.value,invite_code:this.refs.invite.value,email_code:this.refs.email_code.value}).then(e=>{200===e.code&&e.data&&n.a.push("/login")})}render(){return l.a.createElement("div",{id:"page-container"},l.a.createElement("main",{id:"main-container"},l.a.createElement("div",{className:"row no-gutters justify-content-center bg-body-dark"},l.a.createElement("div",{className:"hero-static col-sm-10 col-md-6 col-xl-4 d-flex align-items-center p-2"},l.a.createElement("div",{className:"block block-rounded block-transparent block-fx-pop w-100 mb-0 overflow-hidden bg-image"},l.a.createElement("div",{className:"row no-gutters"},l.a.createElement("div",{className:"col-md-12 order-md-1 bg-white"},l.a.createElement("div",{className:"block-content block-content-full px-lg-4 py-md-4 py-lg-4"},l.a.createElement("div",{className:"mb-2 text-center"},l.a.createElement("a",{className:"link-fx font-w700 font-size-h1",href:"index.html"},l.a.createElement("span",{className:"text-dark"},window.v2board.title?window.v2board.title:"V2Board")),l.a.createElement("p",{className:"text-uppercase font-w700 font-size-sm text-muted"},"\u8be5\u9875\u9762\u662f\u88ab\u52a0\u5bc6\u7684")),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1",ref:"email"})),l.a.createElement("div",{className:"form-group form-row"},l.a.createElement("div",{className:"col-9"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1\u9a8c\u8bc1\u7801",ref:"email_code"})),l.a.createElement("div",{className:"col-3"},l.a.createElement("button",{type:"submit",disabled:60!==this.state.sendEmailVerifyTimeout,className:"btn btn-block btn-primary",onClick:()=>this.sendEmailVerify()},60===this.state.sendEmailVerifyTimeout?"\u53d1\u9001":this.state.sendEmailVerifyTimeout))),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"password"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"repassword"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("button",{type:"submit",className:"btn btn-block btn-hero-primary",onClick:()=>this.submit()},l.a.createElement("i",{className:"fa fa-fw fa-life-ring mr-1"}),"\u91cd\u7f6e\u5bc6\u7801"))))))))))}}}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[10],{"2v4S":function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return m});a("/xke");var r=a("TeRw"),s=a("q1tI"),l=a.n(s),o=a("t3Un"),n=a("3a4m"),i=a.n(n);class m extends l.a.Component{constructor(){super(...arguments),this.state={sendEmailVerifyTimeout:60}}componentDidMount(){}sendEmailVerify(){var e=this;function t(){setTimeout(()=>{0!==e.state.sendEmailVerifyTimeout?(e.setState({sendEmailVerifyTimeout:e.state.sendEmailVerifyTimeout-1}),t()):e.setState({sendEmailVerifyTimeout:60})},1e3)}Object(o["b"])("/passport/sendEmailVerify",{email:this.refs.email.value}).then(e=>{200===e.code&&t()})}submit(){if(this.refs.password.value!==this.refs.repassword.value)return r["a"]["error"]({message:"\u8bf7\u6c42\u9519\u8bef",description:"\u4e24\u6b21\u5bc6\u7801\u8f93\u5165\u4e0d\u540c",duration:1.5});Object(o["b"])("/passport/register",{email:this.refs.email.value,password:this.refs.password.value,invite_code:this.refs.invite.value,email_code:this.refs.email_code.value}).then(e=>{200===e.code&&e.data&&i.a.push("/login")})}render(){return l.a.createElement("div",{id:"page-container"},l.a.createElement("main",{id:"main-container"},l.a.createElement("div",{className:"row no-gutters justify-content-center bg-body-dark"},l.a.createElement("div",{className:"hero-static col-sm-10 col-md-6 col-xl-4 d-flex align-items-center p-2"},l.a.createElement("div",{className:"block block-rounded block-transparent block-fx-pop w-100 mb-0 overflow-hidden bg-image"},l.a.createElement("div",{className:"row no-gutters"},l.a.createElement("div",{className:"col-md-12 order-md-1 bg-white"},l.a.createElement("div",{className:"block-content block-content-full px-lg-4 py-md-4 py-lg-4"},l.a.createElement("div",{className:"mb-2 text-center"},l.a.createElement("a",{className:"link-fx font-w700 font-size-h1",href:"index.html"},l.a.createElement("span",{className:"text-dark"},window.v2board.title?window.v2board.title:"V2Board")),l.a.createElement("p",{className:"text-uppercase font-w700 font-size-sm text-muted"},"\u8be5\u9875\u9762\u662f\u88ab\u52a0\u5bc6\u7684")),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1",ref:"email"})),l.a.createElement("div",{className:"form-group form-row"},l.a.createElement("div",{className:"col-9"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1\u9a8c\u8bc1\u7801",ref:"email_code"})),l.a.createElement("div",{className:"col-3"},l.a.createElement("button",{type:"submit",disabled:60!==this.state.sendEmailVerifyTimeout,className:"btn btn-block btn-primary",onClick:()=>this.sendEmailVerify()},60===this.state.sendEmailVerifyTimeout?"\u53d1\u9001":this.state.sendEmailVerifyTimeout))),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"password"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"repassword"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("button",{type:"submit",className:"btn btn-block btn-hero-primary",onClick:()=>this.submit()},l.a.createElement("i",{className:"fa fa-fw fa-life-ring mr-1"}),"\u91cd\u7f6e\u5bc6\u7801")),l.a.createElement("div",{className:"text-center mt-3"},l.a.createElement("a",{className:"font-w700 font-size-sm text-muted",href:"javascript:;",onClick:()=>i.a.push("/login")},"\u8fd4\u56de\u767b\u9646"))))))))))}}}}]); \ No newline at end of file diff --git a/public/p__login.async.js b/public/p__login.async.js index b2059df7..2043485a 100644 --- a/public/p__login.async.js +++ b/public/p__login.async.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[13],{SGa5:function(e,t,a){"use strict";a.r(t);a("Pwec");var n=a("CtXQ"),s=a("q1tI"),o=a.n(s),l=a("/MKj"),r=a("3a4m"),c=a.n(r);a("t3Un");class i extends o.a.Component{constructor(){super(...arguments),this.state={loading:!1}}componentDidMount(){}onLogin(){this.setState({loading:!0}),this.props.dispatch({type:"auth/login",action:{email:this.refs.email.value,password:this.refs.password.value},complete:e=>{if(console.log(e.code),200!==e.code)return this.setState({loading:!1});e.data&&(this.setState({loading:!1}),c.a.push("/dashboard"),this.props.dispatch({type:"header/getUserInfo"}))}})}render(){return o.a.createElement("div",{id:"page-container"},o.a.createElement("main",{id:"main-container"},o.a.createElement("div",{className:"row no-gutters justify-content-center bg-body-dark"},o.a.createElement("div",{className:"hero-static col-sm-10 col-md-6 col-xl-4 d-flex align-items-center p-2"},o.a.createElement("div",{className:"block block-rounded block-transparent block-fx-pop w-100 mb-0 overflow-hidden bg-image"},o.a.createElement("div",{className:"row no-gutters"},o.a.createElement("div",{className:"col-md-12 order-md-1 bg-white"},o.a.createElement("div",{className:"block-content block-content-full px-lg-4 py-md-4 py-lg-4"},o.a.createElement("div",{className:"mb-2 text-center"},o.a.createElement("a",{className:"link-fx font-w700 font-size-h1",href:"index.html"},o.a.createElement("span",{className:"text-dark"},window.v2board.title?window.v2board.title:"V2Board")),o.a.createElement("p",{className:"text-uppercase font-w700 font-size-sm text-muted"},"\u8be5\u9875\u9762\u662f\u88ab\u52a0\u5bc6\u7684")),o.a.createElement("div",{className:"form-group"},o.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1",ref:"email"})),o.a.createElement("div",{className:"form-group"},o.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"password"})),o.a.createElement("div",{className:"form-group"},o.a.createElement("button",{disabled:this.state.loading,type:"submit",className:"btn btn-block btn-hero-primary",onClick:()=>this.onLogin()},this.state.loading?o.a.createElement(n["a"],{type:"loading"}):o.a.createElement("span",null,o.a.createElement("i",{className:"fa fa-fw fa-sign-in-alt mr-1"}),"\u767b\u9646")),o.a.createElement("div",{className:"text-center mt-3"},o.a.createElement("a",{className:"font-w700 font-size-sm text-muted",href:"javascript:;",onClick:()=>c.a.push("/forgetpassword")},"\u5fd8\u8bb0\u5bc6\u7801?")))))))))))}}t["default"]=Object(l["c"])()(i)}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[13],{SGa5:function(e,t,a){"use strict";a.r(t);a("/zsF");var s=a("PArb"),n=(a("Pwec"),a("CtXQ")),o=a("q1tI"),l=a.n(o),r=a("/MKj"),c=a("3a4m"),i=a.n(c);a("t3Un");class m extends l.a.Component{constructor(){super(...arguments),this.state={loading:!1}}componentDidMount(){}onLogin(){this.setState({loading:!0}),this.props.dispatch({type:"auth/login",action:{email:this.refs.email.value,password:this.refs.password.value},complete:e=>{if(console.log(e.code),200!==e.code)return this.setState({loading:!1});e.data&&(this.setState({loading:!1}),i.a.push("/dashboard"),this.props.dispatch({type:"header/getUserInfo"}))}})}render(){return l.a.createElement("div",{id:"page-container"},l.a.createElement("main",{id:"main-container"},l.a.createElement("div",{className:"row no-gutters justify-content-center bg-body-dark"},l.a.createElement("div",{className:"hero-static col-sm-10 col-md-6 col-xl-4 d-flex align-items-center p-2"},l.a.createElement("div",{className:"block block-rounded block-transparent block-fx-pop w-100 mb-0 overflow-hidden bg-image"},l.a.createElement("div",{className:"row no-gutters"},l.a.createElement("div",{className:"col-md-12 order-md-1 bg-white"},l.a.createElement("div",{className:"block-content block-content-full px-lg-4 py-md-4 py-lg-4"},l.a.createElement("div",{className:"mb-2 text-center"},l.a.createElement("a",{className:"link-fx font-w700 font-size-h1",href:"index.html"},l.a.createElement("span",{className:"text-dark"},window.v2board.title?window.v2board.title:"V2Board")),l.a.createElement("p",{className:"text-uppercase font-w700 font-size-sm text-muted"},"\u8be5\u9875\u9762\u662f\u88ab\u52a0\u5bc6\u7684")),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1",ref:"email"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"password"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("button",{disabled:this.state.loading,type:"submit",className:"btn btn-block btn-hero-primary",onClick:()=>this.onLogin()},this.state.loading?l.a.createElement(n["a"],{type:"loading"}):l.a.createElement("span",null,l.a.createElement("i",{className:"fa fa-fw fa-sign-in-alt mr-1"}),"\u767b\u9646")),l.a.createElement("div",{className:"text-center mt-3"},l.a.createElement("a",{className:"font-w700 font-size-sm text-muted",href:"javascript:;",onClick:()=>i.a.push("/forgetpassword")},"\u6ce8\u518c"),l.a.createElement(s["a"],{type:"vertical"}),l.a.createElement("a",{className:"font-w700 font-size-sm text-muted",href:"javascript:;",onClick:()=>i.a.push("/forgetpassword")},"\u5fd8\u8bb0\u5bc6\u7801")))))))))))}}t["default"]=Object(r["c"])()(m)}}]); \ No newline at end of file diff --git a/public/p__plan.async.js b/public/p__plan.async.js index 42444108..a1ef30b1 100644 --- a/public/p__plan.async.js +++ b/public/p__plan.async.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[16],{Bl7J:function(e,a,t){"use strict";var n=t("q1tI"),i=t.n(n),s=t("3a4m"),l=t.n(s),r=t("/MKj"),c=t("20nU"),o=t("yWgo");class m extends i.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],a=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7ad9\u70b9\u914d\u7f6e",type:"item",href:"/admin/config/site",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})}];Object(o["b"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:a}):this.setState({nav:e})}renderMenu(e,a,t,n){switch(e){case"heading":return i.a.createElement("li",{className:"nav-main-heading"},a);case"item":return i.a.createElement("li",{className:"nav-main-item"},i.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===t&&"active"),onClick:()=>{l.a.push(t),this.props.dispatch({type:"header/showNav"})}},n&&n,i.a.createElement("span",{className:"nav-main-link-name"},a)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return i.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},i.a.createElement("div",{className:"smini-visible-block"},i.a.createElement("div",{className:"content-header bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},"X"),i.a.createElement("span",{className:"text-white"},"H")))),i.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},i.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),i.a.createElement("div",{className:"d-lg-none"},i.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-times-circle"}))))),i.a.createElement("div",{className:"content-side content-side-full"},i.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(r["c"])(e=>{var a=e.header;return{header:a}})(m),h=t("t3Un");class p extends i.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(a){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(h["a"])("/user/logout").then(e=>{l.a.push("/login")})}render(){return i.a.createElement("header",{id:"page-header"},i.a.createElement("div",{className:"content-header"},i.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"none":"block"}},i.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-fw fa-bars"}))),this.props.search&&i.a.createElement("div",null,i.a.createElement("input",{type:"text",className:"form-control rounded-lg px-4",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value)})),i.a.createElement("div",null,this.state.loading?i.a.createElement("div",{className:"spinner-grow text-primary"}):i.a.createElement("div",{className:"dropdown d-inline-block"},i.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},i.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),i.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),i.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),i.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},i.a.createElement("div",{className:"p-2"},i.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:;",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",i.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))))}}var v=Object(r["c"])(e=>{var a=e.header;return{header:a}})(p);class u extends i.a.Component{render(){return i.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},i.a.createElement("div",{className:"content py-0"},i.a.createElement("div",{className:"row font-size-sm"},i.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},i.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),i.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},i.a.createElement("a",{className:"font-w600",href:"/",target:"_blank"},"V2Board v0.1"),i.a.createElement("span",{"data-toggle":"year-copy"})))))}}class g extends i.a.Component{render(){return i.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},i.a.createElement(d,this.props),i.a.createElement(v,{search:this.props.search}),this.props.loading?i.a.createElement("main",{id:"main-container"},i.a.createElement("div",{className:"content content-full"},i.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},i.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,i.a.createElement(u,null))}}a["a"]=Object(r["c"])(e=>{var a=e.header;return{header:a}})(g)},ih8c:function(e,a,t){"use strict";t.r(a);var n=t("jehZ"),i=t.n(n),s=t("q1tI"),l=t.n(s),r=t("Bl7J"),c=t("/MKj"),o=t("t3Un"),m=t("3a4m"),d=t.n(m);class h extends l.a.Component{constructor(){super(...arguments),this.state={plan:[],loading:!0}}componentDidMount(){Object(o["a"])("/guest/plan").then(e=>{this.setState({plan:e.data,loading:!1})})}render(){return l.a.createElement(r["a"],i()({},this.props,{loading:this.state.loading}),l.a.createElement("main",{id:"main-container"},l.a.createElement("div",{className:"content content-full"},l.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u9009\u62e9\u8ba2\u9605"),l.a.createElement("div",{className:"row"},this.state.plan.map(e=>{return l.a.createElement("div",{className:"col-md-6 col-xl-4 animated fadeInUp"},l.a.createElement("a",{className:"block block-link-pop block-rounded block-bordered text-center",href:"javascript:void(0)",onClick:()=>d.a.push("/plan/".concat(e.id))},l.a.createElement("div",{className:"block-header"},l.a.createElement("h3",{className:"block-title"},e.name)),l.a.createElement("div",{className:"block-content bg-body-light"},l.a.createElement("div",{className:"py-2"},l.a.createElement("p",{className:"h1 font-w700 mb-2"},"\xa5 ",(e.month_price/100).toFixed(2)),l.a.createElement("p",{className:"h6 text-muted"},"\u6bcf\u6708"))),l.a.createElement("div",{className:"block-content"},l.a.createElement("div",{className:"py-2",dangerouslySetInnerHTML:{__html:e.content}})),l.a.createElement("div",{className:"block-content block-content-full bg-body-light"},l.a.createElement("span",{className:"btn btn-hero-primary px-4"},l.a.createElement("i",{className:"fa fa-thumbs-up mr-1"}),"\u7acb\u5373\u8ba2\u9605"))))})))))}}a["default"]=Object(c["c"])()(h)}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[16],{Bl7J:function(e,a,t){"use strict";var n=t("q1tI"),i=t.n(n),s=t("3a4m"),r=t.n(s),l=t("/MKj"),c=t("20nU"),o=t("yWgo");class m extends i.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],a=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7ad9\u70b9\u914d\u7f6e",type:"item",href:"/admin/config/site",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})}];Object(o["b"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:a}):this.setState({nav:e})}renderMenu(e,a,t,n){switch(e){case"heading":return i.a.createElement("li",{className:"nav-main-heading"},a);case"item":return i.a.createElement("li",{className:"nav-main-item"},i.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===t&&"active"),onClick:()=>{r.a.push(t),this.props.dispatch({type:"header/showNav"})}},n&&n,i.a.createElement("span",{className:"nav-main-link-name"},a)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return i.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},i.a.createElement("div",{className:"smini-visible-block"},i.a.createElement("div",{className:"content-header bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},"X"),i.a.createElement("span",{className:"text-white"},"H")))),i.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},i.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),i.a.createElement("div",{className:"d-lg-none"},i.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-times-circle"}))))),i.a.createElement("div",{className:"content-side content-side-full"},i.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(l["c"])(e=>{var a=e.header;return{header:a}})(m),p=t("t3Un");class h extends i.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(a){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(p["a"])("/user/logout").then(e=>{r.a.push("/login")})}render(){return i.a.createElement("header",{id:"page-header"},i.a.createElement("div",{className:"content-header"},i.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"none":"block"}},i.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-fw fa-bars"}))),this.props.search&&i.a.createElement("div",null,i.a.createElement("input",{type:"text",className:"form-control rounded-lg px-4",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value)})),i.a.createElement("div",null,this.state.loading?i.a.createElement("div",{className:"spinner-grow text-primary"}):i.a.createElement("div",{className:"dropdown d-inline-block"},i.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},i.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),i.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),i.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),i.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},i.a.createElement("div",{className:"p-2"},i.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:;",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",i.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))))}}var u=Object(l["c"])(e=>{var a=e.header;return{header:a}})(h);class v extends i.a.Component{render(){return i.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},i.a.createElement("div",{className:"content py-0"},i.a.createElement("div",{className:"row font-size-sm"},i.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},i.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),i.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},i.a.createElement("a",{className:"font-w600",href:"/",target:"_blank"},"V2Board v0.1"),i.a.createElement("span",{"data-toggle":"year-copy"})))))}}class g extends i.a.Component{render(){return i.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},i.a.createElement(d,this.props),i.a.createElement(u,{search:this.props.search}),this.props.loading?i.a.createElement("main",{id:"main-container"},i.a.createElement("div",{className:"content content-full"},i.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},i.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,i.a.createElement(v,null))}}a["a"]=Object(l["c"])(e=>{var a=e.header;return{header:a}})(g)},ih8c:function(e,a,t){"use strict";t.r(a);var n=t("jehZ"),i=t.n(n),s=t("q1tI"),r=t.n(s),l=t("Bl7J"),c=t("/MKj"),o=t("t3Un"),m=t("3a4m"),d=t.n(m);class p extends r.a.Component{constructor(){super(...arguments),this.state={plan:[],loading:!0}}componentDidMount(){Object(o["a"])("/guest/plan").then(e=>{this.setState({plan:e.data,loading:!1})})}getUnitPriceTag(e){return e.month_price?{tag:"\u6708\u4ed8",price:e.month_price}:e.quarter_price?{tag:"\u5b63\u4ed8",price:e.quarter_price}:e.half_year_price?{tag:"\u534a\u5e74\u4ed8",price:e.half_year_price}:e.year_price?{tag:"\u5e74\u4ed8",price:e.year_price}:void 0}render(){return r.a.createElement(l["a"],i()({},this.props,{loading:this.state.loading}),r.a.createElement("main",{id:"main-container"},r.a.createElement("div",{className:"content content-full"},r.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u9009\u62e9\u8ba2\u9605"),r.a.createElement("div",{className:"row"},this.state.plan.map(e=>{return r.a.createElement("div",{className:"col-md-6 col-xl-4 animated fadeInUp"},r.a.createElement("a",{className:"block block-link-pop block-rounded block-bordered text-center",href:"javascript:void(0)",onClick:()=>d.a.push("/plan/".concat(e.id))},r.a.createElement("div",{className:"block-header"},r.a.createElement("h3",{className:"block-title"},e.name)),r.a.createElement("div",{className:"block-content bg-body-light"},r.a.createElement("div",{className:"py-2"},r.a.createElement("p",{className:"h1 font-w700 mb-2"},"\xa5 ",(this.getUnitPriceTag(e).price/100).toFixed(2)),r.a.createElement("p",{className:"h6 text-muted"},this.getUnitPriceTag(e).tag))),r.a.createElement("div",{className:"block-content"},r.a.createElement("div",{className:"py-2",dangerouslySetInnerHTML:{__html:e.content}})),r.a.createElement("div",{className:"block-content block-content-full bg-body-light"},r.a.createElement("span",{className:"btn btn-hero-primary px-4"},r.a.createElement("i",{className:"fa fa-thumbs-up mr-1"}),"\u7acb\u5373\u8ba2\u9605"))))})))))}}a["default"]=Object(c["c"])()(p)}}]); \ No newline at end of file diff --git a/public/p__plan__$plan_id.async.js b/public/p__plan__$plan_id.async.js index 064a273d..88eb8e23 100644 --- a/public/p__plan__$plan_id.async.js +++ b/public/p__plan__$plan_id.async.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[17],{"+URf":function(e,a,t){"use strict";t.r(a);var n=t("jehZ"),i=t.n(n),s=(t("Pwec"),t("CtXQ")),l=(t("7Kak"),t("9yH6")),r=t("p0pE"),c=t.n(r),o=t("q1tI"),m=t.n(o),d=t("Bl7J"),h=t("/MKj"),p=t("t3Un"),u=t("LbTH"),v=t("3a4m"),b=t.n(v);class g extends m.a.Component{constructor(){super(...arguments),this.state={submit:{plan_id:this.props.match.params.plan_id,cycle:"month_price"},loading:!1,layout_login:!0}}componentDidMount(){Object(p["b"])("/user/plan/info",{plan_id:this.props.match.params.plan_id}).then(e=>{200===e.code&&this.setState(c()({},e.data,{layout_login:!1}))})}submit(){this.setState({loading:!0},()=>{Object(p["b"])("/user/order/save",this.state.submit).then(e=>{if(200!==e.code)return this.setState({loading:!1});this.setState({loading:!1}),b.a.push("/order/"+e.data)})})}submitOnChange(e,a){this.setState({submit:c()({},this.state.submit,{[e]:a})})}render(){return m.a.createElement(d["a"],i()({},this.props,{loading:this.state.layout_login}),m.a.createElement("main",{id:"main-container"},m.a.createElement("div",{className:"content content-full"},m.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u914d\u7f6e\u8ba2\u9605"),m.a.createElement("div",{className:"row",id:"cashier"},m.a.createElement("div",{className:"col-md-8 col-sm-12"},m.a.createElement("div",{className:"block block-link-pop block-rounded block-bordered px-3 py-3 block-fx-shadow"},m.a.createElement("h4",null,this.state.name),m.a.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.content}})),m.a.createElement("h3",{className:"font-w300 mt-4 mb-3"},"\u4ed8\u6b3e\u5468\u671f"),m.a.createElement("div",{className:"mb-3"},m.a.createElement(l["a"].Group,{defaultValue:this.state.submit.cycle,size:"large",onChange:e=>this.submitOnChange("cycle",e.target.value)},m.a.createElement(l["a"].Button,{value:"month_price"},"\u6708\u4ed8"),m.a.createElement(l["a"].Button,{value:"quarter_price"},"\u5b63\u4ed8"),m.a.createElement(l["a"].Button,{value:"half_year_price"},"\u534a\u5e74\u4ed8"),m.a.createElement(l["a"].Button,{value:"year_price"},"\u5e74\u4ed8")))),m.a.createElement("div",{className:"col-md-4 col-sm-12"},m.a.createElement("div",{className:"block block-link-pop block-rounded block-bordered px-3 py-3 text-light",style:{background:"#35383D"}},m.a.createElement("h5",{className:"text-light mb-3"},"\u8ba2\u5355\u603b\u989d"),m.a.createElement("div",{className:"row no-gutters pb-3",style:{borderBottom:"1px solid #646669"}},m.a.createElement("div",{className:"col-8"},this.state.name," x ",u["a"].cycleText[this.state.submit.cycle]),m.a.createElement("div",{className:"col-4 text-right"},"\xa5",0===this.state.type?(this.state.price/100).toFixed(2):(this.state[this.state.submit.cycle]/100).toFixed(2))),m.a.createElement("div",{className:"pt-3",style:{color:"#646669"}},"\u603b\u8ba1"),m.a.createElement("h1",{className:"text-light mt-3 mb-3"},"\xa5 ",(this.state[this.state.submit.cycle]/100).toFixed(2)," CNY"),m.a.createElement("button",{type:"button",className:"btn btn-block btn-primary",disabled:this.state.loading,onClick:()=>this.submit()},this.state.loading?m.a.createElement(s["a"],{type:"loading"}):m.a.createElement("span",null,m.a.createElement("i",{className:"far fa-check-circle"})," \u4e0b\u5355"))))))))}}a["default"]=Object(h["c"])()(g)},Bl7J:function(e,a,t){"use strict";var n=t("q1tI"),i=t.n(n),s=t("3a4m"),l=t.n(s),r=t("/MKj"),c=t("20nU"),o=t("yWgo");class m extends i.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],a=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7ad9\u70b9\u914d\u7f6e",type:"item",href:"/admin/config/site",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})}];Object(o["b"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:a}):this.setState({nav:e})}renderMenu(e,a,t,n){switch(e){case"heading":return i.a.createElement("li",{className:"nav-main-heading"},a);case"item":return i.a.createElement("li",{className:"nav-main-item"},i.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===t&&"active"),onClick:()=>{l.a.push(t),this.props.dispatch({type:"header/showNav"})}},n&&n,i.a.createElement("span",{className:"nav-main-link-name"},a)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return i.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},i.a.createElement("div",{className:"smini-visible-block"},i.a.createElement("div",{className:"content-header bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},"X"),i.a.createElement("span",{className:"text-white"},"H")))),i.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},i.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),i.a.createElement("div",{className:"d-lg-none"},i.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-times-circle"}))))),i.a.createElement("div",{className:"content-side content-side-full"},i.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(r["c"])(e=>{var a=e.header;return{header:a}})(m),h=t("t3Un");class p extends i.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(a){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(h["a"])("/user/logout").then(e=>{l.a.push("/login")})}render(){return i.a.createElement("header",{id:"page-header"},i.a.createElement("div",{className:"content-header"},i.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"none":"block"}},i.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-fw fa-bars"}))),this.props.search&&i.a.createElement("div",null,i.a.createElement("input",{type:"text",className:"form-control rounded-lg px-4",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value)})),i.a.createElement("div",null,this.state.loading?i.a.createElement("div",{className:"spinner-grow text-primary"}):i.a.createElement("div",{className:"dropdown d-inline-block"},i.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},i.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),i.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),i.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),i.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},i.a.createElement("div",{className:"p-2"},i.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:;",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",i.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))))}}var u=Object(r["c"])(e=>{var a=e.header;return{header:a}})(p);class v extends i.a.Component{render(){return i.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},i.a.createElement("div",{className:"content py-0"},i.a.createElement("div",{className:"row font-size-sm"},i.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},i.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),i.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},i.a.createElement("a",{className:"font-w600",href:"/",target:"_blank"},"V2Board v0.1"),i.a.createElement("span",{"data-toggle":"year-copy"})))))}}class b extends i.a.Component{render(){return i.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},i.a.createElement(d,this.props),i.a.createElement(u,{search:this.props.search}),this.props.loading?i.a.createElement("main",{id:"main-container"},i.a.createElement("div",{className:"content content-full"},i.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},i.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,i.a.createElement(v,null))}}a["a"]=Object(r["c"])(e=>{var a=e.header;return{header:a}})(b)},LbTH:function(e,a,t){"use strict";a["a"]={cycleText:{month_price:"\u6708\u4ed8",quarter_price:"\u5b63\u4ed8",half_year_price:"\u534a\u5e74\u4ed8",year_price:"\u5e74\u4ed8"},orderStatusText:["\u5f85\u652f\u4ed8","\u5f00\u901a\u4e2d","\u5df2\u53d6\u6d88","\u5df2\u5b8c\u6210"]}}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[17],{"+URf":function(e,a,t){"use strict";t.r(a);var n=t("jehZ"),i=t.n(n),s=(t("Pwec"),t("CtXQ")),r=(t("7Kak"),t("9yH6")),l=t("p0pE"),c=t.n(l),o=t("q1tI"),m=t.n(o),d=t("Bl7J"),h=t("/MKj"),p=t("t3Un"),u=t("LbTH"),v=t("3a4m"),b=t.n(v);class g extends m.a.Component{constructor(){super(...arguments),this.state={submit:{plan_id:this.props.match.params.plan_id,cycle:"month_price"},loading:!1,layout_login:!0}}componentDidMount(){Object(p["b"])("/user/plan/info",{plan_id:this.props.match.params.plan_id}).then(e=>{200===e.code&&this.setState(c()({},e.data,{layout_login:!1}))})}submit(){this.setState({loading:!0},()=>{Object(p["b"])("/user/order/save",this.state.submit).then(e=>{if(200!==e.code)return this.setState({loading:!1});this.setState({loading:!1}),b.a.push("/order/"+e.data)})})}submitOnChange(e,a){this.setState({submit:c()({},this.state.submit,{[e]:a})})}render(){return console.log(this.state),m.a.createElement(d["a"],i()({},this.props,{loading:this.state.layout_login}),m.a.createElement("main",{id:"main-container"},m.a.createElement("div",{className:"content content-full"},m.a.createElement("h2",{className:"font-w300 mt-4 mb-3"},"\u914d\u7f6e\u8ba2\u9605"),m.a.createElement("div",{className:"row",id:"cashier"},m.a.createElement("div",{className:"col-md-8 col-sm-12"},m.a.createElement("div",{className:"block block-link-pop block-rounded block-bordered px-3 py-3 block-fx-shadow"},m.a.createElement("h4",null,this.state.name),m.a.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.content}})),m.a.createElement("h3",{className:"font-w300 mt-4 mb-3"},"\u4ed8\u6b3e\u5468\u671f"),m.a.createElement("div",{className:"mb-3"},m.a.createElement(r["a"].Group,{defaultValue:this.state.submit.cycle,size:"large",onChange:e=>this.submitOnChange("cycle",e.target.value)},this.state.month_price?m.a.createElement(r["a"].Button,{value:"month_price"},"\u6708\u4ed8"):"",this.state.quarter_price?m.a.createElement(r["a"].Button,{value:"quarter_price"},"\u5b63\u4ed8"):"",this.state.half_year_price?m.a.createElement(r["a"].Button,{value:"half_year_price"},"\u534a\u5e74\u4ed8"):"",this.state.year_price?m.a.createElement(r["a"].Button,{value:"year_price"},"\u5e74\u4ed8"):""))),m.a.createElement("div",{className:"col-md-4 col-sm-12"},m.a.createElement("div",{className:"block block-link-pop block-rounded block-bordered px-3 py-3 text-light",style:{background:"#35383D"}},m.a.createElement("h5",{className:"text-light mb-3"},"\u8ba2\u5355\u603b\u989d"),m.a.createElement("div",{className:"row no-gutters pb-3",style:{borderBottom:"1px solid #646669"}},m.a.createElement("div",{className:"col-8"},this.state.name," x ",u["a"].cycleText[this.state.submit.cycle]),m.a.createElement("div",{className:"col-4 text-right"},"\xa5",0===this.state.type?(this.state.price/100).toFixed(2):(this.state[this.state.submit.cycle]/100).toFixed(2))),m.a.createElement("div",{className:"pt-3",style:{color:"#646669"}},"\u603b\u8ba1"),m.a.createElement("h1",{className:"text-light mt-3 mb-3"},"\xa5 ",(this.state[this.state.submit.cycle]/100).toFixed(2)," CNY"),m.a.createElement("button",{type:"button",className:"btn btn-block btn-primary",disabled:this.state.loading,onClick:()=>this.submit()},this.state.loading?m.a.createElement(s["a"],{type:"loading"}):m.a.createElement("span",null,m.a.createElement("i",{className:"far fa-check-circle"})," \u4e0b\u5355"))))))))}}a["default"]=Object(h["c"])()(g)},Bl7J:function(e,a,t){"use strict";var n=t("q1tI"),i=t.n(n),s=t("3a4m"),r=t.n(s),l=t("/MKj"),c=t("20nU"),o=t("yWgo");class m extends i.a.Component{constructor(){super(...arguments),this.state={nav:[]}}componentDidMount(){var e=[{title:"\u4eea\u8868\u76d8",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-speedometer"})},{title:"\u8ba2\u9605",type:"heading"},{title:"\u6211\u7684\u8ba2\u9605",type:"item",href:"/subscribe",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-badge"})},{title:"\u8d2d\u4e70\u8ba2\u9605",type:"item",href:"/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u6211\u7684\u8ba2\u5355",type:"item",href:"/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u6211\u7684\u9080\u8bf7",type:"item",href:"/invite",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})},{title:"\u7528\u6237",type:"heading"},{title:"\u4e2a\u4eba\u4e2d\u5fc3",type:"item",href:"/profile",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-user"})},{title:"\u4f7f\u7528\u6559\u7a0b",type:"item",href:"/tutorial",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-book-open"})}],a=[{title:"\u8fd4\u56de\u7528\u6237\u4e2d\u5fc3",type:"item",href:"/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})},{title:"\u8bbe\u7f6e",type:"heading"},{title:"\u7ad9\u70b9\u914d\u7f6e",type:"item",href:"/admin/config/site",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-equalizer"})},{title:"\u652f\u4ed8\u914d\u7f6e",type:"item",href:"/admin/config/payment",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-credit-card"})},{title:"\u670d\u52a1\u5668",type:"heading"},{title:"\u8282\u70b9\u7ba1\u7406",type:"item",href:"/admin/server",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-vector"})},{title:"\u6743\u9650\u7ec4\u7ba1\u7406",type:"item",href:"/admin/server/group",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-wrench"})},{title:"\u8d22\u52a1",type:"heading"},{title:"\u8ba2\u9605\u7ba1\u7406",type:"item",href:"/admin/plan",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-bag"})},{title:"\u8ba2\u5355\u7ba1\u7406",type:"item",href:"/admin/order",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-list"})},{title:"\u7528\u6237",type:"heading"},{title:"\u7528\u6237\u7ba1\u7406",type:"item",href:"/admin/user",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-users"})}];Object(o["b"])("is_admin")&&e.unshift({title:"\u8fd4\u56de\u7ba1\u7406\u4e2d\u5fc3",type:"item",href:"/admin/dashboard",icon:i.a.createElement("i",{className:"nav-main-link-icon si si-action-undo"})}),this.isAdmin()?this.setState({nav:a}):this.setState({nav:e})}renderMenu(e,a,t,n){switch(e){case"heading":return i.a.createElement("li",{className:"nav-main-heading"},a);case"item":return i.a.createElement("li",{className:"nav-main-item"},i.a.createElement("a",{className:"nav-main-link ".concat(this.props.location.pathname===t&&"active"),onClick:()=>{r.a.push(t),this.props.dispatch({type:"header/showNav"})}},n&&n,i.a.createElement("span",{className:"nav-main-link-name"},a)))}}isAdmin(){return-1!==this.props.location.pathname.indexOf("admin")}render(){return i.a.createElement("nav",{id:"sidebar","aria-label":"Main Navigation"},i.a.createElement("div",{className:"smini-visible-block"},i.a.createElement("div",{className:"content-header bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},"X"),i.a.createElement("span",{className:"text-white"},"H")))),i.a.createElement("div",{className:"smini-hidden ".concat(1===c["a"].theme?"":"bg-header-dark")},i.a.createElement("div",{className:"content-header justify-content-lg-center bg-black-10"},i.a.createElement("a",{className:"link-fx font-size-lg text-white",href:"index.html"},i.a.createElement("span",{className:"text-white-75"},window.v2board.title?window.v2board.title:"V2Board")),i.a.createElement("div",{className:"d-lg-none"},i.a.createElement("a",{className:"text-white ml-2","data-toggle":"layout","data-action":"sidebar_close",href:"javascript:void(0)",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-times-circle"}))))),i.a.createElement("div",{className:"content-side content-side-full"},i.a.createElement("ul",{className:"nav-main"},this.state.nav.map(e=>{return this.renderMenu(e.type,e.title,e.href,e.icon)}))))}}var d=Object(l["c"])(e=>{var a=e.header;return{header:a}})(m),h=t("t3Un");class p extends i.a.Component{constructor(){super(...arguments),this.state={showAvatarMenu:!1,loading:!1}}componentDidMount(){var e=this;this.props.header.userInfo.email||this.setState({loading:!0},()=>{this.props.dispatch({type:"header/getUserInfo",complete:()=>e.setState({loading:!1})})})}showAvatarMenu(){var e=this;this.setState({showAvatarMenu:!this.state.showAvatarMenu},()=>{document.onclick=function(a){e.state.showAvatarMenu&&e.setState({showAvatarMenu:!1}),document.onclick=void 0}})}logout(){Object(h["a"])("/user/logout").then(e=>{r.a.push("/login")})}render(){return i.a.createElement("header",{id:"page-header"},i.a.createElement("div",{className:"content-header"},i.a.createElement("div",{className:"sidebar-toggle",style:{display:this.props.search?"none":"block"}},i.a.createElement("button",{type:"button",className:"btn btn-dual mr-1 d-lg-none","data-toggle":"layout","data-action":"sidebar_toggle",onClick:()=>this.props.dispatch({type:"header/showNav"})},i.a.createElement("i",{className:"fa fa-fw fa-bars"}))),this.props.search&&i.a.createElement("div",null,i.a.createElement("input",{type:"text",className:"form-control rounded-lg px-4",placeholder:this.props.search.placeholder,onChange:e=>this.props.search.onChange(e.target.value)})),i.a.createElement("div",null,this.state.loading?i.a.createElement("div",{className:"spinner-grow text-primary"}):i.a.createElement("div",{className:"dropdown d-inline-block"},i.a.createElement("button",{type:"button",className:"btn btn-dual",id:"page-header-user-dropdown","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",onClick:()=>this.showAvatarMenu()},i.a.createElement("img",{className:"img-avatar img-avatar32 img-avatar-thumb",src:this.props.header.userInfo.avatar_url,alt:""}),i.a.createElement("span",{className:"d-none d-lg-inline ml-1"},this.props.header.userInfo.email),i.a.createElement("i",{className:"fa fa-fw fa-angle-down ml-1"})),i.a.createElement("div",{className:"dropdown-menu dropdown-menu-right dropdown-menu-lg p-0 ".concat(this.state.showAvatarMenu&&"show"),"aria-labelledby":"page-header-user-dropdown"},i.a.createElement("div",{className:"p-2"},i.a.createElement("a",{className:"dropdown-item d-flex justify-content-between align-items-center",href:"javascript:;",onClick:()=>this.logout()},"\u9000\u51fa\u767b\u5f55",i.a.createElement("i",{className:"fa fa-fw fa-sign-out-alt text-danger ml-1"}))))))))}}var u=Object(l["c"])(e=>{var a=e.header;return{header:a}})(p);class v extends i.a.Component{render(){return i.a.createElement("footer",{id:"page-footer",className:"bg-body-light"},i.a.createElement("div",{className:"content py-0"},i.a.createElement("div",{className:"row font-size-sm"},i.a.createElement("div",{className:"col-sm-6 order-sm-2 mb-1 mb-sm-0 text-center text-sm-right"},i.a.createElement("i",{className:"fa fa-heart text-danger"})," ",window.v2board.title?window.v2board.title:"V2Board"),i.a.createElement("div",{className:"col-sm-6 order-sm-1 text-center text-sm-left"},i.a.createElement("a",{className:"font-w600",href:"/",target:"_blank"},"V2Board v0.1"),i.a.createElement("span",{"data-toggle":"year-copy"})))))}}class b extends i.a.Component{render(){return i.a.createElement("div",{id:"page-container",className:"sidebar-o ".concat(1===c["a"].theme?"sidebar-dark":"page-header-dark"," side-scroll page-header-fixed main-content-boxed side-trans-enabled ").concat(this.props.header.showNav&&"sidebar-o-xs")},i.a.createElement(d,this.props),i.a.createElement(u,{search:this.props.search}),this.props.loading?i.a.createElement("main",{id:"main-container"},i.a.createElement("div",{className:"content content-full"},i.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},i.a.createElement("span",{className:"sr-only"},"Loading...")))):this.props.children,i.a.createElement(v,null))}}a["a"]=Object(l["c"])(e=>{var a=e.header;return{header:a}})(b)},LbTH:function(e,a,t){"use strict";a["a"]={cycleText:{month_price:"\u6708\u4ed8",quarter_price:"\u5b63\u4ed8",half_year_price:"\u534a\u5e74\u4ed8",year_price:"\u5e74\u4ed8"},orderStatusText:["\u5f85\u652f\u4ed8","\u5f00\u901a\u4e2d","\u5df2\u53d6\u6d88","\u5df2\u5b8c\u6210"]}}}]); \ No newline at end of file diff --git a/public/p__register.async.js b/public/p__register.async.js index 2601d23a..e1dddbc2 100644 --- a/public/p__register.async.js +++ b/public/p__register.async.js @@ -1 +1 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[19],{aSaP:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return d});a("/xke");var s=a("TeRw"),r=a("p0pE"),o=a.n(r),i=a("q1tI"),l=a.n(i),n=a("t3Un"),m=a("3a4m"),c=a.n(m);class d extends l.a.Component{constructor(){super(...arguments),this.state={isEmailVerify:!1,isInviteForce:!1,sendEmailVerifyTimeout:60}}componentDidMount(){this.props.location.query.code&&(this.refs.invite.value=this.props.location.query.code),Object(n["a"])("/passport/config").then(e=>{200===e.code&&this.setState(o()({},e.data))})}sendEmailVerify(){var e=this;function t(){setTimeout(()=>{0!==e.state.sendEmailVerifyTimeout?(e.setState({sendEmailVerifyTimeout:e.state.sendEmailVerifyTimeout-1}),t()):e.setState({sendEmailVerifyTimeout:60})},1e3)}Object(n["b"])("/passport/sendEmailVerify",{email:this.refs.email.value}).then(e=>{200===e.code&&t()})}submit(){if(this.refs.password.value!==this.refs.repassword.value)return s["a"]["error"]({message:"\u8bf7\u6c42\u9519\u8bef",description:"\u4e24\u6b21\u5bc6\u7801\u8f93\u5165\u4e0d\u540c",duration:1.5});Object(n["b"])("/passport/register",{email:this.refs.email.value,password:this.refs.password.value,invite_code:this.refs.invite.value,email_code:this.refs.email_code?this.refs.email_code.value:""}).then(e=>{200===e.code&&e.data&&c.a.push("/login")})}render(){return l.a.createElement("div",{id:"page-container"},l.a.createElement("main",{id:"main-container"},l.a.createElement("div",{className:"row no-gutters justify-content-center bg-body-dark"},l.a.createElement("div",{className:"hero-static col-sm-10 col-md-6 col-xl-4 d-flex align-items-center p-2"},l.a.createElement("div",{className:"block block-rounded block-transparent block-fx-pop w-100 mb-0 overflow-hidden bg-image"},l.a.createElement("div",{className:"row no-gutters"},l.a.createElement("div",{className:"col-md-12 order-md-1 bg-white"},l.a.createElement("div",{className:"block-content block-content-full px-lg-4 py-md-4 py-lg-4"},l.a.createElement("div",{className:"mb-2 text-center"},l.a.createElement("a",{className:"link-fx font-w700 font-size-h1",href:"index.html"},l.a.createElement("span",{className:"text-dark"},window.v2board.title?window.v2board.title:"V2Board")),l.a.createElement("p",{className:"text-uppercase font-w700 font-size-sm text-muted"},"\u8be5\u9875\u9762\u662f\u88ab\u52a0\u5bc6\u7684")),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1",ref:"email"})),this.state.isEmailVerify?l.a.createElement("div",{className:"form-group form-row"},l.a.createElement("div",{className:"col-9"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1\u9a8c\u8bc1\u7801",ref:"email_code"})),l.a.createElement("div",{className:"col-3"},l.a.createElement("button",{type:"submit",disabled:60!==this.state.sendEmailVerifyTimeout,className:"btn btn-block btn-primary",onClick:()=>this.sendEmailVerify()},60===this.state.sendEmailVerifyTimeout?"\u53d1\u9001":this.state.sendEmailVerifyTimeout))):"",l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"password"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"repassword"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:this.state.isInviteForce?"\u9080\u8bf7\u7801":"\u9080\u8bf7\u7801(\u9009\u586b)",ref:"invite"})),l.a.createElement("div",{className:"form-group"},l.a.createElement("button",{type:"submit",className:"btn btn-block btn-hero-primary",onClick:()=>this.submit()},l.a.createElement("i",{className:"fa fa-fw fa-smile mr-1"}),"\u6ce8\u518c"))))))))))}}}}]); \ No newline at end of file +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[19],{aSaP:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return d});a("/xke");var s=a("TeRw"),r=a("p0pE"),l=a.n(r),i=a("q1tI"),o=a.n(i),n=a("t3Un"),m=a("3a4m"),c=a.n(m);class d extends o.a.Component{constructor(){super(...arguments),this.state={isEmailVerify:!1,isInviteForce:!1,sendEmailVerifyTimeout:60,loading:!0}}componentDidMount(){this.props.location.query.code&&(this.refs.invite.value=this.props.location.query.code),Object(n["a"])("/passport/config").then(e=>{200===e.code&&this.setState(l()({},e.data),()=>{this.setState({loading:!1})})})}sendEmailVerify(){var e=this;function t(){setTimeout(()=>{0!==e.state.sendEmailVerifyTimeout?(e.setState({sendEmailVerifyTimeout:e.state.sendEmailVerifyTimeout-1}),t()):e.setState({sendEmailVerifyTimeout:60})},1e3)}Object(n["b"])("/passport/sendEmailVerify",{email:this.refs.email.value}).then(e=>{200===e.code&&t()})}submit(){if(this.refs.password.value!==this.refs.repassword.value)return s["a"]["error"]({message:"\u8bf7\u6c42\u9519\u8bef",description:"\u4e24\u6b21\u5bc6\u7801\u8f93\u5165\u4e0d\u540c",duration:1.5});Object(n["b"])("/passport/register",{email:this.refs.email.value,password:this.refs.password.value,invite_code:this.refs.invite.value,email_code:this.refs.email_code?this.refs.email_code.value:""}).then(e=>{200===e.code&&e.data&&c.a.push("/login")})}render(){return o.a.createElement("div",{id:"page-container"},o.a.createElement("main",{id:"main-container"},o.a.createElement("div",{className:"row no-gutters justify-content-center bg-body-dark"},o.a.createElement("div",{className:"hero-static col-sm-10 col-md-6 col-xl-4 d-flex align-items-center p-2"},o.a.createElement("div",{className:"block block-rounded block-transparent block-fx-pop w-100 mb-0 overflow-hidden bg-image"},o.a.createElement("div",{className:"row no-gutters"},o.a.createElement("div",{className:"col-md-12 order-md-1 bg-white"},o.a.createElement("div",{className:"block-content block-content-full px-lg-4 py-md-4 py-lg-4"},o.a.createElement("div",{className:"mb-2 text-center"},o.a.createElement("a",{className:"link-fx font-w700 font-size-h1",href:"index.html"},o.a.createElement("span",{className:"text-dark"},window.v2board.title?window.v2board.title:"V2Board")),o.a.createElement("p",{className:"text-uppercase font-w700 font-size-sm text-muted"},"\u8be5\u9875\u9762\u662f\u88ab\u52a0\u5bc6\u7684")),this.state.loading?o.a.createElement("div",{className:"content content-full text-center"},o.a.createElement("div",{className:"spinner-grow text-primary",role:"status"},o.a.createElement("span",{className:"sr-only"},"Loading..."))):o.a.createElement("div",null,o.a.createElement("div",{className:"form-group"},o.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1",ref:"email"})),this.state.isEmailVerify?o.a.createElement("div",{className:"form-group form-row"},o.a.createElement("div",{className:"col-9"},o.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:"\u90ae\u7bb1\u9a8c\u8bc1\u7801",ref:"email_code"})),o.a.createElement("div",{className:"col-3"},o.a.createElement("button",{type:"submit",disabled:60!==this.state.sendEmailVerifyTimeout,className:"btn btn-block btn-primary",onClick:()=>this.sendEmailVerify()},60===this.state.sendEmailVerifyTimeout?"\u53d1\u9001":this.state.sendEmailVerifyTimeout))):"",o.a.createElement("div",{className:"form-group"},o.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"password"})),o.a.createElement("div",{className:"form-group"},o.a.createElement("input",{type:"password",className:"form-control form-control-alt",placeholder:"\u5bc6\u7801",ref:"repassword"})),o.a.createElement("div",{className:"form-group"},o.a.createElement("input",{type:"text",className:"form-control form-control-alt",placeholder:this.state.isInviteForce?"\u9080\u8bf7\u7801":"\u9080\u8bf7\u7801(\u9009\u586b)",ref:"invite"})),o.a.createElement("div",{className:"form-group"},o.a.createElement("button",{type:"submit",className:"btn btn-block btn-hero-primary",onClick:()=>this.submit()},o.a.createElement("i",{className:"fa fa-fw fa-smile mr-1"}),"\u6ce8\u518c"))),o.a.createElement("div",{className:"text-center mt-3"},o.a.createElement("a",{className:"font-w700 font-size-sm text-muted",href:"javascript:;",onClick:()=>c.a.push("/login")},"\u8fd4\u56de\u767b\u9646"))))))))))}}}}]); \ No newline at end of file