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,6 +19,7 @@ | ||
| 19 | height: 340px; | 19 | height: 340px; |
| 20 | background-color: white; | 20 | background-color: white; |
| 21 | border-radius: 12px; | 21 | border-radius: 12px; |
| 22 | + max-height: 340px; | ||
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | .status-icon { | 25 | .status-icon { |
| @@ -50,7 +51,7 @@ | @@ -50,7 +51,7 @@ | ||
| 50 | color: #ffffff; | 51 | color: #ffffff; |
| 51 | font-size: 16px; | 52 | font-size: 16px; |
| 52 | background: #F5A623; | 53 | background: #F5A623; |
| 53 | - border-radius: 6px;">我知道了</div> | 54 | + border-radius: 6px;" @click="closeMask">我知道了</div> |
| 54 | </div> | 55 | </div> |
| 55 | </div> | 56 | </div> |
| 56 | </div> | 57 | </div> |
| @@ -63,6 +64,16 @@ | @@ -63,6 +64,16 @@ | ||
| 63 | failedIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289409448.png', | 64 | failedIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289409448.png', |
| 64 | successIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289443434.png' | 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 | Vue.createApp(Success).use(ElementPlus).mount("#success"); | 79 | Vue.createApp(Success).use(ElementPlus).mount("#success"); |
src/html/index.html
| @@ -70,9 +70,9 @@ | @@ -70,9 +70,9 @@ | ||
| 70 | </el-form-item> | 70 | </el-form-item> |
| 71 | <el-divider></el-divider> | 71 | <el-divider></el-divider> |
| 72 | <el-form-item class="diy-flex-50 diy-text-left"> | 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 | </el-form-item> | 76 | </el-form-item> |
| 77 | <el-form-item class="diy-flex-50 diy-text-right"> | 77 | <el-form-item class="diy-flex-50 diy-text-right"> |
| 78 | <el-button @click="reset" class="diy-button width-140 bg-white" v-if="form.channelId == 1279">取消</el-button> | 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,7 +19,9 @@ | ||
| 19 | height: 340px; | 19 | height: 340px; |
| 20 | background-color: white; | 20 | background-color: white; |
| 21 | border-radius: 12px; | 21 | border-radius: 12px; |
| 22 | + max-height: 340px; | ||
| 22 | } | 23 | } |
| 24 | + | ||
| 23 | .status-icon { | 25 | .status-icon { |
| 24 | margin: 0 auto; | 26 | margin: 0 auto; |
| 25 | width: 126px; | 27 | width: 126px; |
| @@ -31,7 +33,9 @@ | @@ -31,7 +33,9 @@ | ||
| 31 | <body id="body"> | 33 | <body id="body"> |
| 32 | <div id="success" class="page-container"> | 34 | <div id="success" class="page-container"> |
| 33 | <div class="status-container"> | 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 | </div> | 40 | </div> |
| 37 | <div style="text-align: center; margin-top: 10px;"> | 41 | <div style="text-align: center; margin-top: 10px;"> |
| @@ -52,7 +56,7 @@ | @@ -52,7 +56,7 @@ | ||
| 52 | color: #ffffff; | 56 | color: #ffffff; |
| 53 | font-size: 16px; | 57 | font-size: 16px; |
| 54 | background: #F5A623; | 58 | background: #F5A623; |
| 55 | - border-radius: 6px;">我知道了</div> | 59 | + border-radius: 6px;" @click="closeMask">我知道了</div> |
| 56 | </div> | 60 | </div> |
| 57 | </div> | 61 | </div> |
| 58 | </div> | 62 | </div> |
| @@ -63,7 +67,17 @@ | @@ -63,7 +67,17 @@ | ||
| 63 | data() { | 67 | data() { |
| 64 | return { | 68 | return { |
| 65 | failedIcon: 'https://wjjtest.ys2.cnliveimg.com/802/img_new/1632289409448.png', | 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,4 +85,4 @@ | ||
| 71 | </script> | 85 | </script> |
| 72 | </body> | 86 | </body> |
| 73 | 87 | ||
| 74 | -</html> | 88 | -</html> |
| 89 | +</html> | ||
| 75 | \ No newline at end of file | 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 | \ No newline at end of file | 63 | \ No newline at end of file |
src/js/audios.js
| @@ -2,6 +2,9 @@ import * as all from "./config"; | @@ -2,6 +2,9 @@ import * as all from "./config"; | ||
| 2 | require("./../css/test.css"); | 2 | require("./../css/test.css"); |
| 3 | // Init Vue | 3 | // Init Vue |
| 4 | const Audio = { | 4 | const Audio = { |
| 5 | + created() { | ||
| 6 | + parent.postMessage(1000, '*') | ||
| 7 | + }, | ||
| 5 | data() { | 8 | data() { |
| 6 | return { | 9 | return { |
| 7 | form: { | 10 | form: { |
webpack.config.js
| @@ -11,7 +11,7 @@ module.exports = { | @@ -11,7 +11,7 @@ module.exports = { | ||
| 11 | entry: path.join(__dirname, "src", "/js/audios.js"), //__dirname指的是当前目录,是目录形成绝对路径 | 11 | entry: path.join(__dirname, "src", "/js/audios.js"), //__dirname指的是当前目录,是目录形成绝对路径 |
| 12 | output: { | 12 | output: { |
| 13 | //输入的文件名 | 13 | //输入的文件名 |
| 14 | - filename: "tengxi.js", | 14 | + filename: "bgdh.js", |
| 15 | // filename: '[name].[hash:7].js', | 15 | // filename: '[name].[hash:7].js', |
| 16 | publicPath: "/", | 16 | publicPath: "/", |
| 17 | //输入的路径 webpack会自动打包生成 | 17 | //输入的路径 webpack会自动打包生成 |
| @@ -25,7 +25,7 @@ module.exports = { | @@ -25,7 +25,7 @@ module.exports = { | ||
| 25 | //文件中找到的路径 | 25 | //文件中找到的路径 |
| 26 | template: path.join(__dirname, "src", "html/index.html"), | 26 | template: path.join(__dirname, "src", "html/index.html"), |
| 27 | //打包输出的路径 | 27 | //打包输出的路径 |
| 28 | - filename: "tengxi.html", | 28 | + filename: "bgdh.html", |
| 29 | }), | 29 | }), |
| 30 | new CleanWebpackPlugin(), | 30 | new CleanWebpackPlugin(), |
| 31 | new JavaScriptObfuscator( | 31 | new JavaScriptObfuscator( |
| @@ -33,22 +33,17 @@ module.exports = { | @@ -33,22 +33,17 @@ module.exports = { | ||
| 33 | compact: true, //压缩代码 | 33 | compact: true, //压缩代码 |
| 34 | controlFlowFlattening: true, //是否启用控制流扁平化(降低1.5倍的运行速度) | 34 | controlFlowFlattening: true, //是否启用控制流扁平化(降低1.5倍的运行速度) |
| 35 | controlFlowFlatteningThreshold: 1, //应用概率;在较大的代码库中,建议降低此值,因为大量的控制流转换可能会增加代码的大小并降低代码的速度。 | 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 | ), |