提交 20e1f5dc 编写于 作者: 5 592767809

更新

上级 c626e86b
此差异已折叠。
此差异已折叠。
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{255:function(e,t,n){"use strict";n(112),n(37),n(54),n(30),n(111);var a=n(7),i=n(14),r=n(29),s=n(15);t.a={computed:{scoreTeamTypes:function(){return[{class:"home-team",name:"homeTeam",index:0},{class:"away-team",name:"awayTeam",index:1}]},scoreTeamTypesFull:function(){return[{class:"home-team",name:"homeTeam",index:0},{class:"line",name:"line",index:1},{class:"away-team",name:"awayTeam",index:2}]},hsSc2Players:function(){return[{class:"player-A",name:"playerA",index:0},{class:"player-B",name:"playerB",index:1}]},gameTypeClassName:function(){return"game-type-".concat(this.gameTypeLowerText)},gameProperty:function(){var e;return(e={},Object(a.a)(e,i.PBGameType.GT_LOL,"lolProperty"),Object(a.a)(e,i.PBGameType.GT_DOTA,"dotaProperty"),Object(a.a)(e,i.PBGameType.GT_CSGO,"csgoProperty"),Object(a.a)(e,i.PBGameType.GT_KOG,"kogProperty"),Object(a.a)(e,i.PBGameType.GT_PUBG,"pubgProperty"),Object(a.a)(e,i.PBGameType.GT_OW,"owProperty"),Object(a.a)(e,i.PBGameType.GT_RAINBOW,"rainbowProperty"),Object(a.a)(e,i.PBGameType.GT_HOS,"hosProperty"),Object(a.a)(e,i.PBGameType.GT_SC2,"sc2Property"),Object(a.a)(e,i.PBGameType.GT_ROCKET,"rocketProperty"),Object(a.a)(e,i.PBGameType.GT_HS,"hsProperty"),e)[this.gameType]||"lolProperty"},gameAchievementMap:function(){var e;return(e={},Object(a.a)(e,i.PBGameType.GT_LOL,[{key:"isFirstBlood",icon:"/webpc/1.3/icon_kill_first@2x.png",desc:"一血"},{key:"isFiveKills",icon:"/webpc/1.3/icon_kill_five@2x.png",desc:"五杀"},{key:"isFirstTower",icon:"/webpc/1.3/icon_tower@2x.png",desc:"首塔"},{key:"isFirstSmallDragon",icon:"/webpc/1.3/icon_small_dragon@2x.png",desc:"首小龙"},{key:"isFirstBigDragon",icon:"/webpc/1.3/icon_big_dragon@2x.png",desc:"首大龙"},{key:"isTenKills",icon:"/webpc/1.3/icon_kill_ten@2x.png",desc:"十杀"}]),Object(a.a)(e,i.PBGameType.GT_DOTA,[{key:"isFirstBlood",icon:"/webpc/1.3/icon_kill_first@2x.png",desc:"一血"},{key:"isFirstTower",icon:"/webpc/1.3/icon_tower@2x.png",desc:"首塔"},{key:"isFiveKills",icon:"/webpc/1.3/icon_kill_five@2x.png",desc:"五杀"},{key:"isTenKills",icon:"/webpc/1.3/icon_kill_ten@2x.png",desc:"十杀"}]),Object(a.a)(e,i.PBGameType.GT_CSGO,[{key:"isWinFirstRound",icon:"/webpc/1.3/icon_first_round_win@2x.png",desc:"上半场手枪局胜利"},{key:"isFirstWinFiveRounds",icon:"/webpc/1.3/icon_five_round_win@2x.png",desc:"先胜5回合"},{key:"isWinSixteenRound",icon:"/webpc/1.3/icon_last_round_win@2x.png",desc:"下半场手枪局胜利"}]),Object(a.a)(e,i.PBGameType.GT_KOG,[{key:"isFirstBlood",icon:"/webpc/1.3/icon_kill_first@2x.png",desc:"一血"},{key:"isFiveKills",icon:"/webpc/1.3/icon_kill_five@2x.png",desc:"五杀"},{key:"isFirstTower",icon:"/webpc/1.3/icon_tower@2x.png",desc:"首塔"},{key:"isFirstSmallDragon",icon:"/webpc/1.3/icon_small_dragon@2x.png",desc:"首暴君"},{key:"isFirstBigDragon",icon:"/webpc/1.3/icon_big_dragon@2x.png",desc:"首主宰"},{key:"isTenKills",icon:"/webpc/1.3/icon_kill_ten@2x.png",desc:"十杀"}]),e)[this.gameType]||[]},gameHeaderFieldMap:function(){var e;return(e={},Object(a.a)(e,i.PBGameType.GT_LOL,[{key:"killCount",text:"击杀"},{key:"towerCount",text:"推塔"},{key:"bigDragonCount",text:"大龙"},{key:"smallDragonCount",text:"小龙"},{key:"money",text:"经济差"}]),Object(a.a)(e,i.PBGameType.GT_DOTA,[{key:"killCount",text:"击杀"},{key:"towerDestroyCount",text:"推塔"},{key:"barrackDestroyCount",text:"兵营"},{key:"money",text:"经济差"}]),Object(a.a)(e,i.PBGameType.GT_CSGO,[{key:"totalScore",text:"全场"},{key:"firstHalfScore",text:"上半场"},{key:"secondHalfScore",text:"下半场"},{key:"overtimeScore",text:"加时"},{key:"map",text:"地图"}]),Object(a.a)(e,i.PBGameType.GT_KOG,[{key:"killCount",text:"击杀"},{key:"towerCount",text:"推塔"},{key:"bigDragonCount",text:"大龙"},{key:"smallDragonCount",text:"小龙"},{key:"money",text:"经济差"}]),e)[this.gameType||i.PBGameType.GT_LOL]},gameTypeLowerText:function(){var e=this.gameType||this.match&&this.match.gameType;return e&&r.GAME_TYPE_EN[e].toLowerCase()},isNoBattleGameTypes:function(){return this.judgeGameType("GT_OW")||this.judgeGameType("GT_ROCKET")||this.judgeGameType("GT_RAINBOW")},isNoBetGameTypes:function(){return this.judgeGameType("GT_PUBG")||this.judgeGameType("GT_SC2")||this.judgeGameType("GT_HS")||this.judgeGameType("GT_HOS")},isPlayerGameTypes:function(){return this.judgeGameType("GT_HS")||this.judgeGameType("GT_SC2")},isPubgGameType:function(){return this.judgeGameType("GT_PUBG")},isOtherGameTypes:function(){return!this.isPlayerGameTypes&&!this.isPubgGameType}},methods:{gameHeaderFieldMapRound:function(e){return Object(s.getNumber)(e.BO)},getTeamName:function(e,t){var n=e[t].name,a=e[t].shortName,i=(""!==n?n:this.latestBattle&&this.latestBattle[t]&&this.latestBattle[t].name)||"TBD";return 0!==Number(e[t].teamId)&&e[t].teamId?(""!==a?a:i).replace("待定","TBD"):"TBD"},getFirstTeamNamePubg:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"short",a=e.length?e.reduce((function(e,t){return e.pubgProperty.rank>t.pubgProperty.rank?t:e})):{},i=a.shortName,r=a.englishName,s=a.name;return"short"===n?i||r||s||t||"TBD":s||r||i||t||"TBD"},getPlayerName:function(e){return e&&(e.nickname||e.realName)||"player"},getBattleSidesName:function(e,t){var n=this.isPlayerGameTypes?"homeTeam"===t?"playerA":"playerB":t;return([{status:this.isPlayerGameTypes,name:this.isPlayerGameTypes&&(e.matchId?this.getPlayerName(e[n]):this.getPlayerName(e))},{status:this.isPubgGameType,name:e.pubgProperty&&e.pubgProperty.title||"title"},{status:this.isOtherGameTypes,name:this.isOtherGameTypes&&this.getTeamName(e,n)}].find((function(e){return e.status}))||{}).name},judgeGameType:function(e){return(this.gameType||this.match&&this.match.gameType)===i.PBGameType[e]},isHasBattles:function(e){return e.battles&&e.battles.length},getAchievements:function(e,t){var n=this,a=this.latestBattle?this.latestBattle:this.battle,i=t&&t.gameType?t:a;return i[e]?this.gameAchievementMap.filter((function(t){return i[e][n.gameProperty]&&i[e][n.gameProperty][t.key]})):[]}}}},263:function(e,t,n){"use strict";var a=n(29);t.a={methods:{handleOpen:function(e,t){window.open("".concat(t.href),e?"_blank":"_self")},actionMatchDetail:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data",t=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=this.$router.resolve({name:"detail-battle-type-gameType-id",params:{type:e,gameType:this.encodeGameType(t.gameType),id:this.encodeMatchId(t.matchId)}});this.handleOpen(n,a)},encodeGameType:function(e){var t=(a.GAME_TYPE_EN[e]||"").toLowerCase();return"".concat(t,"-").concat(e)},encodeMatchId:function(e){return"match-".concat(e,".html")},encodeLeagueId:function(e,t){var n=(a.GAME_TYPE_EN[e]||"").toLowerCase();return"league-".concat(n,"-").concat(t,".html")},actionLeagueDetail:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.$router.resolve({name:"detail-league-gameType-id",params:{gameType:this.encodeGameType(e.gameType),id:this.encodeLeagueId(e.gameType,e.leagueId)}});this.handleOpen(t,n)}}}},265:function(e,t,n){"use strict";n(275);var a=n(55),i=(n(54),n(111),n(14)),r=n(263),s=n(255),o=n(15),c=n(94);t.a={mixins:[r.a,s.a],computed:{gameType:function(){return this.match&&this.match.gameType},status:function(){return this.match&&this.match.status},latestBattle:function(){return this.isHasBattle?this.match.battles[this.match.battles.length-1]:{}},isHasBattle:function(){return this.match&&this.match.battles&&this.match.battles.length>0},digitsStr:function(){return["","","","","","","","","","","十一","十二"]},battlesSize:function(){return this.isHasBattle&&!this.oneEndNoStart?"".concat(this.digitsStr[this.match.battles.length-1],""):"进行中"},oneEndNoStart:function(){return this.match.homeTeam.score+this.match.awayTeam.score===this.match.battles.length},hasBetData:function(){return this.match.bet&&this.match.bet.options.length>0}},methods:{moneyGap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.latestBattle,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e[this.gameProperty]&&e[this.gameProperty].ecoDiff||[],a=this.getFieldVal("homeTeam","money",e)-this.getFieldVal("awayTeam","money",e)||null,i=n.length?n[n.length-1].diff:a,r=this.judgeGameType("GT_DOTA")||this.judgeGameType("GT_LOL"),s=r?i:a;if(null==s)return"-";var o=Math.abs(s)>0&&Math.abs(s)<100;return o?Math.abs(s):t?s&&Object(c.b)(s):s},moneyGapImg:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.latestBattle,t=this.moneyGap(e,!1),n=Math.abs(t);return!(!n||"-"===t)&&this.qiniuSizeImg("webpc/1.5/icon_money_new_".concat(t>0?"increase":"decrease",".png"))},getFieldVal:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.latestBattle;return n[e]&&n[e][this.gameProperty]&&n[e][this.gameProperty][t]},handleZeroLine:function(e){return Number(e)>=0?e:"-"},raiseArrNum:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=e||[],i=this.qiniuSizeImg("icon_hero_".concat(this.gameTypeLowerText,"_circular_grey_default.png")),r=n.length;return r<t?[].concat(Object(a.a)(n),Object(a.a)(new Array(t-r).fill({emptyLogo:i}))):n},getAchStyle:function(e){var t=Math.max(this.getAchievements("homeTeam",e).length,this.getAchievements("awayTeam",e).length);return"width: ".concat(t?24*t:48,"px")},jumpToBetDetail:function(e){o.localData.set("SHOW_LIVE_SIGN","close"),this.actionMatchDetail("bet",e)},jumpToProspectDetail:function(e){o.localData.set("SHOW_LIVE_SIGN","close"),this.actionMatchDetail("prospect",e)},jumpLeagueDetail:function(e){this.actionLeagueDetail(e)},judgeGameType:function(e,t){return t||this.match.gameType===i.PBGameType[e]},judgeStatus:function(e){return this.match.status===i.PBMatchStatus[e]},judgeBetStatus:function(e,t){return i.PBBetStatus[t]===Number(e)},toFixedData:function(e){return parseFloat(e).toFixed(2)}}}},266:function(e,t,n){"use strict";n(271),n(54);var a=n(7),i=(n(93),n(112),n(37),n(31),n(34),n(30),n(12),n(10),n(19),n(111),n(255)),r=n(265),s=n(263),o=n(14),c=n(29),u=n(94);t.a={mixins:[r.a,i.a,s.a],props:{match:{type:Object}},data:function(){return{PBMatchStatus:o.PBMatchStatus,showLiveList:!1,isEnterLiveList:!1}},computed:{isGoingCbhFirst:function(){return this.judgeStatus("MS_ONGOING")&&this.latestBattle[this.gameProperty]&&this.latestBattle[this.gameProperty].currentHalf===o.PBCsgoBattleHalf.CBH_FIRST},isGoingCbhSecond:function(){return this.judgeStatus("MS_ONGOING")&&this.latestBattle[this.gameProperty]&&(this.latestBattle[this.gameProperty].currentHalf===o.PBCsgoBattleHalf.CBH_SECOND||this.latestBattle[this.gameProperty].currentHalf===o.PBCsgoBattleHalf.CBH_OVERTIME)}},methods:{jumpToLive:function(e,t){if(e.liveType===o.PBLiveType.LT_VIDEO_SOURCE||e.isSupportIframe){var n="data";this.judgeStatus("MS_NOT_START")&&this.match.hasProspect&&(n="prospect");var a=this.$router.resolve({name:"detail-battle-type-gameType-id",params:{type:n,gameType:this.encodeGameType(this.match.gameType),id:this.encodeMatchId(this.match.matchId)},query:{autoLivePlayPosition:t}});window.open(a.href,"_blank")}else window.open(e.url,"_blank")},jumpToBattleDetail:function(){var e="data";this.judgeStatus("MS_NOT_START")&&this.match.hasProspect&&(e="prospect"),this.actionMatchDetail(e,this.match)},getTeamTypeBet:function(e){var t=this,n=this.betSelect,a=n.sourceActive,i=n.typeActive,r={"全场胜负":{types:Object.keys(c.BET_WIN_TYPES),getDishNum:function(){}},"全场让分":{types:Object.keys(c.BET_HANDICAP_TYPES),getDishNum:function(e){var t=e.name;if(/\+|-/g.test(t))return t.includes("+")?t.match(/\+(\S*)/)[0]:t.match(/-(\S*)/)[0]}},"总局数":{types:Object.keys(c.BET_MAP_SIZE_TYPES),getDishNum:function(e){var t=e.name;if(/大|小/g.test(t)){var n=t.replace(/[^\d.]/g,"");return(t.includes("")?"":"")+n}}}}[i],s=r.types,o=r.getDishNum,u=this.match.bets.map((function(e){if(e.source===a.toLowerCase())return e})).filter(Boolean).find((function(e){return s.includes(e.type.toString())})),m=u&&u.options&&u.options.find((function(n){return n.teamId===t.match[e].teamId}))||{};return Object.assign({},m,{dishNum:m&&o(m)})},getFieldRef:function(e,t){return"ref-".concat(e,"-").concat(t,"-").concat(this.match.matchId)},getChangeClass:function(e,t){return Object(a.a)({},"".concat(this.judgeIsChange(e,t),"-blink-bg"),!0)},judgeIsChange:function(e,t){if(!this.judgeStatus("MS_ONGOING"))return!1;var n=this.$refs[this.getFieldRef(e,t)],a=n instanceof Array?n[0]:n,i=Number("odds"===t?this.getTeamTypeBet(e).odds||0:this.getFieldVal(e,t)||0),r="money"===t?this.moneyGap():i;if(a){var s=Number(a.getAttribute("data-old"))||0,o=Number(a.getAttribute("data-new"))||0,c="no"===a.getAttribute("data-inited");return 0===s&&0===o&&0===r&&c&&(a.setAttribute("data-inited","yes"),this.$funlog("Init-all-zero:",r)),0===s&&0===o&&0!==r&&c||0!==r&&c?(a.setAttribute("data-new",r),a.setAttribute("data-old",r),a.setAttribute("data-inited","yes"),this.$funlog("Init-data:",r),"init"):r!==o?(a.setAttribute("data-new",r),a.setAttribute("data-old",o),r>o?"increase":r<o&&0!==r?"decrease":"none"):"none"}},getTeamScoreColor:function(e){var t=["homeTeam","awayTeam"],n=t[0]===e?1:0,a=Number(this.match[e].score)-Number(this.match[t[n]].score);return a>0?"score-win-color":0===a?"score-equal-color":"score-lose-color"},getCampTypeTipText:function(e,t){return Object(u.c)(e,t)},showCampIcon:function(e,t){var n=["反恐精英","恐怖分子","蓝方","红方","夜魇","天辉"].findIndex((function(n){return n===Object(u.c)(e,t)}));return-1===n?n:this.qiniuSizeImg(["/webpc/1.3/icon_cs_ct@2x.png","/webpc/1.3/icon_cs_t@2x.png","/webpc/1.3/icon_lol_blue@2x.png","/webpc/1.3/icon_lol_red@2x.png","/webpc/1.3/icon_dota_tianhui@2x.png","/webpc/1.3/icon_dota_yeyan@2x.png"][n])}}}},270:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"h",(function(){return r})),n.d(t,"m",(function(){return s})),n.d(t,"f",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"k",(function(){return m})),n.d(t,"i",(function(){return h})),n.d(t,"g",(function(){return l})),n.d(t,"j",(function(){return p})),n.d(t,"e",(function(){return g})),n.d(t,"l",(function(){return d})),n.d(t,"c",(function(){return y}));var a=n(26);function i(e){return a.a.post("/match/bet/multi/search",{params:e}).then((function(e){return e.data}))}function r(e){return a.a.get("/match/matchDailyCount",{params:e}).then((function(e){return e.data}))}function s(e){return a.a.get("/match/recentMatchAndBetChange",{params:e}).then((function(e){return e.data}))}function o(e){return a.a.get("/match/matchAndBetGet",{params:e}).then((function(e){return e.data}))}function c(e){return a.a.get("/match/bet/search",{params:e}).then((function(e){return e.data}))}function u(e){return a.a.get("/match/index/recent/match/change",{params:e}).then((function(e){return e.data}))}function m(e){return a.a.get("/match/list",{params:e}).then((function(e){return e.data}))}function h(e){return a.a.get("/match/get",{params:e}).then((function(e){return e.data}))}function l(e){return a.a.get("/match/list/count",{params:e}).then((function(e){return e.data}))}function p(e){return a.a.get("/match/performance/get",{params:e}).then((function(e){return e.data}))}function g(e){return a.a.get("/match/analysis/get",{params:e}).then((function(e){return e.data})).catch((function(){return{}}))}function d(e){return a.a.get("/match/teamLeagueStatistic/get",{params:e}).then((function(e){return e.data}))}function y(e){return a.a.get("/match/csgoGameLogRange",{params:e}).then((function(e){return e.data}))}},271:function(e,t,n){"use strict";var a=n(16),i=n(169)(6),r="findIndex",s=!0;r in[]&&Array(1)[r]((function(){s=!1})),a(a.P+a.F*s,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(91)(r)},275:function(e,t,n){var a=n(16);a(a.P,"Array",{fill:n(286)}),n(91)("fill")},286:function(e,t,n){"use strict";var a=n(49),i=n(168),r=n(42);e.exports=function(e){for(var t=a(this),n=r(t.length),s=arguments.length,o=i(s>1?arguments[1]:void 0,n),c=s>2?arguments[2]:void 0,u=void 0===c?n:i(c,n);u>o;)t[o++]=e;return t}}}]);
\ No newline at end of file
此差异已折叠。
此差异已折叠。
!function(e){function t(t){for(var n,a,c=t[0],u=t[1],d=t[2],i=0,b=[];i<c.length;i++)a=c[i],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&b.push(o[a][0]),o[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);b.length;)b.shift()();return f.push.apply(f,d||[]),r()}function r(){for(var e,t=0;t<f.length;t++){for(var r=f[t],n=!0,a=1;a<r.length;a++){var u=r[a];0!==o[u]&&(n=!1)}n&&(f.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},a={14:0},o={14:0},f=[];function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[];a[e]?t.push(a[e]):0!==a[e]&&{1:1,2:1,3:1,4:1,5:1,6:1,10:1,11:1,12:1,13:1,16:1}[e]&&t.push(a[e]=new Promise((function(t,r){for(var n={0:"31d6cfe0d16ae931b73c",1:"8adb2fd4c5b935857f29",2:"a3ede28f8a58a48d5a24",3:"80b3091fb0d8b4368487",4:"b1f1cec25b9168367233",5:"b09cd5432662c61207f3",6:"905066b789ba95a35369",7:"31d6cfe0d16ae931b73c",10:"31638794d8086c7e82d8",11:"5936269fcb8d5e3cb129",12:"90cedf8073356a9a3714",13:"ecfaefe34a5eff373138",16:"e48e30748dbd2cb2da3e"}[e]+".css",o=c.p+n,f=document.getElementsByTagName("link"),u=0;u<f.length;u++){var d=(l=f[u]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(d===n||d===o))return t()}var i=document.getElementsByTagName("style");for(u=0;u<i.length;u++){var l;if((d=(l=i[u]).getAttribute("data-href"))===n||d===o)return t()}var b=document.createElement("link");b.rel="stylesheet",b.type="text/css",b.onload=t,b.onerror=function(t){var n=t&&t.target&&t.target.src||o,f=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");f.code="CSS_CHUNK_LOAD_FAILED",f.request=n,delete a[e],b.parentNode.removeChild(b),r(f)},b.href=o;var s=document.querySelector("head");s.appendChild(b)})).then((function(){a[e]=0})));var r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var f,u=document.createElement("script");u.charset="utf-8",u.timeout=120,c.nc&&u.setAttribute("nonce",c.nc),u.src=function(e){return c.p+""+{0:"52f1b607ac09687a535a",1:"b6a255bfb8c57ff89630",2:"db3a9f6b72430f7bb1c1",3:"7010a9c0b75cfe755c81",4:"b91e54701379309c0e11",5:"48616e973fae210f82ff",6:"44db874aca429dcdb32f",7:"1ce56683f2e652bbb4a0",10:"b746e871f4c9580d2b62",11:"f25e21a18ffe362dab2f",12:"2ef20b9f0236a2606fd1",13:"859f25d1efec718da324",16:"3a167ac5b01e1b17d2d4"}[e]+".js"}(e);var d=new Error;f=function(t){u.onerror=u.onload=null,clearTimeout(i);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;d.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",d.name="ChunkLoadError",d.type=n,d.request=a,r[1](d)}o[e]=void 0}};var i=setTimeout((function(){f({type:"timeout",target:u})}),12e4);u.onerror=u.onload=f,document.head.appendChild(u)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="https://cdn.jdj007.com/_nuxt/",c.oe=function(e){throw e};var u=window.webpackJsonp=window.webpackJsonp||[],d=u.push.bind(u);u.push=t,u=u.slice();for(var i=0;i<u.length;i++)t(u[i]);var l=d;r()}([]);
\ No newline at end of file
const parser = require("@babel/parser");
const t = require("@babel/types");
const generator = require("@babel/generator");
const fs = require("fs");
function wtofile(path, flags, code) {
var fd = fs.openSync(path,flags);
fs.writeSync(fd, code);
fs.closeSync(fd);
}
var loader_path = 'ffa43f3bc74cf5925a35.js';
var jscode = fs.readFileSync(loader_path, {
encoding: "utf-8"
});
// 转换为AST语法树
let loader_ast = parser.parse(jscode);
// 获取加载器代码
let loader_body = loader_ast.program.body[0].expression.argument.callee.body.body;
for (let i = 0; i < loader_body.length; i++){
if (loader_body[i].type === 'VariableDeclaration'){
loader_ast.program.body[0].expression.argument.callee.body.body.splice(i+3, (loader_body.length- i-3));
loader_ast.program.body[0].expression.argument.callee.body.body.splice(0, i);
loader_ast.program.body[0].expression.argument.callee.body.body.push(t.assignmentExpression("=", t.identifier("export_function"), t.identifier(loader_ast.program.body[0].expression.argument.callee.body.body[1].id.name)));
break
}
}
// 修改加载器参数类型
let loader_arguments = loader_ast.program.body[0].expression.argument.arguments[0] = t.objectExpression([]);
// 加载函数体
var modular_path = ['42eea894c639c8655feb.js', '01b18bd4edbfc16a1f2a.js', '52f1b607ac09687a535a.js', 'ae003ad8d6cbf21f404b.js', 'b91e54701379309c0e11.js'];
modular_path.forEach(function (item, index) {
var jscode = fs.readFileSync(item, {
encoding: "utf-8"
});
let modular_ast = parser.parse(jscode);
modular_ast.program.body[0].expression.arguments[0].elements.forEach(function (item2, index2) {
if (item2.type === 'ArrayExpression'){
item2.elements.forEach(function (item3, index3) {
if (item3 && item3.type === 'FunctionExpression'){
loader_arguments.properties.push(t.objectProperty(
t.numericLiteral(index3),
item3,
false,
false
));
}
});
}else {
item2.properties.forEach(function (item3, index3) {
loader_arguments.properties.push(item3)
})
}
});
});
// 申请全局导出函数
loader_ast.program.body.splice(0, 0, t.variableDeclaration("var",[t.variableDeclarator(t.identifier("export_function"))]));
let code = generator.default(loader_ast, {
compact: false, // 压缩格式
comments: false, // 注释
jsescOption: {
minimal: false // 转义
}
}).code;
wtofile('webpack_out.js', 'w', code);
// var a = export_function(156);
// var i = export_function.n(a);
// var t = "1212121212121";
// var n = i()(t);
// console.log(n);
此差异已折叠。
......@@ -74,3 +74,6 @@ wtofile('webpack_out.js', 'w', code);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册