Commit 34551d908cf9a9350c2251a1c43f4f0623f9d98b
1 parent
ac0b120f
lower browser
Showing
13 changed files
with
1018 additions
and
17 deletions
package-lock.json
| ... | ... | @@ -538,6 +538,35 @@ |
| 538 | 538 | "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", |
| 539 | 539 | "dev": true |
| 540 | 540 | }, |
| 541 | + "babel-polyfill": { | |
| 542 | + "version": "6.26.0", | |
| 543 | + "resolved": "https://mirrors.huaweicloud.com/repository/npm/babel-polyfill/-/babel-polyfill-6.26.0.tgz", | |
| 544 | + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", | |
| 545 | + "dev": true, | |
| 546 | + "requires": { | |
| 547 | + "babel-runtime": "^6.26.0", | |
| 548 | + "core-js": "^2.5.0", | |
| 549 | + "regenerator-runtime": "^0.10.5" | |
| 550 | + } | |
| 551 | + }, | |
| 552 | + "babel-runtime": { | |
| 553 | + "version": "6.26.0", | |
| 554 | + "resolved": "https://mirrors.huaweicloud.com/repository/npm/babel-runtime/-/babel-runtime-6.26.0.tgz", | |
| 555 | + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", | |
| 556 | + "dev": true, | |
| 557 | + "requires": { | |
| 558 | + "core-js": "^2.4.0", | |
| 559 | + "regenerator-runtime": "^0.11.0" | |
| 560 | + }, | |
| 561 | + "dependencies": { | |
| 562 | + "regenerator-runtime": { | |
| 563 | + "version": "0.11.1", | |
| 564 | + "resolved": "https://mirrors.huaweicloud.com/repository/npm/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", | |
| 565 | + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", | |
| 566 | + "dev": true | |
| 567 | + } | |
| 568 | + } | |
| 569 | + }, | |
| 541 | 570 | "balanced-match": { |
| 542 | 571 | "version": "1.0.2", |
| 543 | 572 | "resolved": "https://mirrors.huaweicloud.com/repository/npm/balanced-match/-/balanced-match-1.0.2.tgz", |
| ... | ... | @@ -1326,6 +1355,12 @@ |
| 1326 | 1355 | "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", |
| 1327 | 1356 | "dev": true |
| 1328 | 1357 | }, |
| 1358 | + "core-js": { | |
| 1359 | + "version": "2.6.12", | |
| 1360 | + "resolved": "https://mirrors.huaweicloud.com/repository/npm/core-js/-/core-js-2.6.12.tgz", | |
| 1361 | + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", | |
| 1362 | + "dev": true | |
| 1363 | + }, | |
| 1329 | 1364 | "core-util-is": { |
| 1330 | 1365 | "version": "1.0.3", |
| 1331 | 1366 | "resolved": "https://mirrors.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.3.tgz", |
| ... | ... | @@ -4548,6 +4583,12 @@ |
| 4548 | 4583 | "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", |
| 4549 | 4584 | "dev": true |
| 4550 | 4585 | }, |
| 4586 | + "regenerator-runtime": { | |
| 4587 | + "version": "0.10.5", | |
| 4588 | + "resolved": "https://mirrors.huaweicloud.com/repository/npm/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", | |
| 4589 | + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", | |
| 4590 | + "dev": true | |
| 4591 | + }, | |
| 4551 | 4592 | "regex-not": { |
| 4552 | 4593 | "version": "1.0.2", |
| 4553 | 4594 | "resolved": "https://mirrors.huaweicloud.com/repository/npm/regex-not/-/regex-not-1.0.2.tgz", | ... | ... |
package.json
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | "license": "ISC", |
| 14 | 14 | "devDependencies": { |
| 15 | 15 | "@webpack-cli/serve": "^1.5.2", |
| 16 | + "babel-polyfill": "^6.0.2", | |
| 16 | 17 | "clean-webpack-plugin": "^4.0.0", |
| 17 | 18 | "css-loader": "^5.1.0", |
| 18 | 19 | "html-webpack-plugin": "^4.0.4", |
| ... | ... | @@ -23,7 +24,7 @@ |
| 23 | 24 | "webpack": "^4.42.1", |
| 24 | 25 | "webpack-cli": "^3.3.11", |
| 25 | 26 | "webpack-dev-server": "^3.10.3", |
| 26 | - "webpack-obfuscator": "^3.4.1" | |
| 27 | + "webpack-obfuscator": "^2.6.0" | |
| 27 | 28 | }, |
| 28 | 29 | "dependencies": { |
| 29 | 30 | "qs": "^6.10.1" | ... | ... |
src/css/reui.css
| 1 | + | |
| 2 | +/* vue version 2 css */ | |
| 3 | +.diy-reset { | |
| 4 | + margin: 0; | |
| 5 | + padding: 0 | |
| 6 | +} | |
| 7 | +.diy-flex { | |
| 8 | + display: flex; | |
| 9 | + flex-wrap: wrap; | |
| 10 | +} | |
| 11 | +.diy-flex-50 { | |
| 12 | + width: 50%; | |
| 13 | +} | |
| 14 | +.diy-flex-100 { | |
| 15 | + width: 100%; | |
| 16 | +} | |
| 17 | +.diy-text-left { | |
| 18 | + text-align: left; | |
| 19 | +} | |
| 20 | +.diy-text-right { | |
| 21 | + text-align: right; | |
| 22 | +} | |
| 23 | +.diy-tip { | |
| 24 | + color: #4A90E2; | |
| 25 | + font-size: 20px; | |
| 26 | +} | |
| 27 | +.diy-error { | |
| 28 | + color: #D11244; | |
| 29 | + font-size: 20px; | |
| 30 | +} | |
| 31 | +.diy-danger { | |
| 32 | + color: #D11244; margin-left: 10px; | |
| 33 | +} | |
| 34 | +.el-card { | |
| 35 | + border: none; | |
| 36 | +} | |
| 37 | +.el-card__header { | |
| 38 | + padding: 24px 40px; | |
| 39 | + background-color: #f9f9f9; | |
| 40 | + border-bottom: none; | |
| 41 | +} | |
| 42 | +.el-card__body { | |
| 43 | + padding: 40px; | |
| 44 | +} | |
| 45 | +.el-form-item__label { | |
| 46 | + font-size: 16px; | |
| 47 | + color: #333333; | |
| 48 | +} | |
| 49 | +.el-radio__label { | |
| 50 | + font-size: 16px; | |
| 51 | + color: #333333; | |
| 52 | +} | |
| 53 | +.title-big { | |
| 54 | + font-size: 24px; | |
| 55 | + font-weight: Semibold; | |
| 56 | + color: #666666; | |
| 57 | +} | |
| 58 | +.title-small { | |
| 59 | + font-size: 14px; | |
| 60 | + color: #999999; | |
| 61 | + margin-left: 10px; | |
| 62 | +} | |
| 63 | +.init-tooltip { | |
| 64 | + position: absolute; | |
| 65 | + top: 10px; | |
| 66 | + left: 190px; | |
| 67 | + margin-left: 10px; | |
| 68 | +} | |
| 69 | +.diy-button { | |
| 70 | + height: 40px; | |
| 71 | + font-size: 16px; | |
| 72 | + border-radius: 6px; | |
| 73 | +} | |
| 74 | +.width-140 { | |
| 75 | + width: 140px; | |
| 76 | +} | |
| 77 | +.width-190 { | |
| 78 | + width: 190px; | |
| 79 | +} | |
| 80 | +.bg-blue { | |
| 81 | + background-color: #4A90E2; | |
| 82 | + border-color: #4A90E2; | |
| 83 | +} | |
| 84 | +.bg-red { | |
| 85 | + background-color: #D11244; | |
| 86 | + border-color: #D11244; | |
| 87 | +} | |
| 88 | +.bg-white { | |
| 89 | + background-color: transparent; | |
| 90 | + border-color: #B4B4B4; | |
| 91 | +} | |
| 92 | +.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before, .el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before { | |
| 93 | + color: #FF725C; | |
| 94 | +} | |
| 95 | +/* !!!!! */ | |
| 96 | +.el-input { | |
| 97 | + --el-input-placeholder-color: #b4b4b4; | |
| 98 | +} | |
| 99 | +.el-input__inner { | |
| 100 | + font-size: 16px; | |
| 101 | + color: #333333; | |
| 102 | +} | |
| 103 | +/* !!!!! */ | |
| 104 | +.el-input__inner:hover { | |
| 105 | + --el-input-focus-border: #4A90E2; | |
| 106 | +} | |
| 107 | +.el-textarea__inner { | |
| 108 | + resize: none; | |
| 109 | + line-height: 22px; | |
| 110 | + font-size: 16px; | |
| 111 | + color: #333333; | |
| 112 | +} | |
| 113 | +.el-radio__inner { | |
| 114 | + width: 16px; | |
| 115 | + height: 16px; | |
| 116 | + border: 1px solid #E3E3E3; | |
| 117 | +} | |
| 118 | +.el-divider--horizontal { | |
| 119 | + margin: 30px 0; | |
| 120 | +} | |
| 121 | +.el-radio__input.is-checked+.el-radio__label { | |
| 122 | + color: #4A90E2; | |
| 123 | +} | |
| 124 | +textarea { | |
| 125 | + font-family: initial; | |
| 126 | +} | |
| 0 | 127 | \ No newline at end of file | ... | ... |
src/css/test.css
| 1 | +/* vue version 3 css */ | |
| 1 | 2 | .diy-reset { |
| 2 | 3 | margin: 0; |
| 3 | 4 | padding: 0 |
| ... | ... | @@ -58,6 +59,12 @@ |
| 58 | 59 | color: #999999; |
| 59 | 60 | margin-left: 10px; |
| 60 | 61 | } |
| 62 | +.init-tooltip { | |
| 63 | + position: absolute; | |
| 64 | + top: 10px; | |
| 65 | + left: 190px; | |
| 66 | + margin-left: 10px; | |
| 67 | +} | |
| 61 | 68 | .diy-button { |
| 62 | 69 | height: 40px; |
| 63 | 70 | font-size: 16px; |
| ... | ... | @@ -109,4 +116,7 @@ |
| 109 | 116 | } |
| 110 | 117 | .el-divider--horizontal { |
| 111 | 118 | margin: 30px 0; |
| 119 | +} | |
| 120 | +.el-radio__input.is-checked+.el-radio__label { | |
| 121 | + color: #4A90E2; | |
| 112 | 122 | } |
| 113 | 123 | \ No newline at end of file | ... | ... |
src/html/failed.html
| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | <meta http-equiv="Expires" CONTENT="0"> |
| 9 | 9 | <meta http-equiv="Cache-Control" CONTENT="no-cache"> |
| 10 | 10 | <meta http-equiv="Pragma" CONTENT="no-cache"> |
| 11 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| 11 | 12 | <link rel="shortcut icon" href="/cms.ico" /> |
| 12 | 13 | <link rel="bookmark" href="/cms.ico" /> |
| 13 | 14 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-plus@1.1.0-beta.12/theme-chalk/index.css"> |
| ... | ... | @@ -71,8 +72,9 @@ |
| 71 | 72 | }, |
| 72 | 73 | methods: { |
| 73 | 74 | closeMask() { |
| 75 | + // window.close() | |
| 74 | 76 | // 装有iframe的页面监听到内容为【true】时要执行关闭弹窗操作。 |
| 75 | - parent.postMessage(true, '*') | |
| 77 | + // parent.postMessage(true, '*') | |
| 76 | 78 | } |
| 77 | 79 | } |
| 78 | 80 | } | ... | ... |
src/html/index.html
| ... | ... | @@ -7,11 +7,12 @@ |
| 7 | 7 | <title>CNLive Audio Panel</title> |
| 8 | 8 | <meta http-equiv="Expires" CONTENT="0"> |
| 9 | 9 | <meta http-equiv="Cache-Control" CONTENT="no-cache"> |
| 10 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| 10 | 11 | <meta http-equiv="Pragma" CONTENT="no-cache"> |
| 11 | 12 | <link rel="shortcut icon" href="/cms.ico" /> |
| 12 | 13 | <link rel="bookmark" href="/cms.ico" /> |
| 14 | + <!-- element 3 plus --> | |
| 13 | 15 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-plus@1.1.0-beta.12/theme-chalk/index.css"> |
| 14 | - <script src="https://cdn.jsdelivr.net/npm/vue@3.2.11/dist/vue.global.js"></script> | |
| 15 | 16 | <style> |
| 16 | 17 | [v-cloak] { |
| 17 | 18 | display: none; |
| ... | ... | @@ -20,6 +21,58 @@ |
| 20 | 21 | </head> |
| 21 | 22 | |
| 22 | 23 | <body id="body" class="diy-reset"> |
| 24 | + <script> | |
| 25 | + parent.postMessage(1000, '*') | |
| 26 | + </script> | |
| 27 | + <!-- 别人家资源外链 3 --> | |
| 28 | + <!-- vue 3 --> | |
| 29 | + <!-- <script src="https://cdn.jsdelivr.net/npm/vue@3.2.11/dist/vue.global.js"></script> | |
| 30 | + <script src="https://cdn.jsdelivr.net/npm/element-plus@1.1.0-beta.12"></script> | |
| 31 | + <script src="https://cdn.jsdelivr.net/npm/axios@0.17.1/dist/axios.min.js"></script> | |
| 32 | + <script src="https://cdn.jsdelivr.net/npm/qiniu-js@2.5.5/dist/qiniu.min.js"></script> --> | |
| 33 | + | |
| 34 | + <!-- 本公司资源外链备份 2 --> | |
| 35 | + <!-- <script type="text/javascript"> | |
| 36 | + if (typeof axios == 'undefined') { | |
| 37 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 38 | + } | |
| 39 | + if (typeof Vue == 'undefined') { | |
| 40 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 41 | + } | |
| 42 | + if (typeof ELEMENT == 'undefined') { | |
| 43 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 44 | + } | |
| 45 | + if(typeof qiniu == 'undefined') { | |
| 46 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 47 | + } | |
| 48 | + </script> --> | |
| 49 | + | |
| 50 | + <!-- 本域名资源备份 1 --> | |
| 51 | + <script type="text/javascript"> | |
| 52 | + if (typeof axios == 'undefined') { | |
| 53 | + document.write(unescape("%3Cscript src='./static/jsCdn/axios.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| 54 | + } | |
| 55 | + if (typeof Vue == 'undefined') { | |
| 56 | + document.write(unescape("%3Cscript src='./static/jsCdn/vue.global.js' type='text/javascript'%3E%3C/script%3E")); | |
| 57 | + } | |
| 58 | + if (typeof ElementPlus == 'undefined') { | |
| 59 | + document.write(unescape( | |
| 60 | + "%3Cscript src='./static/jsCdn/element-plus.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| 61 | + } | |
| 62 | + if (typeof qiniu == 'undefined') { | |
| 63 | + document.write(unescape("%3Cscript src='./static/jsCdn/qiniu.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| 64 | + } | |
| 65 | + </script> | |
| 66 | + | |
| 67 | + <script> | |
| 68 | + var UA = window.navigator.userAgent | |
| 69 | + var msie = UA.indexOf("MSIE") | |
| 70 | + if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { | |
| 71 | + alert("为了您的数据安全,请使用Chrome内核浏览器阅览本站内容!") | |
| 72 | + location.href = 'version.html' | |
| 73 | + } | |
| 74 | + </script> | |
| 75 | + | |
| 23 | 76 | <div id="audioPage" class="page-container" v-cloak> |
| 24 | 77 | <el-card shadow="never"> |
| 25 | 78 | <template #header> |
| ... | ... | @@ -73,20 +126,28 @@ |
| 73 | 126 | :before-remove="handleRemove" :disabled="btnDisabled" :show-file-list="false"> |
| 74 | 127 | <el-button size="small" type="primary" :disabled="btnDisabled" class="diy-button width-190 bg-blue">选择文件 |
| 75 | 128 | </el-button> |
| 76 | - <el-tooltip placement="top"> | |
| 129 | + <!-- <el-tooltip placement="top"> | |
| 77 | 130 | <template #content> |
| 78 | 131 | <p>1)可上传的音频格式:mp3/flac/wav/ogg/mpg/wma/aac/acc/m4a。</p> |
| 79 | 132 | <p>2)音频上传过程中,请勿离开此页面或者刷新此页面,否则会导致音频上传任务失败!</p> |
| 80 | 133 | <p>3)音频文件大小上限:500M,数量上限:1。</p> |
| 81 | 134 | </template> |
| 82 | 135 | <el-button type="text" size="mini" class="title-small">上传须知</el-button> |
| 83 | - </el-tooltip> | |
| 136 | + </el-tooltip> --> | |
| 84 | 137 | </el-upload> |
| 138 | + <el-tooltip placement="top"> | |
| 139 | + <template #content> | |
| 140 | + <p>1)可上传的音频格式:mp3/flac/wav/ogg/mpg/wma/aac/acc/m4a。</p> | |
| 141 | + <p>2)音频上传过程中,请勿离开此页面或者刷新此页面,否则会导致音频上传任务失败!</p> | |
| 142 | + <p>3)音频文件大小上限:500M,数量上限:1。</p> | |
| 143 | + </template> | |
| 144 | + <el-button type="text" size="mini" class="title-small init-tooltip">上传须知</el-button> | |
| 145 | + </el-tooltip> | |
| 85 | 146 | <!-- <span class="diy-danger">{{msgText}}</span> --> |
| 86 | 147 | </el-form-item> |
| 87 | 148 | <!-- <el-form-item class="diy-flex-50" label="上传须知"> --> |
| 88 | - <!-- <el-button class="diy-button width-140 bg-white">查看</el-button> --> | |
| 89 | - <!-- <el-tooltip placement="top"> | |
| 149 | + <!-- <el-button class="diy-button width-140 bg-white">查看</el-button> --> | |
| 150 | + <!-- <el-tooltip placement="top"> | |
| 90 | 151 | <template #content> |
| 91 | 152 | <p>1)可上传的音频格式:mp3/flac/wav/ogg/mpg/wma/aac/acc/m4a。</p> |
| 92 | 153 | <p>2)音频上传过程中,请勿离开此页面或者刷新此页面,否则会导致音频上传任务失败!</p> |
| ... | ... | @@ -97,7 +158,7 @@ |
| 97 | 158 | <el-divider></el-divider> |
| 98 | 159 | <el-form-item class="diy-flex-50 diy-text-left"> |
| 99 | 160 | <div> |
| 100 | - <div class="diy-tip">{{form.audioFile?.name}} </div> | |
| 161 | + <div class="diy-tip">{{form.audioFile? form.audioFile.name: ''}} </div> | |
| 101 | 162 | <div class="diy-tip" v-if="percent > 0 && percent < 100"> 已上传{{Math.ceil(percent)}}%,请耐心等待……</div> |
| 102 | 163 | <div class="diy-tip" v-if="percent == 100"> 上传完成</div> |
| 103 | 164 | </div> |
| ... | ... | @@ -119,9 +180,6 @@ |
| 119 | 180 | </div> |
| 120 | 181 | </el-card> |
| 121 | 182 | </div> |
| 122 | - <script src="https://cdn.jsdelivr.net/npm/element-plus@1.1.0-beta.12"></script> | |
| 123 | - <script src="https://cdn.jsdelivr.net/npm/axios@0.17.1/dist/axios.min.js"></script> | |
| 124 | - <script src="https://cdn.jsdelivr.net/npm/qiniu-js@2.5.5/dist/qiniu.min.js"></script> | |
| 125 | 183 | </body> |
| 126 | 184 | |
| 127 | 185 | </html> |
| 128 | 186 | \ No newline at end of file | ... | ... |
src/html/success.html
| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | <meta http-equiv="Expires" CONTENT="0"> |
| 9 | 9 | <meta http-equiv="Cache-Control" CONTENT="no-cache"> |
| 10 | 10 | <meta http-equiv="Pragma" CONTENT="no-cache"> |
| 11 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| 11 | 12 | <link rel="shortcut icon" href="/cms.ico" /> |
| 12 | 13 | <link rel="bookmark" href="/cms.ico" /> |
| 13 | 14 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-plus@1.1.0-beta.12/theme-chalk/index.css"> |
| ... | ... | @@ -76,8 +77,9 @@ |
| 76 | 77 | }, |
| 77 | 78 | methods: { |
| 78 | 79 | closeMask() { |
| 80 | + // window.close() | |
| 79 | 81 | // 装有iframe的页面监听到内容为【true】时要执行关闭弹窗操作。 |
| 80 | - parent.postMessage(true, '*') | |
| 82 | + // parent.postMessage(true, '*') | |
| 81 | 83 | } |
| 82 | 84 | } |
| 83 | 85 | } | ... | ... |
src/html/v2.html
0 → 100644
| 1 | +<!DOCTYPE html> | |
| 2 | +<html> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="utf-8"> | |
| 6 | + <meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
| 7 | + <title>CNLive Audio Panel</title> | |
| 8 | + <meta http-equiv="Expires" CONTENT="0"> | |
| 9 | + <meta http-equiv="Cache-Control" CONTENT="no-cache"> | |
| 10 | + <meta http-equiv="Pragma" CONTENT="no-cache"> | |
| 11 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| 12 | + <link rel="shortcut icon" href="/cms.ico" /> | |
| 13 | + <link rel="bookmark" href="/cms.ico" /> | |
| 14 | + <!-- element 2 --> | |
| 15 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.15.5/lib/theme-chalk/index.css"> | |
| 16 | + <style> | |
| 17 | + [v-cloak] { | |
| 18 | + display: none; | |
| 19 | + } | |
| 20 | + </style> | |
| 21 | +</head> | |
| 22 | + | |
| 23 | +<body id="body" class="diy-reset"> | |
| 24 | + <script> | |
| 25 | + parent.postMessage(1000, '*') | |
| 26 | + </script> | |
| 27 | + | |
| 28 | + <script src="https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.min.js"></script> | |
| 29 | + <script src="https://cdn.jsdelivr.net/npm/element-ui@2.15.5/lib/index.js"></script> | |
| 30 | + <script src="https://cdn.jsdelivr.net/npm/axios@0.17.1/dist/axios.min.js"></script> | |
| 31 | + <script src="https://cdn.jsdelivr.net/npm/qiniu-js@2.5.5/dist/qiniu.min.js"></script> | |
| 32 | + | |
| 33 | + <!-- 本公司资源外链备份 2 --> | |
| 34 | + <!-- <script type="text/javascript"> | |
| 35 | + if (typeof axios == 'undefined') { | |
| 36 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 37 | + } | |
| 38 | + if (typeof Vue == 'undefined') { | |
| 39 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 40 | + } | |
| 41 | + if (typeof ELEMENT == 'undefined') { | |
| 42 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 43 | + } | |
| 44 | + if(typeof qiniu == 'undefined') { | |
| 45 | + // document.write(unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E")); | |
| 46 | + } | |
| 47 | + </script> --> | |
| 48 | + | |
| 49 | + <script type="text/javascript"> | |
| 50 | + if (typeof axios == 'undefined') { | |
| 51 | + document.write(unescape("%3Cscript src='./static/jsCdn/axios.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| 52 | + } | |
| 53 | + if (typeof Vue == 'undefined') { | |
| 54 | + document.write(unescape("%3Cscript src='./static/jsCdn/vue.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| 55 | + } | |
| 56 | + if (typeof ELEMENT == 'undefined') { | |
| 57 | + document.write(unescape( | |
| 58 | + "%3Cscript src='./static/jsCdn/element-index.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| 59 | + } | |
| 60 | + if (typeof qiniu == 'undefined') { | |
| 61 | + document.write(unescape("%3Cscript src='./static/jsCdn/qiniu.min.js' type='text/javascript'%3E%3C/script%3E")); | |
| 62 | + } | |
| 63 | + </script> | |
| 64 | + | |
| 65 | + <div id="mainPage" class="page-container" v-cloak> | |
| 66 | + <el-card shadow="never"> | |
| 67 | + <div slot="header" class="card-header"> | |
| 68 | + <span class="title-big">歌曲征集</span> | |
| 69 | + <span class="title-small">/ 带*号为必填项</span> | |
| 70 | + </div> | |
| 71 | + <div> | |
| 72 | + <el-form ref="songs" :model="form" label-width="120px" :rules="rules" class="diy-flex" label-position="right"> | |
| 73 | + <el-form-item :label="labels.channelId" class="diy-flex-100" prop="channelId"> | |
| 74 | + <el-radio-group v-model="form.channelId" @change="handleChange"> | |
| 75 | + <el-radio :label="1278">热歌榜</el-radio> | |
| 76 | + <el-radio :label="1279">优秀作词榜</el-radio> | |
| 77 | + <el-radio :label="1280">优秀作曲榜</el-radio> | |
| 78 | + <el-radio :label="1281">其他</el-radio> | |
| 79 | + </el-radio-group> | |
| 80 | + </el-form-item> | |
| 81 | + <el-form-item :label="labels.songName" class="diy-flex-50" prop="songName"> | |
| 82 | + <el-input v-model.trim="form.songName" :maxlength="100" :minlength="1" placeholder="请输入歌曲名字"></el-input> | |
| 83 | + </el-form-item> | |
| 84 | + <el-form-item :label="labels.singer" class="diy-flex-50" prop="singer"> | |
| 85 | + <el-input v-model.trim="form.singer" :maxlength="15" placeholder="请输入歌手名字"></el-input> | |
| 86 | + </el-form-item> | |
| 87 | + <el-form-item :label="labels.lyricist" class="diy-flex-50" prop="lyricist"> | |
| 88 | + <el-input v-model.trim="form.lyricist" :maxlength="15" placeholder="请输入作词人名字"></el-input> | |
| 89 | + </el-form-item> | |
| 90 | + <el-form-item :label="labels.songwriter" class="diy-flex-50" prop="songwriter"> | |
| 91 | + <el-input v-model.trim="form.songwriter" :maxlength="15" placeholder="请输入作曲人名字"></el-input> | |
| 92 | + </el-form-item> | |
| 93 | + <el-form-item :label="labels.redact" class="diy-flex-50" prop="redact"> | |
| 94 | + <el-input v-model.trim="form.redact" :maxlength="15" placeholder="请输入编曲人名字"></el-input> | |
| 95 | + </el-form-item> | |
| 96 | + <el-form-item :label="labels.mixing" class="diy-flex-50" prop="mixing"> | |
| 97 | + <el-input v-model.trim="form.mixing" :maxlength="15" placeholder="请输入混音人名字"></el-input> | |
| 98 | + </el-form-item> | |
| 99 | + <el-form-item :label="labels.lyric" class="diy-flex-100" prop="lyric"> | |
| 100 | + <el-input v-model="form.lyric" maxlength="2500" :minlength="20" show-word-limit type="textarea" :rows="10" | |
| 101 | + placeholder="请输入歌词"></el-input> | |
| 102 | + </el-form-item> | |
| 103 | + <el-form-item :label="labels.phone" class="diy-flex-50" prop="phone"> | |
| 104 | + <el-input v-model.trim="form.phone" :maxlength="11" placeholder="请输入手机号码"></el-input> | |
| 105 | + </el-form-item> | |
| 106 | + <el-form-item :label="labels.name" class="diy-flex-50" prop="name"> | |
| 107 | + <el-input v-model.trim="form.name" :maxlength="50" placeholder="请输入联系人姓名"></el-input> | |
| 108 | + </el-form-item> | |
| 109 | + <el-form-item :label="labels.audioFile" class="diy-flex-50" prop="audioFile"> | |
| 110 | + <!-- <el-upload class="upload-demo" :action="uploadUrl" :auto-upload="false" :file-list="fileList" | |
| 111 | + accept=".mp3, .flac, .ogg, .wav, .mpg, .wma, .aac, .m4a" @change="getMp3" :on-exceed="exceed" | |
| 112 | + :before-remove="handleRemove" :disabled="btnDisabled" :show-file-list="false"> | |
| 113 | + <el-button size="small" type="primary" :disabled="btnDisabled" class="diy-button width-190 bg-blue">选择文件 | |
| 114 | + </el-button> | |
| 115 | + </el-upload> --> | |
| 116 | + <el-upload class="upload-demo" :action="uploadUrl" :auto-upload="false" | |
| 117 | + accept=".mp3, .flac, .ogg, .wav, .mpg, .wma, .aac, .m4a" :before-remove="handleRemove" | |
| 118 | + :disabled="btnDisabled" :on-change="getMp3" :on-exceed="exceed" :file-list="fileList" | |
| 119 | + :show-file-list="false"> | |
| 120 | + <el-button size="small" type="primary" :disabled="btnDisabled" class="diy-button width-190 bg-blue">选择文件 | |
| 121 | + </el-button> | |
| 122 | + </el-upload> | |
| 123 | + <el-tooltip placement="top"> | |
| 124 | + <div slot="content"> | |
| 125 | + <p>1)可上传的音频格式:mp3/flac/wav/ogg/mpg/wma/aac/acc/m4a。</p> | |
| 126 | + <p>2)音频上传过程中,请勿离开此页面或者刷新此页面,否则会导致音频上传任务失败!</p> | |
| 127 | + <p>3)音频文件大小上限:500M,数量上限:1。</p> | |
| 128 | + </div> | |
| 129 | + <el-button type="text" size="mini" class="title-small init-tooltip">上传须知</el-button> | |
| 130 | + </el-tooltip> | |
| 131 | + <!-- <el-tooltip placement="top"> | |
| 132 | + <template #content> | |
| 133 | + <p>1)可上传的音频格式:mp3/flac/wav/ogg/mpg/wma/aac/acc/m4a。</p> | |
| 134 | + <p>2)音频上传过程中,请勿离开此页面或者刷新此页面,否则会导致音频上传任务失败!</p> | |
| 135 | + <p>3)音频文件大小上限:500M,数量上限:1。</p> | |
| 136 | + </template> | |
| 137 | + <el-button type="text" size="mini" class="title-small init-tooltip">上传须知</el-button> | |
| 138 | + </el-tooltip> --> | |
| 139 | + </el-form-item> | |
| 140 | + <el-divider></el-divider> | |
| 141 | + <el-form-item class="diy-flex-50 diy-text-left"> | |
| 142 | + <div> | |
| 143 | + <div class="diy-tip">{{form.audioFile? form.audioFile.name: ''}} </div> | |
| 144 | + <div class="diy-tip" v-if="percent > 0 && percent < 100"> 已上传{{Math.ceil(percent)}}%,请耐心等待……</div> | |
| 145 | + <div class="diy-tip" v-if="percent == 100"> 上传完成</div> | |
| 146 | + </div> | |
| 147 | + <div v-if="errorMsg"> | |
| 148 | + <div class="diy-error">{{errorMsg}}</div> | |
| 149 | + </div> | |
| 150 | + </el-form-item> | |
| 151 | + <el-form-item class="diy-flex-50 diy-text-right"> | |
| 152 | + <el-button @click="reset" class="diy-button width-140 bg-white" v-if="form.channelId == 1279">取消</el-button> | |
| 153 | + <el-button @click="reset" class="diy-button width-140 bg-white" v-else | |
| 154 | + :disabled="!form.audioFile || submitDisabled">取消</el-button> | |
| 155 | + | |
| 156 | + <el-button type="danger" class="diy-button width-140 bg-red" @click="submit('songs')" | |
| 157 | + v-if="form.channelId == 1279">确定上传</el-button> | |
| 158 | + <el-button type="danger" class="diy-button width-140 bg-red" @click="submit('songs')" v-else | |
| 159 | + :disabled="!form.audioFile || submitDisabled">确定上传</el-button> | |
| 160 | + </el-form-item> | |
| 161 | + </el-form> | |
| 162 | + </div> | |
| 163 | + </el-card> | |
| 164 | + </div> | |
| 165 | +</body> | |
| 166 | + | |
| 167 | +</html> | |
| 0 | 168 | \ No newline at end of file | ... | ... |
src/html/version.html
0 → 100644
| 1 | +<!DOCTYPE html> | |
| 2 | +<html> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="utf-8"> | |
| 6 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
| 8 | + <link rel="icon" href="cms.ico"> | |
| 9 | + <title>CNLive Audio Panel</title> | |
| 10 | + <style> | |
| 11 | + .version-page { | |
| 12 | + text-align: center; | |
| 13 | + } | |
| 14 | + | |
| 15 | + .b-container { | |
| 16 | + width: 60%; | |
| 17 | + margin: 0 auto; | |
| 18 | + margin-top: 200px; | |
| 19 | + } | |
| 20 | + </style> | |
| 21 | +</head> | |
| 22 | + | |
| 23 | +<body> | |
| 24 | + <div class="version-page"> | |
| 25 | + <div class="b-container"> | |
| 26 | + <h2>为了您的数据安全,请使用chrome内核的浏览器阅览本站内容。</h2> | |
| 27 | + <h3>推荐浏览器:</h3> | |
| 28 | + <div style="margin: 10px 0;"><a href="https://www.google.cn/chrome/" target="_blank">Chrome 谷歌浏览器</a></div> | |
| 29 | + <div style="margin: 10px 0;"><a href="http://www.firefox.com.cn/" target="_blank">FireFox 火狐浏览器</a></div> | |
| 30 | + <div style="margin: 10px 0;"><a href="http://browser.360.cn/" target="_blank">360浏览器【极速】模式</a></div> | |
| 31 | + <h5 style="color: red;">请避免使用360浏览器【兼容】模式</h5> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + <noscript> | |
| 35 | + <strong>We're sorry but it doesn't work properly without JavaScript enabled. Please enable it | |
| 36 | + to continue.</strong> | |
| 37 | + </noscript> | |
| 38 | + <!-- built files will be auto injected --> | |
| 39 | +</body> | |
| 40 | + | |
| 41 | +</html> | |
| 0 | 42 | \ No newline at end of file | ... | ... |
src/js/audio.js
0 → 100644
| 1 | +import 'babel-polyfill' | |
| 2 | +import * as all from "./config"; | |
| 3 | +console.log('66666') | |
| 4 | +import './../css/reui.css'; | |
| 5 | +// require("./../css/test.css"); | |
| 6 | +var Main = { | |
| 7 | + // data() { | |
| 8 | + // return { | |
| 9 | + // value: '', | |
| 10 | + // testData: 'I am tengxi' | |
| 11 | + // }; | |
| 12 | + // } | |
| 13 | + data() { | |
| 14 | + return { | |
| 15 | + form: { | |
| 16 | + channelId: null, | |
| 17 | + songName: null, | |
| 18 | + singer: null, | |
| 19 | + lyricist: null, | |
| 20 | + songwriter: null, | |
| 21 | + redact: null, | |
| 22 | + mixing: null, | |
| 23 | + lyric: null, | |
| 24 | + phone: null, | |
| 25 | + name: null, | |
| 26 | + audioId: null, | |
| 27 | + audioFile: null, | |
| 28 | + }, | |
| 29 | + labels: all.formLabels, | |
| 30 | + rules: { | |
| 31 | + songName: [ | |
| 32 | + { | |
| 33 | + required: true, | |
| 34 | + trigger: "change", | |
| 35 | + message: "请填写歌曲名字", | |
| 36 | + }, | |
| 37 | + ], | |
| 38 | + name: [ | |
| 39 | + { required: true, trigger: "change", message: "请填写联系人姓名" }, | |
| 40 | + ], | |
| 41 | + phone: [ | |
| 42 | + { | |
| 43 | + required: true, | |
| 44 | + trigger: "change", | |
| 45 | + message: "请填写格式正确的手机号码", | |
| 46 | + validator: all.validatePhone, | |
| 47 | + }, | |
| 48 | + ], | |
| 49 | + audioFile: [ | |
| 50 | + { required: true, trigger: "change", message: "请上传音频" }, | |
| 51 | + ], | |
| 52 | + channelId: [ | |
| 53 | + { required: true, trigger: "change", message: "请选择作品类型" }, | |
| 54 | + ], | |
| 55 | + audioId: [ | |
| 56 | + { | |
| 57 | + required: true, | |
| 58 | + trigger: "change", | |
| 59 | + message: "请上传音频文件以获取音频ID", | |
| 60 | + }, | |
| 61 | + ], | |
| 62 | + singer: [ | |
| 63 | + { required: false, trigger: "change", message: "请输入歌手名字" }, | |
| 64 | + ], | |
| 65 | + lyricist: [ | |
| 66 | + { required: false, trigger: "change", message: "请输入作词人名字" }, | |
| 67 | + ], | |
| 68 | + songwriter: [ | |
| 69 | + { required: false, trigger: "change", message: "请输入作曲人名字" }, | |
| 70 | + ], | |
| 71 | + lyric: [ | |
| 72 | + { | |
| 73 | + required: false, | |
| 74 | + trigger: "change", | |
| 75 | + message: "请输入符合要求的歌词,至少20个字,最多不能超过2500个字", | |
| 76 | + validator: all.validateLyric, | |
| 77 | + }, | |
| 78 | + ], | |
| 79 | + }, | |
| 80 | + | |
| 81 | + uploadUrl: "", | |
| 82 | + fileList: [], | |
| 83 | + token: "", | |
| 84 | + btnDisabled: false, | |
| 85 | + submitDisabled: false, | |
| 86 | + msgText: | |
| 87 | + "只能上传一个mp3/flac/wav/ogg/mpg/wma/aac/acc/m4a格式的音频文件,且不超过500mb。上传过程中请勿刷新页面。", | |
| 88 | + percent: 0, | |
| 89 | + curFile: "", | |
| 90 | + errorMsg: "", | |
| 91 | + }; | |
| 92 | + }, | |
| 93 | + methods: { | |
| 94 | + // 作品类型为【词】的时候可以不上传文件 | |
| 95 | + handleChange(data) { | |
| 96 | + if (data == 1279) { | |
| 97 | + // 优秀作词榜 | |
| 98 | + this.rules.audioFile[0].required = false; | |
| 99 | + this.rules.audioId[0].required = false; | |
| 100 | + this.rules.singer[0].required = false; | |
| 101 | + this.rules.songwriter[0].required = false; | |
| 102 | + this.rules.lyricist[0].required = true; | |
| 103 | + this.rules.lyric[0].required = true; | |
| 104 | + } else if (data == 1278) { | |
| 105 | + // 成品 | |
| 106 | + this.rules.singer[0].required = true; | |
| 107 | + this.rules.audioFile[0].required = true; | |
| 108 | + this.rules.audioId[0].required = true; | |
| 109 | + this.rules.lyricist[0].required = false; | |
| 110 | + this.rules.songwriter[0].required = false; | |
| 111 | + this.rules.lyric[0].required = false; | |
| 112 | + } else if (data == 1280) { | |
| 113 | + // 作曲 | |
| 114 | + this.rules.songwriter[0].required = true; | |
| 115 | + this.rules.audioFile[0].required = true; | |
| 116 | + this.rules.audioId[0].required = true; | |
| 117 | + this.rules.singer[0].required = false; | |
| 118 | + this.rules.lyricist[0].required = false; | |
| 119 | + this.rules.lyric[0].required = false; | |
| 120 | + } else if (data == 1281) { | |
| 121 | + // 其他 | |
| 122 | + this.rules.songwriter[0].required = false; | |
| 123 | + this.rules.audioFile[0].required = true; | |
| 124 | + this.rules.audioId[0].required = true; | |
| 125 | + this.rules.singer[0].required = false; | |
| 126 | + this.rules.lyricist[0].required = false; | |
| 127 | + this.rules.lyric[0].required = false; | |
| 128 | + } | |
| 129 | + }, | |
| 130 | + // 文件数量超上限响应 | |
| 131 | + exceed(e, d) { | |
| 132 | + this.$message.error("只能上传一个文件"); | |
| 133 | + this.errorMsg = "只能上传一个文件"; | |
| 134 | + }, | |
| 135 | + // 表单重置按钮响应 | |
| 136 | + reset() { | |
| 137 | + for (let i in this.form) { | |
| 138 | + this.form[i] = null; | |
| 139 | + } | |
| 140 | + this.percent = 0; | |
| 141 | + this.btnDisabled = false; | |
| 142 | + this.submitDisabled = false; | |
| 143 | + }, | |
| 144 | + // 文件移除响应,暂未启用 | |
| 145 | + handleRemove(file, list) { | |
| 146 | + if (this.percent < 100) { | |
| 147 | + this.errorMsg = "上传中的文件不可删除"; | |
| 148 | + this.$message({ | |
| 149 | + type: "error", | |
| 150 | + duration: 5000, | |
| 151 | + message: "上传中的文件不可被删除", | |
| 152 | + }); | |
| 153 | + return false; | |
| 154 | + } else { | |
| 155 | + this.form.audioId = null; | |
| 156 | + this.percent = 0; | |
| 157 | + } | |
| 158 | + }, | |
| 159 | + // 校验Md5 | |
| 160 | + initMd5(fileObj) { | |
| 161 | + return new Promise((resolve, reject) => { | |
| 162 | + const fileName = fileObj.name.split(".")[0]; | |
| 163 | + const fileType = fileObj.name.split(".")[1]; | |
| 164 | + const fileSize = fileObj.size; | |
| 165 | + const fileModifyDate = fileObj.lastModifiedDate; | |
| 166 | + const md5Str = all | |
| 167 | + .initVideoMd5( | |
| 168 | + [fileType, fileSize, fileModifyDate || fileName].join("_") | |
| 169 | + ) | |
| 170 | + .toLowerCase(); | |
| 171 | + if (md5Str) { | |
| 172 | + resolve(md5Str); | |
| 173 | + } else { | |
| 174 | + reject("校验失败"); | |
| 175 | + } | |
| 176 | + }); | |
| 177 | + }, | |
| 178 | + // 确认提交按钮响应,上传视频到七牛 | |
| 179 | + submit(formName) { | |
| 180 | + this.$refs[formName].validate((valid) => { | |
| 181 | + if (valid) { | |
| 182 | + this.submitDisabled = true; | |
| 183 | + this.btnDisabled = true; | |
| 184 | + if (this.form.channelId == 1279) { | |
| 185 | + this.postCms(); | |
| 186 | + } else { | |
| 187 | + const fileName = this.form.audioFile.raw.name.split("."); | |
| 188 | + fileName.splice(fileName.length - 1, 1); | |
| 189 | + this.curFile = this.form.audioFile.name; | |
| 190 | + this.form.audioId = null; | |
| 191 | + const that = this; | |
| 192 | + const fileBaseObj = { | |
| 193 | + videoName: fileName.join("."), | |
| 194 | + md5: null, | |
| 195 | + }; | |
| 196 | + const fileSaveObj = { | |
| 197 | + videoId: null, | |
| 198 | + | |
| 199 | + multipleCategory: | |
| 200 | + 100005 + "/" + this.getCategoryText(this.form.channelId), | |
| 201 | + tag: this.getChannelText(this.form.channelId), | |
| 202 | + ts: this.getTs(), | |
| 203 | + timestamp: this.getTimeStamp(), | |
| 204 | + masterId: all.secretUrls.masterIdMaster, | |
| 205 | + // masterId: all.secretUrls.masterIdDev, | |
| 206 | + }; | |
| 207 | + const fileInitObj = { | |
| 208 | + gfmt: this.form.audioFile.raw.name.split(".").reverse().shift(), | |
| 209 | + fileSize: this.form.audioFile.raw.size, | |
| 210 | + ts: this.getTs(), | |
| 211 | + timestamp: this.getTimeStamp(), | |
| 212 | + multipleCategory: | |
| 213 | + 100005 + "/" + this.getCategoryText(this.form.channelId), | |
| 214 | + // masterId: all.secretUrls.masterIdDev, | |
| 215 | + masterId: all.secretUrls.masterIdMaster, | |
| 216 | + }; | |
| 217 | + const fileWholeObj = { | |
| 218 | + file: this.form.audioFile.raw, | |
| 219 | + uploadStatus: "ready", | |
| 220 | + proCount: 0, | |
| 221 | + fileKey: null, | |
| 222 | + observable: null, | |
| 223 | + subscription: null, | |
| 224 | + }; | |
| 225 | + | |
| 226 | + const observer = { | |
| 227 | + next(res) { | |
| 228 | + if (res.total.percent >= 99) { | |
| 229 | + that.percent = 99; | |
| 230 | + } else { | |
| 231 | + that.percent = Math.ceil(res.total.percent); | |
| 232 | + } | |
| 233 | + }, | |
| 234 | + error(err) { | |
| 235 | + console.log(err); | |
| 236 | + }, | |
| 237 | + complete(res) { | |
| 238 | + let apiDone = all.secretUrls.base + all.secretUrls.finish; | |
| 239 | + let apiStringSignDone = all.signFunction( | |
| 240 | + apiDone, | |
| 241 | + that.getParamsList({ | |
| 242 | + hash: res.hash, | |
| 243 | + key: res.key, | |
| 244 | + vid: fileSaveObj.videoId, | |
| 245 | + timestamp: that.getTimeStamp(), | |
| 246 | + }) | |
| 247 | + ); | |
| 248 | + all | |
| 249 | + .request({ | |
| 250 | + url: apiDone, | |
| 251 | + method: "get", | |
| 252 | + params: all.parseQueryString(apiStringSignDone), | |
| 253 | + }) | |
| 254 | + .then((res) => { | |
| 255 | + if ( | |
| 256 | + res && | |
| 257 | + res.data && | |
| 258 | + res.data.errorCode && | |
| 259 | + res.data.errorCode != 0 | |
| 260 | + ) { | |
| 261 | + that.errorMsg = "系统错误,请联系管理员"; | |
| 262 | + // that.reset(); | |
| 263 | + this.submitDisabled = false; | |
| 264 | + this.btnDisabled = false; | |
| 265 | + return false; | |
| 266 | + } else { | |
| 267 | + let apiComplete = | |
| 268 | + all.secretUrls.base + all.secretUrls.callback; | |
| 269 | + let apiStringSignComplete = all.signFunction( | |
| 270 | + apiComplete, | |
| 271 | + that.getParamsList({ | |
| 272 | + ...fileBaseObj, | |
| 273 | + ...fileSaveObj, | |
| 274 | + ...{ timestamp: that.getTimeStamp() }, | |
| 275 | + }) | |
| 276 | + ); | |
| 277 | + return all.request({ | |
| 278 | + url: apiComplete, | |
| 279 | + method: "get", | |
| 280 | + params: all.parseQueryString(apiStringSignComplete), | |
| 281 | + }); | |
| 282 | + } | |
| 283 | + }) | |
| 284 | + .then((data) => { | |
| 285 | + if ( | |
| 286 | + data && | |
| 287 | + data.data && | |
| 288 | + data.data.data && | |
| 289 | + data.data.data.obj | |
| 290 | + ) { | |
| 291 | + that.form.audioId = data.data.data.obj; | |
| 292 | + that.percent = 100; | |
| 293 | + that.postCms(); | |
| 294 | + } else { | |
| 295 | + that.errorMsg = "系统错误,请联系管理员"; | |
| 296 | + // that.reset() | |
| 297 | + this.submitDisabled = false; | |
| 298 | + this.btnDisabled = false; | |
| 299 | + } | |
| 300 | + }) | |
| 301 | + .catch((error) => { | |
| 302 | + that.errorMsg = error ? error : "系统错误,请联系管理员"; | |
| 303 | + // that.reset(); | |
| 304 | + this.submitDisabled = false; | |
| 305 | + this.btnDisabled = false; | |
| 306 | + }); | |
| 307 | + }, | |
| 308 | + }; | |
| 309 | + | |
| 310 | + Promise.all([ | |
| 311 | + all.validateVideoSize(fileInitObj.fileSize), | |
| 312 | + all.validateVideoFormat(fileInitObj.gfmt), | |
| 313 | + all.validateNameLength(fileBaseObj.videoName), | |
| 314 | + ]) | |
| 315 | + .then((check) => { | |
| 316 | + return this.getToken(); | |
| 317 | + }) | |
| 318 | + .then((d) => { | |
| 319 | + if (d && d.data && typeof d.data == "string") { | |
| 320 | + this.token = d.data; | |
| 321 | + } | |
| 322 | + return this.initMd5(this.form.audioFile.raw); | |
| 323 | + }) | |
| 324 | + .then((n) => { | |
| 325 | + if (!this.token) { | |
| 326 | + // this.$message({ | |
| 327 | + // type: "error", | |
| 328 | + // message: "鉴权失败", | |
| 329 | + // duration: 5000, | |
| 330 | + // }); | |
| 331 | + this.errorMsg = "鉴权失败"; | |
| 332 | + // this.reset(); | |
| 333 | + this.submitDisabled = false; | |
| 334 | + this.btnDisabled = false; | |
| 335 | + return false; | |
| 336 | + } | |
| 337 | + fileBaseObj.md5 = n; | |
| 338 | + let apiInit = all.secretUrls.base + all.secretUrls.init; | |
| 339 | + let apiStringSignInit = all.signFunction( | |
| 340 | + apiInit, | |
| 341 | + this.getParamsList({ ...fileBaseObj, ...fileInitObj }) | |
| 342 | + ); | |
| 343 | + return all.request({ | |
| 344 | + url: all.secretUrls.base + all.secretUrls.init, | |
| 345 | + method: "get", | |
| 346 | + params: all.parseQueryString(apiStringSignInit), | |
| 347 | + }); | |
| 348 | + }) | |
| 349 | + .then((res) => { | |
| 350 | + if ( | |
| 351 | + res && | |
| 352 | + res.data && | |
| 353 | + res.data.data && | |
| 354 | + res.data.data.code == 0 | |
| 355 | + ) { | |
| 356 | + fileSaveObj.videoId = res.data.data.obj.vid; | |
| 357 | + fileWholeObj.fileKey = res.data.data.obj.originPath; | |
| 358 | + all.putExtra.params["x:name"] = fileWholeObj.fileKey; | |
| 359 | + fileWholeObj.observable = qiniu.upload( | |
| 360 | + this.form.audioFile.raw, | |
| 361 | + fileWholeObj.fileKey, | |
| 362 | + this.token, | |
| 363 | + all.putExtra, | |
| 364 | + all.cdnConfig | |
| 365 | + ); | |
| 366 | + fileWholeObj.subscription = | |
| 367 | + fileWholeObj.observable.subscribe(observer); | |
| 368 | + } else { | |
| 369 | + if ( | |
| 370 | + res && | |
| 371 | + res.data && | |
| 372 | + res.data.errorCode && | |
| 373 | + res.data.errorCode != 0 | |
| 374 | + ) { | |
| 375 | + this.errorMsg = "系统错误,请联系管理员"; | |
| 376 | + // this.reset(); | |
| 377 | + this.submitDisabled = false; | |
| 378 | + this.btnDisabled = false; | |
| 379 | + } | |
| 380 | + } | |
| 381 | + }) | |
| 382 | + .catch((error) => { | |
| 383 | + this.errorMsg = error ? error : "系统错误,请联系管理员"; | |
| 384 | + // this.reset() | |
| 385 | + this.submitDisabled = false; | |
| 386 | + this.btnDisabled = false; | |
| 387 | + }); | |
| 388 | + } | |
| 389 | + } else { | |
| 390 | + // this.$message.error("请检查表单内容"); | |
| 391 | + this.errorMsg = '请检查表单内容' | |
| 392 | + this.submitDisabled = false; | |
| 393 | + this.btnDisabled = false; | |
| 394 | + return false; | |
| 395 | + } | |
| 396 | + }); | |
| 397 | + }, | |
| 398 | + // 对象参数转数组格式 | |
| 399 | + getParamsList(params) { | |
| 400 | + let list = []; | |
| 401 | + for (let i in params) { | |
| 402 | + if (i == "hash" || i == "key" || i == "x:name") { | |
| 403 | + list.push(`${i}=${encodeURI(params[i])}`); | |
| 404 | + } else { | |
| 405 | + list.push(`${i}=${params[i]}`); | |
| 406 | + } | |
| 407 | + } | |
| 408 | + return list; | |
| 409 | + }, | |
| 410 | + // 获取时间戳 | |
| 411 | + getTimeStamp() { | |
| 412 | + return Math.round(new Date().getTime() / 1000); | |
| 413 | + }, | |
| 414 | + // 获取时间戳加四位随机数 | |
| 415 | + getTs() { | |
| 416 | + return ( | |
| 417 | + this.getTimeStamp().toString() + | |
| 418 | + Math.floor(Math.random() * 10000).toString() | |
| 419 | + ); | |
| 420 | + }, | |
| 421 | + // 通过作品类型id获取作品分类,用于上传视频的??参数 | |
| 422 | + getCategoryText(id) { | |
| 423 | + if (id == 1278) { | |
| 424 | + return "533"; | |
| 425 | + } | |
| 426 | + if (id == 1280) { | |
| 427 | + return "534"; | |
| 428 | + } | |
| 429 | + if (id == 1281) { | |
| 430 | + return "532"; | |
| 431 | + } | |
| 432 | + }, | |
| 433 | + // 通过作品类型id获取作品类型,用于上传视频的tag | |
| 434 | + getChannelText(id) { | |
| 435 | + if (id == 1278) { | |
| 436 | + return "热歌榜"; | |
| 437 | + } | |
| 438 | + if (id == 1279) { | |
| 439 | + return "优秀作词榜"; | |
| 440 | + } | |
| 441 | + if (id == 1280) { | |
| 442 | + return "优秀作曲榜"; | |
| 443 | + } | |
| 444 | + if (id == 1281) { | |
| 445 | + return "其他"; | |
| 446 | + } | |
| 447 | + }, | |
| 448 | + // 获取认证token | |
| 449 | + getToken() { | |
| 450 | + let api = all.secretUrls.base + all.secretUrls.auth; | |
| 451 | + let apiStringSign = all.signFunction(api, [ | |
| 452 | + "ts=" + this.getTs(), | |
| 453 | + "timestamp=" + this.getTimeStamp(), | |
| 454 | + ]); | |
| 455 | + return all.request({ | |
| 456 | + url: all.secretUrls.base + all.secretUrls.auth, | |
| 457 | + method: "get", | |
| 458 | + params: all.parseQueryString(apiStringSign), | |
| 459 | + }); | |
| 460 | + }, | |
| 461 | + // cms接口提交videoId和表单内容 | |
| 462 | + postCms() { | |
| 463 | + this.form.lyric = this.addBr(this.form.lyric) | |
| 464 | + all | |
| 465 | + .request({ | |
| 466 | + // url: "http://cmstest.cnlive.com:8768/contentApi/audioSave", | |
| 467 | + url: "https://cms.cnlive.com/api/contentApi/audioSave", | |
| 468 | + method: "post", | |
| 469 | + params: this.form, | |
| 470 | + withCredentials: true, | |
| 471 | + headers: { | |
| 472 | + "X-Requested-With": "XMLHttpRequest", | |
| 473 | + "Access-Control-Allow-Origin": "*", | |
| 474 | + "content-type": "application/json;charset=UTF-8", | |
| 475 | + }, | |
| 476 | + }) | |
| 477 | + .then((res) => { | |
| 478 | + if (res.data) { | |
| 479 | + setTimeout(() => { | |
| 480 | + // console.log("jump success"); | |
| 481 | + window.location.replace("./success.html"); | |
| 482 | + }, 1000); | |
| 483 | + } else { | |
| 484 | + setTimeout(() => { | |
| 485 | + // console.log("jump"); | |
| 486 | + window.location.replace("./failed.html"); | |
| 487 | + }, 1000); | |
| 488 | + } | |
| 489 | + }) | |
| 490 | + .catch((error) => { | |
| 491 | + console.log(error); | |
| 492 | + setTimeout(() => { | |
| 493 | + // console.log("jump"); | |
| 494 | + window.location.replace("./failed.html"); | |
| 495 | + }, 1000); | |
| 496 | + }) | |
| 497 | + .finally(() => { | |
| 498 | + this.btnDisabled = false; | |
| 499 | + this.submitDisabled = false; | |
| 500 | + }); | |
| 501 | + }, | |
| 502 | + // 获取txt文件内容,暂未启用 | |
| 503 | + getTxt(e) { | |
| 504 | + this.form.txtFile = e.raw; | |
| 505 | + let file = e.raw; | |
| 506 | + (reader = new FileReader()), (that = this); | |
| 507 | + reader.onload = function (evt) { | |
| 508 | + var data = evt.target.result; | |
| 509 | + console.log(data); | |
| 510 | + console.log(String.fromCharCode.apply(null, new Uint16Array(data))); | |
| 511 | + }; | |
| 512 | + reader.readAsArrayBuffer(file); | |
| 513 | + }, | |
| 514 | + // 选择上传文件 | |
| 515 | + getMp3(file) { | |
| 516 | + console.log(file) | |
| 517 | + this.form.audioFile = file; | |
| 518 | + this.errorMsg = ""; | |
| 519 | + }, | |
| 520 | + // textarea换行转br | |
| 521 | + addBr(str) { | |
| 522 | + var reg = new RegExp("\r\n","g"); | |
| 523 | + var regr = new RegExp("\r","g"); | |
| 524 | + var regn = new RegExp("\n","g"); | |
| 525 | + if(str) { | |
| 526 | + str = str.trim() | |
| 527 | + str = str.replace(regr,"<br/>") | |
| 528 | + str = str.replace(regn,"<br/>") | |
| 529 | + str = str.replace(reg,"<br/>") | |
| 530 | + } else { | |
| 531 | + str = '' | |
| 532 | + } | |
| 533 | + return str | |
| 534 | + } | |
| 535 | + }, | |
| 536 | +} | |
| 537 | +var Ctor = Vue.extend(Main) | |
| 538 | +new Ctor().$mount('#mainPage') | |
| 0 | 539 | \ No newline at end of file | ... | ... |
src/js/audios.js
vue.config.js
0 → 100644
webpack.config.js
| ... | ... | @@ -8,10 +8,11 @@ module.exports = { |
| 8 | 8 | //模式:开发环境 |
| 9 | 9 | mode: "development", //production 不写的话默认为生产模式 |
| 10 | 10 | //入口文件 程序从这里开始执行,webpack开始打包 |
| 11 | - entry: path.join(__dirname, "src", "/js/audios.js"), //__dirname指的是当前目录,是目录形成绝对路径 | |
| 11 | + // vue3版本用audios.js,vue2版本用audio.js | |
| 12 | + entry: path.join(__dirname, "src", "/js/audio.js"), //__dirname指的是当前目录,是目录形成绝对路径 | |
| 12 | 13 | output: { |
| 13 | 14 | //输入的文件名 |
| 14 | - filename: "br.js", | |
| 15 | + filename: "version2.js", | |
| 15 | 16 | // filename: '[name].[hash:7].js', |
| 16 | 17 | publicPath: "/", |
| 17 | 18 | //输入的路径 webpack会自动打包生成 |
| ... | ... | @@ -23,9 +24,10 @@ module.exports = { |
| 23 | 24 | plugins: [ |
| 24 | 25 | new HtmlWebpackPlugin({ |
| 25 | 26 | //文件中找到的路径 |
| 26 | - template: path.join(__dirname, "src", "html/index.html"), | |
| 27 | + // vue3版本用index.html,vue2版本用v2.html | |
| 28 | + template: path.join(__dirname, "src", "html/v2.html"), | |
| 27 | 29 | //打包输出的路径 |
| 28 | - filename: "br.html", | |
| 30 | + filename: "version2.html", | |
| 29 | 31 | }), |
| 30 | 32 | new CleanWebpackPlugin(), |
| 31 | 33 | new JavaScriptObfuscator( | ... | ... |