{"version":3,"sources":["webpack:///./src/container/App.vue?e4b7","webpack:///./src/container/App.vue","webpack:///src/container/App.vue","webpack:///./src/router/index.js","webpack:///./src/plugins/encrypt.js","webpack:///./src/plugins/api/setting.js","webpack:///./src/plugins/api/axios.js","webpack:///./src/plugins/index.js","webpack:///./src/main.js","webpack:///./src/assets/js/common.js","webpack:///./src/assets/js/wechat.js"],"names":["container_App","render","_h","this","$createElement","_c","_self","attrs","id","staticRenderFns","src_container_App","__webpack_require__","normalizeComponent","name","ssrContext","Vue","use","Router","router","routes","path","component","e","then","bind","children","_baseURL","apiAxios","method","url","params","arguments","length","undefined","from","console","log","window","baseURL","httpDefault","withCredentials","data","qs","stringify","timeout","promise_default","a","resolve","reject","axios","res","error_code","successState","catch","response","status","errorState","interceptors","request","config","err","api_axios","install","prototype","getAxios","postAxios","putAxios","deleteAxios","plugins","axiosApi","VueAwesomeSwiper","webappUI","MintUI","productionTip","filter","dateTimeStamp","diffValue","Date","getTime","monthC","day","weekC","dayC","hour","hourC","minute","minC","parseInt","value","String","indexOf","toFixed","el","components","App","template","isWxBrowser","ua","navigator","userAgent","toLowerCase","test","initializeStatus","shareStatus","SUCCESS","CANCEL","FAILURE","defaults","title","timeline","desc","imgUrl","getLink","location","href","onShare","func","option","wx","assign_default","link","extends_default","success","cancel","__webpack_exports__","__initializeStatus__","init","_ref","_this","asyncToGenerator_default","regenerator_default","mark","_callee","body","wrap","_context","prev","next","error","ready","sent","debug","appId","timestamp","nonceStr","signature","jsApiList","t0","stop","_x","_x2","apply","share","_this2","slience","_callee2","_context2","abrupt","doShare","_this3","_callee3","_context3","onShareTimeline","onShareAppMessage","onShareQQ","onShareQZone"],"mappings":"qHAGeA,cADEC,OAFjB,WAA0B,IAAaC,EAAbC,KAAaC,eAA0BC,EAAvCF,KAAuCG,MAAAD,IAAAH,EAAwB,OAAAG,EAAA,OAAiBE,OAAOC,GAAA,SAAYH,EAAA,oBAE5GI,qBCCjB,IAuBeC,EAvBUC,EAAQ,OA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AAzB,KAAAyB,EAAAxB,MAAA,OAEvBsB,EAAKG,gBAAgB7C,GACrB0C,EAAKI,kBAAkB9C,GACvB0C,EAAKK,UAAU/C,GACf0C,EAAKM,aAAahD,GALK,wBAAA4C,EAAAb,SAAAY,EAAAD,KAAA9B,IAW3BiC,gBApGW,WAoGkB,IAAb7C,EAAatF,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MAYzB,OAXAsF,EAASE,OAAkBF,IAEfR,UACHQ,EAAOT,QACRS,EAAOT,MAAQD,EAASE,UAOzBM,EAAQ,sBAAuBE,IAM1C8C,kBAtHW,WAsHoB,IAAb9C,EAAatF,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MAE3B,OAAOoF,EAAQ,wBADfE,EAASE,OAAkBF,KAO/B+C,UA9HW,WA8HY,IAAb/C,EAAatF,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MAEnB,OAAOoF,EAAQ,gBADfE,EAASE,OAAkBF,KAO/BgD,aAtIW,WAsIe,IAAbhD,EAAatF,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,MAStB,OARAsF,EAASE,OAAkBF,IACfR,SAKRQ,EAAOT,MAAQS,EAAOR,SAJjBQ,EAAOT,QACRS,EAAOT,MAAQD,EAASE,UAKzBM,EAAQ,mBAAoBE","file":"static/js/app.c0296790bd609c63d22c.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('router-view')],1)}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-889f55d8\",\"hasScoped\":false,\"transformToRequire\":{\"video\":[\"src\",\"poster\"],\"source\":\"src\",\"img\":\"src\",\"image\":\"xlink:href\"},\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/container/App.vue\n// module id = null\n// module chunks = ","function injectStyle (ssrContext) {\n require(\"!!../../node_modules/extract-text-webpack-plugin/dist/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-889f55d8\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./App.vue\")\n}\nvar normalizeComponent = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\nimport __vue_script__ from \"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\n/* template */\nimport __vue_template__ from \"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-889f55d8\\\",\\\"hasScoped\\\":false,\\\"transformToRequire\\\":{\\\"video\\\":[\\\"src\\\",\\\"poster\\\"],\\\"source\\\":\\\"src\\\",\\\"img\\\":\\\"src\\\",\\\"image\\\":\\\"xlink:href\\\"},\\\"buble\\\":{\\\"transforms\\\":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/container/App.vue\n// module id = null\n// module chunks = ","\n\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/container/App.vue","import Vue from 'vue'\nimport Router from 'vue-router'\n\nVue.use(Router)\n\nexport default new Router({\n routes: [\n {\n path: \"/\",\n component: () => import(\"../container/main.vue\"),\n children: [\n {\n path: \"/\", // 首页\n name: \"home\",\n component: () => import(\"../container/home/index.vue\")\n },\n {\n path: \"/prize\", // 首页\n name: \"prize\",\n component: () => import(\"../container/home/prize.vue\")\n }\n\n \n ]\n }\n ]\n})\n\n\n// WEBPACK FOOTER //\n// ./src/router/index.js","import CryptoJS from \"crypto-js\";\n\nconst JsonFormatter = {\n stringify: function(cipherParams) {\n let jsonObj = {\n ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64)\n };\n if (cipherParams.iv) {\n jsonObj.iv = cipherParams.iv.toString();\n }\n if (cipherParams.salt) {\n jsonObj.s = cipherParams.salt.toString();\n }\n return jsonObj;\n },\n parse: function(jsonStr) {\n let jsonObj = JSON.parse(jsonStr);\n let cipherParams = CryptoJS.lib.CipherParams.create({\n ciphertext: CryptoJS.enc.Base64.parse(jsonObj.ct)\n });\n if (jsonObj.iv) {\n cipherParams.iv = CryptoJS.enc.Hex.parse(jsonObj.iv);\n }\n if (jsonObj.s) {\n cipherParams.salt = CryptoJS.enc.Hex.parse(jsonObj.s);\n }\n return cipherParams;\n }\n};\n\nfunction aesEncode(privateKey, str) {\n let key1 = CryptoJS.enc.Utf8.parse(privateKey);\n let iv = CryptoJS.enc.Utf8.parse(privateKey);\n let encrypted = CryptoJS.AES.encrypt(str, key1, {\n iv: iv,\n blockSize: 16,\n mode: CryptoJS.mode.CBC,\n format: JsonFormatter\n });\n return encrypted.toString().ct;\n}\n\nexport default function(jsonData) {\n let arrData, i, j, key, len, privateKey, strData, timestamp;\n\n timestamp = Math.floor(new Date().getTime() / 1000);\n privateKey = CryptoJS.MD5(\n \"baidu_taihe_music_secret_key\" + timestamp\n ).toString();\n privateKey = privateKey.substr(8, 16);\n // privateKey = 'c9cabf5ff9a5f554'\n // timestamp = 1523966233\n arrData = [];\n strData = \"\";\n\n for (let k in jsonData) {\n if (jsonData.hasOwnProperty(k)) {\n arrData.push(k);\n }\n }\n arrData.sort();\n\n for (i = j = 0, len = arrData.length; j < len; i = ++j) {\n key = arrData[i];\n strData +=\n (i === 0 ? \"\" : \"&\") +\n key +\n \"=\" +\n encodeURIComponent(jsonData[key]);\n }\n const ciphertext = aesEncode(privateKey, strData);\n\n return {\n timestamp: timestamp,\n param: ciphertext,\n sign: CryptoJS.MD5(\n \"baidu_taihe_music\" + ciphertext + timestamp\n ).toString()\n };\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/encrypt.js","// 新建: http://192.168.218.10:8888/v1/restserver/ting?method=baidu.ting.ugcspecial.addSpecial\n// 更新: http://192.168.218.10:8888/v1/restserver/ting?method=baidu.ting.ugcspecial.upSpecial\n// 查找: http://192.168.218.10:8888/v1/restserver/ting?method=baidu.ting.ugcspecial.getSpecialInfo&specialid=1525&qa=1\n// 分类、标签: http://192.168.218.10:8888/v1/restserver/ting?method=baidu.ting.ugcspecial.getMagazineTaginfo\n// let aa = \"http://192.168.217.100:8888\";\nlet aa = \"https://musicapi.taihe.com\";\n// let aa = \"http://musicapi.taihe.com\";\n// http://junxing.music.baidu.com:8088/huodong/bestus\n\nexport const _baseURL = aa; //开发机\n// export const baseURL = 'http://musicapi.taihe.com'; //qa机\n\n// baidu.ting.ugccenter.getUserBaseInfo\n// export const baseURL = 'http://localhost:8080';\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/api/setting.js","import axios from \"axios\";\nimport qs from \"qs\";\nimport encrypt from \"@/plugins/encrypt\";\nimport { _baseURL } from \"./setting\";\nconsole.log('_baseURL',_baseURL)\naxios.interceptors.request.use(config => {\n console.log(config)\n // config.headers.Cookie = \"token_=4018f36c2B2F2E2F28212D202F1555750550114b7fa2733599401cae85f87324;\"\n return config;\n}, err => {\n return Promise.reject(err);\n})\n\n\naxios.interceptors.response.use(response => {\n \n return response.data\n}, err => {\n return Promise.reject(err);\n})\n\n\nfunction errorState(response) {\n if(response && (response.status === 200 ||response.status === 304 ||response.status === 400)){\n return response.data\n }else{\n console.log(\"数据错误,请联系管理员!\");\n }\n}\n\nfunction successState(res) {\n console.log(res)\n if(res.error_code === 22000){\n console.log(\"数据返回成功\");\n return res;\n }\n}\n\nfunction apiAxios(method, url, params = {}) {\n params.from = \"music\";\n // params = encrypt(params); //aes\n if(process.env.NODE_ENV === \"development\"){\n window.baseURL = _baseURL;\n }\n\n console.log(window.baseURL)\n let httpDefault = {\n method: method,\n baseURL: _baseURL,\n withCredentials: true, //表示跨域请求时是否需要使用凭证\n url: `/v1/restserver/ting?method=${url}`,\n params: method === \"GET\" || method === \"DELETE\" ? params : null,\n data: method === \"POST\" || method === \"PUT\" ? qs.stringify(params) : null,\n timeout: 10000\n }\n // debugger\n return new Promise((resolve, reject) => {\n console.log('ajax 最终数据', httpDefault);\n axios(httpDefault)\n .then((res) => {\n console.log(123)\n successState(res)\n resolve(res)\n })\n .catch((response) => {\n console.log(3323)\n errorState(response);\n reject(response);\n })\n })\n}\nexport default {\n install: (Vue) => {\n Vue.prototype.getAxios = (url, params) => apiAxios(\"GET\", url, params);\n Vue.prototype.postAxios = (url, params) => apiAxios(\"POST\", url, params);\n Vue.prototype.putAxios = (url, params) => apiAxios(\"PUT\", url, params);\n Vue.prototype.deleteAxios = (url, params) => apiAxios(\"DELETE\", url, params);\n\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/api/axios.js","import Vue from \"vue\";\n// import loginDirective from \"./directives/login\";\nimport axiosApi from \"./api/axios\";\n\nconst install = function (){\n // Vue.use(loginDirective);\n Vue.use(axiosApi);\n}\n\nexport default {\n install\n}\n\n\n// WEBPACK FOOTER //\n// ./src/plugins/index.js","// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue'\nimport App from '@/container/App';\nimport router from './router';\nimport webappUI from \"@/plugins/index\";\nimport VueAwesomeSwiper from 'vue-awesome-swiper';\n\nimport MintUI from 'mint-ui';\nimport 'mint-ui/lib/style.css';\nimport './banner.less';\nVue.use(VueAwesomeSwiper, /* { default global options } */)\nVue.use(webappUI)\nVue.use(MintUI)\nVue.config.productionTip = false \nVue.filter(\"getDateDiff\", function (dateTimeStamp) {\n var minute = 1000 * 60;\n var hour = minute * 60;\n var day = hour * 24;\n var halfamonth = day * 15;\n var month = day * 30;\n var now = new Date().getTime();\n var diffValue = now - dateTimeStamp * 1000;\n if(diffValue < 0){return;}\n var monthC =diffValue/month;\n var weekC =diffValue/(7*day);\n var dayC =diffValue/day;\n var hourC =diffValue/hour;\n var minC =diffValue/minute;\n let result = \"\"\n if(monthC>=1){\n result=\"\" + parseInt(monthC) + \"月前\";\n }\n else if(weekC>=1){\n result=\"\" + parseInt(weekC) + \"周前\";\n }\n else if(dayC>=1){\n result=\"\"+ parseInt(dayC) +\"天前\";\n }\n else if(hourC>=1){\n result=\"\"+ parseInt(hourC) +\"小时前\";\n }\n else if(minC>=1){\n result=\"\"+ parseInt(minC) +\"分钟前\";\n }else\n result=\"刚刚\";\n return result;\n})\n\nVue.filter(\"tenThousand\", function (value) {\n value = parseInt(value);\n if (!value) {\n return 0;\n }\n if (value > 10000) {\n value = value / 10000;\n if (String(value).indexOf(\".\")) {\n value = value.toFixed(1);\n }\n value += \"万\";\n }\n return value;\n})\n/* eslint-disable no-new */\nnew Vue({\n el: '#app',\n router,\n components: { App },\n template: ''\n})\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","/**\n * 获取location host 前缀\n */\n// export const getDomainPrefix = function() {\n// const hostname = location.hostname;\n// if (hostname.includes(\"baidu.com\")) {\n// return \"//music.baidu.com\";\n// } else if (hostname.includes(\"taihe.com\")) {\n// return \"//music.taihe.com\";\n// } else {\n// return \"//music.qianqian.com\";\n// }\n// };\n\nexport const isWxBrowser = function() {\n const ua = navigator.userAgent.toLowerCase();\n return /micromessenger/.test(ua) ? true : false;\n};\n\n/**\n * 从数组里随机取几个不重复的元素\n * @param arr\n * @param num\n * @returns {Array}\n */\nexport const getRandomItemsFromArray = function (arr, num) {\n // 新建一个数组,将传入的数组复制过来,用于运算,而不直接操作传入的数组;\n const copyArr = [];\n for (const index in arr) {\n copyArr.push(arr[index]);\n }\n //取出的数值项,保存在此数组返回\n const resultArr = [];\n for (let i = 0; i0) {\n // 在数组中产生一个随机索引\n const arrIndex = Math.floor(Math.random()*copyArr.length);\n // 将此随机索引的对应的数组元素值复制出来\n resultArr[i] = copyArr[arrIndex];\n // 然后删掉此索引的数组元素,这时候 copyArr 变为新的数组\n copyArr.splice(arrIndex, 1);\n } else {\n // 数组中数据项取完后,退出循环,比如数组本来只有10项,但要求取出20项.\n break;\n }\n }\n return resultArr;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/assets/js/common.js","// import axios from \"@/api/index\";\nimport { isWxBrowser } from \"./common\";\nimport Vue from \"vue\";\nimport axios from \"axios\";\n/**\n * initialize status\n */\nconst initializeStatus = {\n INIT: 1,\n WORKING: 2,\n DONE: 3\n};\n\n/**\n * share status\n */\nconst shareStatus = {\n SUCCESS: 1,\n CANCEL: 2,\n FAILURE: 3\n};\n\n// default\nconst defaults = {\n title: \"告白,不枉耿耿于怀\", //微信好友,QQ好友\n timeline: \"告白,不枉耿耿于怀\",\n desc: \"\",\n imgUrl: \"https://c.taihe.com/res/mybestsummer/static/img/share.jpg\"\n};\n\nconst getLink = () => {\n return location.href;\n};\n\nfunction onShare(func, option) {\n if (!isWxBrowser()) {\n return;\n }\n\n if (!wx) {\n return;\n }\n console.log(\"before\",option)\n option = Object.assign({}, defaults, option);\n // console.log(\".......onshare\", option)\n if (!option.link) {\n option.link = getLink();\n }\n return new Promise((resolve, reject) => {\n wx[func]({\n ...option,\n success() {\n // alert(\"wx func sucss\")\n resolve(shareStatus.SUCCESS);\n },\n cancel: () => {\n // alert(\"wx func cancel\")\n resolve(shareStatus.CANCEL);\n }\n });\n });\n}\nexport default {\n __initializeStatus__: 1,\n\n /**\n * init wechat\n */\n init() {\n // alert(2)\n if (!isWxBrowser() || !wx) {\n return;\n }\n // alert(3)\n return new Promise(async (resolve, reject) => {\n try {\n wx.error(res => {\n console.error(\"[wechat] error\", res);\n // alert(res)\n });\n\n wx.ready(() => {\n resolve();\n });\n // alert(4)\n // this.__initializeStatus__ = initializeStatus.WORKING;\n \n const body = await axios({\n method: \"get\",\n url: `https://music.taihe.com/data/weix/ticket?data=from`,\n // url: `https://music.taihe.com/api/v1/wx/sign`,\n });\n // alert(\"after\")\n const data = body.data || body;\n // const data = {}\n // alert(data.appId)\n // alert(data.timestamp)\n // alert(data.nonceStr)\n // alert(data.signature)\n console.log(body)\n console.log(data)\n wx.config({\n debug: false,\n appId: data.appId,\n timestamp: data.timestamp,\n nonceStr: data.nonceStr,\n signature: data.signature,\n jsApiList: [\n \"onMenuShareTimeline\",\n \"onMenuShareAppMessage\",\n \"onMenuShareQQ\",\n \"onMenuShareQZone\"\n ]\n });\n } catch (err) {\n console.error(\"[wechat] catch: \", err);\n }\n });\n },\n\n /**\n * share all plateform\n *\n * option include properties:\n * title, desc, link, imgUrl\n */\n async share(option = {}, slience = false) {\n // alert(this.__initializeStatus__ === initializeStatus.WORKING)\n if (!wx) {\n return;\n }\n // alert(this.__initializeStatus__ === initializeStatus.WORKING)\n if (this.__initializeStatus__ === initializeStatus.WORKING) {\n //已初始化完成\n return;\n }\n\n if (!slience) {\n // console.log(\"init\")\n // alert(1)\n await this.init();\n }\n // alert(222)\n // alert(\"slience\")\n console.log(\"wechat share\")\n this.doShare(option);\n },\n\n /**\n * 分享到各个平台\n */\n async doShare(option = {}) {\n // console.log(\"doShare///////\")\n this.onShareTimeline(option);\n this.onShareAppMessage(option);\n this.onShareQQ(option);\n this.onShareQZone(option);\n },\n\n /**\n * share wechat timeline\n */\n onShareTimeline(option = {}) {\n option = Object.assign({}, option);\n // alert(option.title)\n if (!option.timeline) {\n if (!option.title) {\n option.title = defaults.timeline;\n }\n } else {\n // option.title = option.timeline by0418\n }\n // alert(\"onMenuShareTimeline\")\n // console.log(\"onMenuShareTimeline\", option)\n return onShare(\"onMenuShareTimeline\", option);\n },\n\n /**\n * share wechat friends\n */\n onShareAppMessage(option = {}) {\n option = Object.assign({}, option);\n return onShare(\"onMenuShareAppMessage\", option);\n },\n\n /**\n * share QQ\n */\n onShareQQ(option = {}) {\n option = Object.assign({}, option);\n return onShare(\"onMenuShareQQ\", option);\n },\n\n /**\n * share QZone\n */\n onShareQZone(option = {}) {\n option = Object.assign({}, option);\n if (!option.timeline) {\n if (!option.title) {\n option.title = defaults.timeline;\n }\n } else {\n option.title = option.timeline\n }\n return onShare(\"onMenuShareQZone\", option);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/assets/js/wechat.js"],"sourceRoot":""}