Commit 29a934b869d6bb864b610356e3071636d7fd26d8
1 parent
c865f975
debug
Showing
6 changed files
with
111 additions
and
25 deletions
src/html/failed.html
| ... | ... | @@ -19,6 +19,7 @@ |
| 19 | 19 | height: 340px; |
| 20 | 20 | background-color: white; |
| 21 | 21 | border-radius: 12px; |
| 22 | + max-height: 340px; | |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | .status-icon { |
| ... | ... | @@ -50,7 +51,7 @@ |
| 50 | 51 | color: #ffffff; |
| 51 | 52 | font-size: 16px; |
| 52 | 53 | background: #F5A623; |
| 53 | - border-radius: 6px;">我知道了</div> | |
| 54 | + border-radius: 6px;" @click="closeMask">我知道了</div> | |
| 54 | 55 | </div> |
| 55 | 56 | </div> |
| 56 | 57 | </div> |
| ... | ... | @@ -63,6 +64,16 @@ |
| 63 | 64 | failedIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289409448.png', |
| 64 | 65 | successIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289443434.png' |
| 65 | 66 | } |
| 67 | + }, | |
| 68 | + mounted() { | |
| 69 | + // 装有iframe的页面监听到内容为【数字】时要给iframe组件重写高度。 | |
| 70 | + parent.postMessage(340, '*') | |
| 71 | + }, | |
| 72 | + methods: { | |
| 73 | + closeMask() { | |
| 74 | + // 装有iframe的页面监听到内容为【true】时要执行关闭弹窗操作。 | |
| 75 | + parent.postMessage(true, '*') | |
| 76 | + } | |
| 66 | 77 | } |
| 67 | 78 | } |
| 68 | 79 | Vue.createApp(Success).use(ElementPlus).mount("#success"); | ... | ... |
src/html/index.html
| ... | ... | @@ -70,9 +70,9 @@ |
| 70 | 70 | </el-form-item> |
| 71 | 71 | <el-divider></el-divider> |
| 72 | 72 | <el-form-item class="diy-flex-50 diy-text-left"> |
| 73 | - <span class="diy-tip">{{form.audioFile?.name}} </span> | |
| 74 | - <span class="diy-tip" v-if="percent > 0 && percent < 100"> 已上传{{Math.ceil(percent)}}%,请耐心等待……</span> | |
| 75 | - <span class="diy-tip" v-if="percent == 100"> 上传完成</span> | |
| 73 | + <div class="diy-tip">{{form.audioFile?.name}} </div> | |
| 74 | + <div class="diy-tip" v-if="percent > 0 && percent < 100"> 已上传{{Math.ceil(percent)}}%,请耐心等待……</div> | |
| 75 | + <div class="diy-tip" v-if="percent == 100"> 上传完成</div> | |
| 76 | 76 | </el-form-item> |
| 77 | 77 | <el-form-item class="diy-flex-50 diy-text-right"> |
| 78 | 78 | <el-button @click="reset" class="diy-button width-140 bg-white" v-if="form.channelId == 1279">取消</el-button> | ... | ... |
src/html/success.html
| ... | ... | @@ -19,7 +19,9 @@ |
| 19 | 19 | height: 340px; |
| 20 | 20 | background-color: white; |
| 21 | 21 | border-radius: 12px; |
| 22 | + max-height: 340px; | |
| 22 | 23 | } |
| 24 | + | |
| 23 | 25 | .status-icon { |
| 24 | 26 | margin: 0 auto; |
| 25 | 27 | width: 126px; |
| ... | ... | @@ -31,7 +33,9 @@ |
| 31 | 33 | <body id="body"> |
| 32 | 34 | <div id="success" class="page-container"> |
| 33 | 35 | <div class="status-container"> |
| 34 | - <div class="status-icon" style="background-position: center; background-repeat: no-repeat; background-size: contain;" :style="{backgroundImage:'url(' + successIcon + ')'}"> | |
| 36 | + <div class="status-icon" | |
| 37 | + style="background-position: center; background-repeat: no-repeat; background-size: contain;" | |
| 38 | + :style="{backgroundImage:'url(' + successIcon + ')'}"> | |
| 35 | 39 | |
| 36 | 40 | </div> |
| 37 | 41 | <div style="text-align: center; margin-top: 10px;"> |
| ... | ... | @@ -52,7 +56,7 @@ |
| 52 | 56 | color: #ffffff; |
| 53 | 57 | font-size: 16px; |
| 54 | 58 | background: #F5A623; |
| 55 | - border-radius: 6px;">我知道了</div> | |
| 59 | + border-radius: 6px;" @click="closeMask">我知道了</div> | |
| 56 | 60 | </div> |
| 57 | 61 | </div> |
| 58 | 62 | </div> |
| ... | ... | @@ -63,7 +67,17 @@ |
| 63 | 67 | data() { |
| 64 | 68 | return { |
| 65 | 69 | failedIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289409448.png', |
| 66 | - successIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289443434.png' | |
| 70 | + successIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289443434.png', | |
| 71 | + } | |
| 72 | + }, | |
| 73 | + mounted() { | |
| 74 | + // 装有iframe的页面监听到内容为【数字】时要给iframe组件重写高度。 | |
| 75 | + parent.postMessage(340, '*') | |
| 76 | + }, | |
| 77 | + methods: { | |
| 78 | + closeMask() { | |
| 79 | + // 装有iframe的页面监听到内容为【true】时要执行关闭弹窗操作。 | |
| 80 | + parent.postMessage(true, '*') | |
| 67 | 81 | } |
| 68 | 82 | } |
| 69 | 83 | } |
| ... | ... | @@ -71,4 +85,4 @@ |
| 71 | 85 | </script> |
| 72 | 86 | </body> |
| 73 | 87 | |
| 74 | 88 | -</html> |
| 89 | +</html> | |
| 75 | 90 | \ No newline at end of file | ... | ... |
src/html/test.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 | + <link rel="shortcut icon" href="/cms.ico" /> | |
| 12 | + <link rel="bookmark" href="/cms.ico" /> | |
| 13 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-plus@1.1.0-beta.12/theme-chalk/index.css"> | |
| 14 | + <style> | |
| 15 | + .status-container { | |
| 16 | + margin: 0 auto; | |
| 17 | + padding-top: 40px; | |
| 18 | + width: 420px; | |
| 19 | + height: 340px; | |
| 20 | + background-color: white; | |
| 21 | + border-radius: 12px; | |
| 22 | + max-height: 340px; | |
| 23 | + } | |
| 24 | + | |
| 25 | + .status-icon { | |
| 26 | + margin: 0 auto; | |
| 27 | + width: 126px; | |
| 28 | + height: 120px; | |
| 29 | + } | |
| 30 | + </style> | |
| 31 | +</head> | |
| 32 | + | |
| 33 | +<body id="body"> | |
| 34 | + <div id="success" class="page-container"> | |
| 35 | + <iframe src="file:///E:/codes/projects/cms_songs/src/html/success.html" id="tengxi" frameborder="1/0" height="1000" name="征集" scrolling="no" width="900"></iframe> | |
| 36 | + </div> | |
| 37 | + <script src="https://cdn.jsdelivr.net/npm/vue@3.2.11/dist/vue.global.js"></script> | |
| 38 | + <script src="https://cdn.jsdelivr.net/npm/element-plus"></script> | |
| 39 | + <script> | |
| 40 | + const Success = { | |
| 41 | + data() { | |
| 42 | + return { | |
| 43 | + failedIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289409448.png', | |
| 44 | + successIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289443434.png', | |
| 45 | + } | |
| 46 | + }, | |
| 47 | + mounted() { | |
| 48 | + console.log('parent mounted') | |
| 49 | + window.addEventListener('message', function (e) { | |
| 50 | + console.log(e.data) | |
| 51 | + document.getElementById('tengxi').height = e.data | |
| 52 | + }, false) | |
| 53 | + }, | |
| 54 | + methods: { | |
| 55 | + | |
| 56 | + } | |
| 57 | + } | |
| 58 | + Vue.createApp(Success).use(ElementPlus).mount("#success"); | |
| 59 | + </script> | |
| 60 | +</body> | |
| 61 | + | |
| 62 | +</html> | |
| 0 | 63 | \ No newline at end of file | ... | ... |
src/js/audios.js
webpack.config.js
| ... | ... | @@ -11,7 +11,7 @@ module.exports = { |
| 11 | 11 | entry: path.join(__dirname, "src", "/js/audios.js"), //__dirname指的是当前目录,是目录形成绝对路径 |
| 12 | 12 | output: { |
| 13 | 13 | //输入的文件名 |
| 14 | - filename: "tengxi.js", | |
| 14 | + filename: "bgdh.js", | |
| 15 | 15 | // filename: '[name].[hash:7].js', |
| 16 | 16 | publicPath: "/", |
| 17 | 17 | //输入的路径 webpack会自动打包生成 |
| ... | ... | @@ -25,7 +25,7 @@ module.exports = { |
| 25 | 25 | //文件中找到的路径 |
| 26 | 26 | template: path.join(__dirname, "src", "html/index.html"), |
| 27 | 27 | //打包输出的路径 |
| 28 | - filename: "tengxi.html", | |
| 28 | + filename: "bgdh.html", | |
| 29 | 29 | }), |
| 30 | 30 | new CleanWebpackPlugin(), |
| 31 | 31 | new JavaScriptObfuscator( |
| ... | ... | @@ -33,22 +33,17 @@ module.exports = { |
| 33 | 33 | compact: true, //压缩代码 |
| 34 | 34 | controlFlowFlattening: true, //是否启用控制流扁平化(降低1.5倍的运行速度) |
| 35 | 35 | controlFlowFlatteningThreshold: 1, //应用概率;在较大的代码库中,建议降低此值,因为大量的控制流转换可能会增加代码的大小并降低代码的速度。 |
| 36 | - deadCodeInjection: true, //随机的死代码块(增加了混淆代码的大小) | |
| 37 | - // deadCodeInjectionThreshold: 1, //死代码块的影响概率 | |
| 38 | - debugProtection: true, //此选项几乎不可能使用开发者工具的控制台选项卡 | |
| 39 | - debugProtectionInterval: true, //如果选中,则会在“控制台”选项卡上使用间隔强制调试模式,从而更难使用“开发人员工具”的其他功能。 | |
| 40 | - disableConsoleOutput: true, //通过用空函数替换它们来禁用console.log,console.info,console.error和console.warn。这使得调试器的使用更加困难。 | |
| 41 | - // identifierNamesGenerator: "hexadecimal", //标识符的混淆方式 hexadecimal(十六进制) mangled(短标识符) | |
| 42 | - // log: false, | |
| 43 | - renameGlobals: true, //是否启用全局变量和函数名称的混淆 | |
| 44 | - rotateStringArray: true, //通过固定和随机(在代码混淆时生成)的位置移动数组。这使得将删除的字符串的顺序与其原始位置相匹配变得更加困难。如果原始源代码不小,建议使用此选项,因为辅助函数可以引起注意。 | |
| 45 | - selfDefending: true, //混淆后的代码,不能使用代码美化,同时需要配置 cpmpat:true; | |
| 46 | - cpmpat:true, | |
| 47 | - stringArray: true, //删除字符串文字并将它们放在一个特殊的数组中 | |
| 48 | - // // stringArrayEncoding: "rc4", | |
| 49 | - // stringArrayThreshold: 1, | |
| 50 | - transformObjectKeys: true, | |
| 51 | - unicodeEscapeSequence: false, | |
| 36 | + // deadCodeInjection: true, //随机的死代码块(增加了混淆代码的大小) | |
| 37 | + // debugProtection: true, //此选项几乎不可能使用开发者工具的控制台选项卡 | |
| 38 | + // debugProtectionInterval: true, //如果选中,则会在“控制台”选项卡上使用间隔强制调试模式,从而更难使用“开发人员工具”的其他功能。 | |
| 39 | + // disableConsoleOutput: true, //通过用空函数替换它们来禁用console.log,console.info,console.error和console.warn。这使得调试器的使用更加困难。 | |
| 40 | + // renameGlobals: true, //是否启用全局变量和函数名称的混淆 | |
| 41 | + // rotateStringArray: true, //通过固定和随机(在代码混淆时生成)的位置移动数组。这使得将删除的字符串的顺序与其原始位置相匹配变得更加困难。如果原始源代码不小,建议使用此选项,因为辅助函数可以引起注意。 | |
| 42 | + // selfDefending: true, //混淆后的代码,不能使用代码美化,同时需要配置 cpmpat:true; | |
| 43 | + // cpmpat:true, | |
| 44 | + // stringArray: true, //删除字符串文字并将它们放在一个特殊的数组中 | |
| 45 | + // transformObjectKeys: true, | |
| 46 | + // unicodeEscapeSequence: false, | |
| 52 | 47 | }, |
| 53 | 48 | [] |
| 54 | 49 | ), | ... | ... |