Commit 3ec71734 3ec717341e52f7c502d5f681c144d6df05192f64 by zhanghao

commit

1 parent 242c8783
...@@ -2,6 +2,27 @@ ...@@ -2,6 +2,27 @@
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">
5 <el-form ref="nlpTestCase" :model="nlpTestCase" label-width="0px"> 26 <el-form ref="nlpTestCase" :model="nlpTestCase" label-width="0px">
6 <el-card class="darkred" shadow="always"> 27 <el-card class="darkred" shadow="always">
7 <div slot="header" class="clearfix"> 28 <div slot="header" class="clearfix">
...@@ -86,7 +107,11 @@ ...@@ -86,7 +107,11 @@
86 }, { 107 }, {
87 value: '2', 108 value: '2',
88 label: '线上环境' 109 label: '线上环境'
89 }] 110 }],
111 smsCode: {
112 phone: '',
113 code: 1111
114 }
90 } 115 }
91 }, 116 },
92 mounted() { 117 mounted() {
...@@ -109,6 +134,45 @@ ...@@ -109,6 +134,45 @@
109 const {href} = this.$router.resolve({ name:'nlp', query: 134 const {href} = this.$router.resolve({ name:'nlp', query:
110 {myplatform: this.nlpTestCase.myplatform.toString(), runtime: this.nlpTestCase.runtime.toString()}}) 135 {myplatform: this.nlpTestCase.myplatform.toString(), runtime: this.nlpTestCase.runtime.toString()}})
111 window.open(href, '_blank') 136 window.open(href, '_blank')
137 },
138 smsCodeSubmit() {
139 let config = {
140 headers: {
141 'Content-Type': 'application/x-www-form-urlencoded'
142 }
143 }
144 this.$http.get('/aimeTool/smsCode?'+this.$qs.stringify({
145 phone: this.smsCode.phone,
146 code: this.smsCode.code
147 }),config).then((res)=>{
148 console.log(res);
149 if(res.data=='OK') {
150 this.$message({
151 showClose: true,
152 message: '设置短信验证码成功',
153 type: 'success'
154 });
155 } else if(res.data=='phoneError') {
156 this.$message({
157 showClose: true,
158 message: '手机号格式错误,必须是11位',
159 type: 'error'
160 });
161 } else {
162 this.$message({
163 showClose: true,
164 message: '设置短信验证码失败',
165 type: 'error'
166 });
167 }
168 }).catch(error=>{
169 console.log(error);
170 this.$message({
171 showClose: true,
172 message: '服务器处理失败,请核对参数!',
173 type: 'error'
174 });
175 })
112 } 176 }
113 } 177 }
114 } 178 }
......