commit
Showing
2 changed files
with
166 additions
and
1 deletions
| ... | @@ -11,7 +11,7 @@ | ... | @@ -11,7 +11,7 @@ |
| 11 | active-text-color="#ffd04b"> | 11 | active-text-color="#ffd04b"> |
| 12 | <el-submenu index="1"> | 12 | <el-submenu index="1"> |
| 13 | <template slot="title">国寿AI健康</template> | 13 | <template slot="title">国寿AI健康</template> |
| 14 | <el-menu-item index="/tool">测试工具</el-menu-item> | 14 | <el-menu-item index="/tool">测试工具1.0</el-menu-item> |
| 15 | <el-menu-item index="/tool2">测试工具2.0</el-menu-item> | 15 | <el-menu-item index="/tool2">测试工具2.0</el-menu-item> |
| 16 | <el-menu-item index="/androidCode">线上包二维码</el-menu-item> | 16 | <el-menu-item index="/androidCode">线上包二维码</el-menu-item> |
| 17 | <el-menu-item><a class="link" href="http://192.168.8.113:8070/android/new/log.html" target="_blank">Android UI自动化</a></el-menu-item> | 17 | <el-menu-item><a class="link" href="http://192.168.8.113:8070/android/new/log.html" target="_blank">Android UI自动化</a></el-menu-item> | ... | ... |
| ... | @@ -2,6 +2,64 @@ | ... | @@ -2,6 +2,64 @@ |
| 2 | <div> | 2 | <div> |
| 3 | <el-row style="margin-bottom: 15px; margin-top: 5px"> | 3 | <el-row style="margin-bottom: 15px; margin-top: 5px"> |
| 4 | <el-col :span="8"> | 4 | <el-col :span="8"> |
| 5 | <el-form ref="smsCode" :model="smsCode" label-width="0px"> | ||
| 6 | <el-card class="darkred" shadow="always"> | ||
| 7 | <div slot="header" class="clearfix"> | ||
| 8 | <span>设置短信验证码</span> | ||
| 9 | </div> | ||
| 10 | <div class="text item"> | ||
| 11 | <el-form-item> | ||
| 12 | <el-input placeholder="请输入手机号" v-model="smsCode.phone" clearable></el-input> | ||
| 13 | </el-form-item> | ||
| 14 | <el-form-item> | ||
| 15 | <el-input placeholder="请输入验证码" v-model="smsCode.code" clearable></el-input> | ||
| 16 | </el-form-item> | ||
| 17 | <div style="margin: 15px 0;"></div> | ||
| 18 | <el-form-item> | ||
| 19 | <el-button round @click="smsCodeSubmit">设置验证码</el-button> | ||
| 20 | </el-form-item> | ||
| 21 | </div> | ||
| 22 | </el-card> | ||
| 23 | </el-form> | ||
| 24 | </el-col> | ||
| 25 | <el-col :span="8"> | ||
| 26 | <el-form ref="queryPhoneCode" :model="queryPhoneCode" label-width="0px"> | ||
| 27 | <el-card class="darkred" shadow="always"> | ||
| 28 | <div slot="header" class="clearfix"> | ||
| 29 | <span>查询短信验证码</span> | ||
| 30 | </div> | ||
| 31 | <div class="text item"> | ||
| 32 | <el-form-item> | ||
| 33 | <el-input placeholder="请输入手机号" v-model="queryPhoneCode.phone" clearable></el-input> | ||
| 34 | </el-form-item> | ||
| 35 | <el-form-item> | ||
| 36 | <el-select v-model="queryPhoneCode.huanjing" placeholder="请选择执行环境"> | ||
| 37 | <el-option | ||
| 38 | v-for="item in queryPhoneCodeOptions" | ||
| 39 | :key="item.value" | ||
| 40 | :label="item.label" | ||
| 41 | :value="item.value"> | ||
| 42 | </el-option> | ||
| 43 | </el-select> | ||
| 44 | </el-form-item> | ||
| 45 | <div style="margin: 15px 0;"></div> | ||
| 46 | <el-form-item> | ||
| 47 | <el-button round @click="queryPhoneCodeSubmit">查询验证码</el-button> | ||
| 48 | </el-form-item> | ||
| 49 | </div> | ||
| 50 | </el-card> | ||
| 51 | </el-form> | ||
| 52 | <el-dialog | ||
| 53 | title="短信验证码:" | ||
| 54 | :visible.sync="dialogQueryPhoneCode" | ||
| 55 | width="30%"> | ||
| 56 | <span>{{myQueryPhoneCode}}</span> | ||
| 57 | <span slot="footer" class="dialog-footer"> | ||
| 58 | <el-button type="primary" v-clipboard:copy="JSON.stringify(myQueryPhoneCode)" v-clipboard:success="onCopy" @click="dialogQueryPhoneCode = false">点击复制</el-button> | ||
| 59 | </span> | ||
| 60 | </el-dialog> | ||
| 61 | </el-col> | ||
| 62 | <el-col :span="8"> | ||
| 5 | <el-form ref="apiTest" :model="apiTest" label-width="0px"> | 63 | <el-form ref="apiTest" :model="apiTest" label-width="0px"> |
| 6 | <el-card class="darkred" shadow="always"> | 64 | <el-card class="darkred" shadow="always"> |
| 7 | <div slot="header" class="clearfix"> | 65 | <div slot="header" class="clearfix"> |
| ... | @@ -117,6 +175,23 @@ | ... | @@ -117,6 +175,23 @@ |
| 117 | export default { | 175 | export default { |
| 118 | data() { | 176 | data() { |
| 119 | return { | 177 | return { |
| 178 | smsCode: { | ||
| 179 | phone: '', | ||
| 180 | code: 1111 | ||
| 181 | }, | ||
| 182 | queryPhoneCode: { | ||
| 183 | phone: '', | ||
| 184 | huanjing: [] | ||
| 185 | }, | ||
| 186 | queryPhoneCodeOptions: [{ | ||
| 187 | value: '0', | ||
| 188 | label: '测试环境' | ||
| 189 | }, { | ||
| 190 | value: '1', | ||
| 191 | label: '线上环境' | ||
| 192 | }], | ||
| 193 | dialogQueryPhoneCode: false, | ||
| 194 | myQueryPhoneCode: '', | ||
| 120 | apiTest: { | 195 | apiTest: { |
| 121 | path: [], | 196 | path: [], |
| 122 | method: '', | 197 | method: '', |
| ... | @@ -165,10 +240,100 @@ | ... | @@ -165,10 +240,100 @@ |
| 165 | console.log(error); | 240 | console.log(error); |
| 166 | }) | 241 | }) |
| 167 | }, | 242 | }, |
| 243 | onCopy (e) { | ||
| 244 | this.$message({ | ||
| 245 | showClose: true, | ||
| 246 | message: '内容已复制到剪切板!', | ||
| 247 | type: 'success' | ||
| 248 | }); | ||
| 249 | }, | ||
| 168 | apiTestSubmit() { | 250 | apiTestSubmit() { |
| 169 | const {href} = this.$router.resolve({ name:'apiTest2', query: | 251 | const {href} = this.$router.resolve({ name:'apiTest2', query: |
| 170 | {method: this.apiTest.method, biz_data: this.apiTest.biz_data, phone: this.apiTest.phone, path: this.apiTest.path.toString(), type: this.apiTest.huanjing.toString()}}) | 252 | {method: this.apiTest.method, biz_data: this.apiTest.biz_data, phone: this.apiTest.phone, path: this.apiTest.path.toString(), type: this.apiTest.huanjing.toString()}}) |
| 171 | window.open(href, '_blank') | 253 | window.open(href, '_blank') |
| 254 | }, | ||
| 255 | smsCodeSubmit() { | ||
| 256 | let config = { | ||
| 257 | headers: { | ||
| 258 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 259 | } | ||
| 260 | } | ||
| 261 | this.$http.get('/tool2/smsCode?'+this.$qs.stringify({ | ||
| 262 | phone: this.smsCode.phone, | ||
| 263 | code: this.smsCode.code | ||
| 264 | }),config).then((res)=>{ | ||
| 265 | console.log(res); | ||
| 266 | if(res.data=='OK') { | ||
| 267 | this.$message({ | ||
| 268 | showClose: true, | ||
| 269 | message: '设置短信验证码成功', | ||
| 270 | type: 'success' | ||
| 271 | }); | ||
| 272 | } else if(res.data=='phoneError') { | ||
| 273 | this.$message({ | ||
| 274 | showClose: true, | ||
| 275 | message: '手机号格式错误,必须是11位', | ||
| 276 | type: 'error' | ||
| 277 | }); | ||
| 278 | } else { | ||
| 279 | this.$message({ | ||
| 280 | showClose: true, | ||
| 281 | message: '设置短信验证码失败', | ||
| 282 | type: 'error' | ||
| 283 | }); | ||
| 284 | } | ||
| 285 | }).catch(error=>{ | ||
| 286 | console.log(error); | ||
| 287 | this.$message({ | ||
| 288 | showClose: true, | ||
| 289 | message: '服务器处理失败,请核对参数!', | ||
| 290 | type: 'error' | ||
| 291 | }); | ||
| 292 | }) | ||
| 293 | }, | ||
| 294 | queryPhoneCodeSubmit() { | ||
| 295 | const loading = this.$loading({ | ||
| 296 | lock: true, | ||
| 297 | text: '加载中...', | ||
| 298 | spinner: 'el-icon-loading', | ||
| 299 | background: 'rgba(0, 0, 0, 0.7)' | ||
| 300 | }); | ||
| 301 | let config = { | ||
| 302 | headers: { | ||
| 303 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 304 | } | ||
| 305 | } | ||
| 306 | this.$http.get('/tool2/queryPhoneCode?'+this.$qs.stringify({ | ||
| 307 | phone: this.queryPhoneCode.phone, | ||
| 308 | type: this.queryPhoneCode.huanjing.toString() | ||
| 309 | }),config).then((res)=>{ | ||
| 310 | console.log(res); | ||
| 311 | if(res.data=='codenull') { | ||
| 312 | this.$message({ | ||
| 313 | showClose: true, | ||
| 314 | message: '该手机号验证码为空', | ||
| 315 | type: 'error' | ||
| 316 | }); | ||
| 317 | } else if(res.data=='typeError') { | ||
| 318 | this.$message({ | ||
| 319 | showClose: true, | ||
| 320 | message: '执行环境参数错误', | ||
| 321 | type: 'error' | ||
| 322 | }); | ||
| 323 | } else { | ||
| 324 | this.myQueryPhoneCode = res.data | ||
| 325 | this.dialogQueryPhoneCode = true | ||
| 326 | } | ||
| 327 | loading.close(); | ||
| 328 | }).catch(error=>{ | ||
| 329 | console.log(error); | ||
| 330 | loading.close(); | ||
| 331 | this.$message({ | ||
| 332 | showClose: true, | ||
| 333 | message: '服务器处理失败,请核对参数!', | ||
| 334 | type: 'error' | ||
| 335 | }); | ||
| 336 | }) | ||
| 172 | } | 337 | } |
| 173 | } | 338 | } |
| 174 | } | 339 | } | ... | ... |
-
Please register or sign in to post a comment