You need to sign in or sign up before continuing.
Commit 8279deb1 8279deb1ddbca90da301ddc9ce907ab16f0bdac1 by zhanghao

commit

1 parent f17becb4
1 <template xmlns:el-col="http://www.w3.org/1999/html">
2 <div>
3 <json-viewer
4 :value="jsonData"
5 :expand-depth=10
6 copyable></json-viewer>
7 </div>
8 </template>
9
10 <script>
11 export default {
12 data() {
13 return {
14 method: this.$route.query.method,
15 biz_data: this.$route.query.biz_data,
16 phone: this.$route.query.phone,
17 path: this.$route.query.path,
18 type: this.$route.query.type,
19 jsonData: ''
20 }
21 },
22 mounted() {
23 this.activity()
24 },
25 methods: {
26 activity() {
27 const loading = this.$loading({
28 lock: true,
29 text: '加载中...',
30 spinner: 'el-icon-loading',
31 background: 'rgba(0, 0, 0, 0.7)'
32 });
33 let config = {
34 headers: {
35 'Content-Type': 'application/x-www-form-urlencoded'
36 }
37 }
38 this.$http.get('/tool2/apiTest?'+this.$qs.stringify({
39 method: this.method,
40 biz_data: this.biz_data,
41 phone: this.phone,
42 path: this.path,
43 type: this.type
44 }),config).then((res)=>{
45 console.log(res.data)
46 this.jsonData=res.data
47 loading.close();
48 }).catch(error=>{
49 console.log(error);
50 loading.close();
51 this.$message({
52 showClose: true,
53 message: '服务器处理失败,请核对参数!',
54 type: 'error'
55 });
56 })
57 }
58 }
59 }
60 </script>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
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">测试工具</el-menu-item>
15 <el-menu-item index="/tool2">测试工具2.0</el-menu-item>
15 <el-menu-item index="/androidCode">线上包二维码</el-menu-item> 16 <el-menu-item index="/androidCode">线上包二维码</el-menu-item>
16 <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>
17 <el-menu-item><a class="link" href="http://192.168.8.113:8070/ios/new/log.html" target="_blank">IOS UI自动化</a></el-menu-item> 18 <el-menu-item><a class="link" href="http://192.168.8.113:8070/ios/new/log.html" target="_blank">IOS UI自动化</a></el-menu-item>
......
...@@ -930,7 +930,7 @@ ...@@ -930,7 +930,7 @@
930 value: 'activity', 930 value: 'activity',
931 label: 'activity' 931 label: 'activity'
932 }, { 932 }, {
933 value: 'ucenter', 933 value: 'uc',
934 label: 'ucenter' 934 label: 'ucenter'
935 }, { 935 }, {
936 value: 'peripheral', 936 value: 'peripheral',
......
1 <template xmlns:el-col="http://www.w3.org/1999/html">
2 <div>
3 <el-row style="margin-bottom: 15px; margin-top: 5px">
4 <el-col :span="8">
5 <el-form ref="apiTest" :model="apiTest" 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-select v-model="apiTest.path" placeholder="请选择接口服务">
13 <el-option
14 v-for="item in apiTestPathoptions"
15 :key="item.value"
16 :label="item.label"
17 :value="item.value">
18 </el-option>
19 </el-select>
20 </el-form-item>
21 <el-form-item>
22 <el-input placeholder="请输入method" v-model="apiTest.method" clearable></el-input>
23 </el-form-item>
24 <el-form-item>
25 <el-input placeholder="请输入biz_data" v-model="apiTest.biz_data" clearable></el-input>
26 </el-form-item>
27 <el-form-item>
28 <el-input placeholder="请输入手机号,如果token已失效,请在app进行登录" v-model="apiTest.phone" clearable></el-input>
29 </el-form-item>
30 <el-form-item>
31 <el-select v-model="apiTest.huanjing" placeholder="请选择执行环境">
32 <el-option
33 v-for="item in apiTestoptions"
34 :key="item.value"
35 :label="item.label"
36 :value="item.value">
37 </el-option>
38 </el-select>
39 </el-form-item>
40 <div style="margin: 15px 0;"></div>
41 <el-form-item>
42 <el-button round @click="apiTestSubmit">调用接口</el-button>
43 </el-form-item>
44 </div>
45 </el-card>
46 </el-form>
47 </el-col>
48 </el-row>
49 </div>
50 </template>
51
52 <style>
53 .text {
54 font-size: 14px;
55 }
56
57 .item {
58 margin-bottom: 18px;
59 }
60
61 .clearfix:before,
62 .clearfix:after {
63 display: table;
64 content: "";
65 }
66 .clearfix:after {
67 clear: both
68 }
69 .yellowgreen {
70 width: calc(100% - 20px);
71 padding: 0px;
72 background-color: yellowgreen;
73 }
74
75 .darkred {
76 width: calc(100% - 20px);
77 padding: 0px;
78 background-color: darkkhaki;
79 }
80
81 .blue {
82 width: calc(100% - 20px);
83 padding: 0px;
84 background-color: deepskyblue;
85 }
86
87 .Orange {
88 width: calc(100% - 20px);
89 padding: 0px;
90 background-color: Orange;
91 }
92
93 .chocolate {
94 width: calc(100% - 20px);
95 padding: 0px;
96 background-color: chocolate;
97 }
98
99 .CadetBlue {
100 width: calc(100% - 20px);
101 padding: 0px;
102 background-color: CadetBlue;
103 }
104 .LightPink {
105 width: calc(100% - 20px);
106 padding: 0px;
107 background-color: LightPink;
108 }
109 .LightSalmon {
110 width: calc(100% - 20px);
111 padding: 0px;
112 background-color: LightSalmon;
113 }
114 </style>
115
116 <script>
117 export default {
118 data() {
119 return {
120 apiTest: {
121 path: [],
122 method: '',
123 biz_data: '',
124 phone: '',
125 huanjing: []
126 },
127 apiTestoptions: [{
128 value: '0',
129 label: '测试环境'
130 }],
131 apiTestPathoptions: [{
132 value: 'business',
133 label: 'business'
134 }, {
135 value: 'insurance',
136 label: 'insurance'
137 }, {
138 value: 'activity',
139 label: 'activity'
140 }, {
141 value: 'uc',
142 label: 'ucenter'
143 }, {
144 value: 'peripheral',
145 label: 'peripheral'
146 }, {
147 value: 'recommend',
148 label: 'recommend'
149 }]
150 }
151 },
152 mounted() {
153 this.openToolPage();
154 },
155 methods: {
156 openToolPage() {
157 let config = {
158 headers: {
159 'Content-Type': 'application/x-www-form-urlencoded'
160 }
161 }
162 this.$http.get('/tool2/openToolPage',config).then((res)=>{
163 console.log(res);
164 }).catch(error=>{
165 console.log(error);
166 })
167 },
168 apiTestSubmit() {
169 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()}})
171 window.open(href, '_blank')
172 }
173 }
174 }
175 </script>
...@@ -2,12 +2,14 @@ import Vue from 'vue' ...@@ -2,12 +2,14 @@ import Vue from 'vue'
2 import Router from 'vue-router' 2 import Router from 'vue-router'
3 import index from '@/page/index' 3 import index from '@/page/index'
4 import tool from '@/page/tool' 4 import tool from '@/page/tool'
5 import tool2 from '@/page/tool2'
5 import activityConfig from '@/page/activityConfig' 6 import activityConfig from '@/page/activityConfig'
6 import activityConfigRedis from '@/page/activityConfigRedis' 7 import activityConfigRedis from '@/page/activityConfigRedis'
7 import userInfo from '@/page/userInfo' 8 import userInfo from '@/page/userInfo'
8 import callLinuxCommand from '@/page/callLinuxCommand' 9 import callLinuxCommand from '@/page/callLinuxCommand'
9 import callLinuxLogByUid from '@/page/callLinuxLogByUid' 10 import callLinuxLogByUid from '@/page/callLinuxLogByUid'
10 import apiTest from '@/page/apiTest' 11 import apiTest from '@/page/apiTest'
12 import apiTest2 from '@/page/apiTest2'
11 import apiTestAime from '@/page/apiTestAime' 13 import apiTestAime from '@/page/apiTestAime'
12 import tjUser from '@/page/tjUser' 14 import tjUser from '@/page/tjUser'
13 import nlp from '@/page/nlp' 15 import nlp from '@/page/nlp'
...@@ -45,6 +47,13 @@ export default new Router({ ...@@ -45,6 +47,13 @@ export default new Router({
45 } 47 }
46 }, 48 },
47 { 49 {
50 path: '/tool2',
51 component: tool2,
52 meta: {
53 title: '测试工具平台'
54 }
55 },
56 {
48 path: '/activityConfig', 57 path: '/activityConfig',
49 component: activityConfig, 58 component: activityConfig,
50 name: 'activityConfig', 59 name: 'activityConfig',
...@@ -159,6 +168,14 @@ export default new Router({ ...@@ -159,6 +168,14 @@ export default new Router({
159 } 168 }
160 }, 169 },
161 { 170 {
171 path: '/apiTest2',
172 component: apiTest2,
173 name: 'apiTest2',
174 meta: {
175 title: '测试工具平台'
176 }
177 },
178 {
162 path: '/apiTestAime', 179 path: '/apiTestAime',
163 component: apiTestAime, 180 component: apiTestAime,
164 name: 'apiTestAime', 181 name: 'apiTestAime',
......