commit
Showing
1 changed file
with
102 additions
and
1 deletions
| ... | @@ -23,6 +23,43 @@ | ... | @@ -23,6 +23,43 @@ |
| 23 | </el-form> | 23 | </el-form> |
| 24 | </el-col> | 24 | </el-col> |
| 25 | <el-col :span="8"> | 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"> | ||
| 26 | <el-form ref="nlpTestCase" :model="nlpTestCase" label-width="0px"> | 63 | <el-form ref="nlpTestCase" :model="nlpTestCase" label-width="0px"> |
| 27 | <el-card class="darkred" shadow="always"> | 64 | <el-card class="darkred" shadow="always"> |
| 28 | <div slot="header" class="clearfix"> | 65 | <div slot="header" class="clearfix"> |
| ... | @@ -111,7 +148,20 @@ | ... | @@ -111,7 +148,20 @@ |
| 111 | smsCode: { | 148 | smsCode: { |
| 112 | phone: '', | 149 | phone: '', |
| 113 | code: 1111 | 150 | code: 1111 |
| 114 | } | 151 | }, |
| 152 | queryPhoneCode: { | ||
| 153 | phone: '', | ||
| 154 | huanjing: [] | ||
| 155 | }, | ||
| 156 | queryPhoneCodeOptions: [{ | ||
| 157 | value: '0', | ||
| 158 | label: '测试环境' | ||
| 159 | }, { | ||
| 160 | value: '1', | ||
| 161 | label: '线上环境' | ||
| 162 | }], | ||
| 163 | dialogQueryPhoneCode: false, | ||
| 164 | myQueryPhoneCode: '' | ||
| 115 | } | 165 | } |
| 116 | }, | 166 | }, |
| 117 | mounted() { | 167 | mounted() { |
| ... | @@ -173,6 +223,57 @@ | ... | @@ -173,6 +223,57 @@ |
| 173 | type: 'error' | 223 | type: 'error' |
| 174 | }); | 224 | }); |
| 175 | }) | 225 | }) |
| 226 | }, | ||
| 227 | queryPhoneCodeSubmit() { | ||
| 228 | const loading = this.$loading({ | ||
| 229 | lock: true, | ||
| 230 | text: '加载中...', | ||
| 231 | spinner: 'el-icon-loading', | ||
| 232 | background: 'rgba(0, 0, 0, 0.7)' | ||
| 233 | }); | ||
| 234 | let config = { | ||
| 235 | headers: { | ||
| 236 | 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 237 | } | ||
| 238 | } | ||
| 239 | this.$http.get('/aimeTool/queryPhoneCode?'+this.$qs.stringify({ | ||
| 240 | phone: this.queryPhoneCode.phone, | ||
| 241 | type: this.queryPhoneCode.huanjing.toString() | ||
| 242 | }),config).then((res)=>{ | ||
| 243 | console.log(res); | ||
| 244 | if(res.data=='codenull') { | ||
| 245 | this.$message({ | ||
| 246 | showClose: true, | ||
| 247 | message: '该手机号验证码为空', | ||
| 248 | type: 'error' | ||
| 249 | }); | ||
| 250 | } else if(res.data=='typeError') { | ||
| 251 | this.$message({ | ||
| 252 | showClose: true, | ||
| 253 | message: '执行环境参数错误', | ||
| 254 | type: 'error' | ||
| 255 | }); | ||
| 256 | } else { | ||
| 257 | this.myQueryPhoneCode = res.data | ||
| 258 | this.dialogQueryPhoneCode = true | ||
| 259 | } | ||
| 260 | loading.close(); | ||
| 261 | }).catch(error=>{ | ||
| 262 | console.log(error); | ||
| 263 | loading.close(); | ||
| 264 | this.$message({ | ||
| 265 | showClose: true, | ||
| 266 | message: '服务器处理失败,请核对参数!', | ||
| 267 | type: 'error' | ||
| 268 | }); | ||
| 269 | }) | ||
| 270 | }, | ||
| 271 | onCopy (e) { | ||
| 272 | this.$message({ | ||
| 273 | showClose: true, | ||
| 274 | message: '内容已复制到剪切板!', | ||
| 275 | type: 'success' | ||
| 276 | }); | ||
| 176 | } | 277 | } |
| 177 | } | 278 | } |
| 178 | } | 279 | } | ... | ... |
-
Please register or sign in to post a comment