qinzhipeng_v 5 lat temu
rodzic
commit
6e6df7142f

+ 9 - 2
src/views/mock/httpmock.vue

@@ -47,7 +47,10 @@
         <template slot-scope="scope"><span>{{ scope.row.actualUrl }}</span></template>
       </el-table-column>
       <el-table-column label="创建人" min-width="110px" align="center">
-        <template slot-scope="scope"><span>{{ scope.row.creator }}</span></template>
+        <template slot-scope="scope">{{ scope.row.creator }}</template>
+      </el-table-column>
+      <el-table-column label="更新人" min-width="110px" align="center">
+        <template slot-scope="scope">{{ scope.row.updator }}</template>
       </el-table-column>
       <el-table-column label="更新时间" min-width="150px" align="center">
         <template slot-scope="scope"><span>{{ scope.row.updateTimeStr }}</span></template>
@@ -186,6 +189,8 @@ export default {
       consumerSelections,
       sortOptions: [{ label: 'ID Ascending', key: '+id' }, { label: 'ID Descending', key: '-id' }],
       statusOptions: ['published', 'draft', 'deleted'],
+      userNames: localStorage.getItem('realname'),
+      username: localStorage.getItem('username'),
       showReviewer: false,
       showSubmitBtn: true,
       temp: {
@@ -369,6 +374,8 @@ export default {
       this.$refs['serviceDataForms'].validate((valid) => {
         if (valid) {
           this.serviceData = ele
+          this.serviceData.creator = this.userNames
+          this.serviceData.creatorEn = this.username
           this.serviceData.id = ''
           this.serviceData.returnDataType === 512
           if (this.serviceData.requestForWard) { this.serviceData.redirect = 1 } else { this.serviceData.redirect = 0 }
@@ -498,7 +505,7 @@ export default {
             method: ele.method,
             actualUrl: this.serviceData.actualUrl,
             status: this.serviceData.status,
-            creator: this.serviceData.creator,
+            updator: this.userNames,
             returnDataType: '512',
             mockUrl: this.serviceData.mockUrl,
             redirect: this.serviceData.redirect

+ 2 - 0
src/views/mock/httprule.vue

@@ -189,6 +189,7 @@ export default {
       btnReception: {},
       whenScript: '',
       userNames: localStorage.getItem('realname'),
+      username: localStorage.getItem('username'),
       ruleForm: {
         whenScript: 0,
         expression1: 'any',
@@ -424,6 +425,7 @@ export default {
           if (valid) {
             this.dataFrom = vel
             this.dataFrom.creator = this.userNames
+            this.dataFrom.creatorEn = this.username
             // this.dataFrom.updator = this.userNames
             this.dataFrom.methodId = parseInt(this.$route.path.split('/')[3])
             this.dataFrom.methodProtocol = 'http'

+ 14 - 4
src/views/mock/interface.vue

@@ -84,6 +84,15 @@
           <span>{{ scope.row.updateTimeStr }}</span>
         </template>
       </el-table-column>
+
+      <el-table-column label="创建人" min-width="110px" align="center">
+        <template slot-scope="scope">{{ scope.row.creator }}</template>
+      </el-table-column>
+
+      <el-table-column label="更新人" min-width="110px" align="center">
+        <template slot-scope="scope">{{ scope.row.updator }}</template>
+      </el-table-column>
+
       <el-table-column v-if="showReviewer" label="备注" min-width="110px" align="center">
         <template slot-scope="scope">
           <span style="color:red;">{{ scope.row.remark }}</span>
@@ -259,6 +268,8 @@ export default {
       styleObj: {
         'color': 'rgba(0, 0, 0, 0.726)'
       },
+      userNames: localStorage.getItem('realname'),
+      username: localStorage.getItem('username'),
       tableKey: 0,
       list: null,
       total: 0,
@@ -570,9 +581,8 @@ export default {
           if (typeof this.serviceData.consumerIds === 'object') {
             this.serviceData.consumerIds = '[' + this.serviceData.consumerIds.toString() + ']'
           }
-          // console.log('#######################')
-          // console.log(this.serviceData)
-          // console.log('#######################')
+          this.serviceData.creator = this.userNames
+          this.serviceData.creatorEn = this.username
           createService(this.serviceData).then(response => {
             // this.list.unshift(this.serviceData)
             // console.log(response)
@@ -699,7 +709,7 @@ export default {
             methodStatus: this.serviceData.methodStatus,
             consumerIds: '[' + this.serviceData.consumerIds.toString() + ']',
             remark: this.serviceData.remark,
-            updator: ''
+            updator: this.userNames
           }
           // console.log(tempData)
           updateService(tempData).then(response => {

+ 2 - 0
src/views/mock/rule.vue

@@ -181,6 +181,7 @@ export default {
         'color': 'rgba(0, 0, 0, 0.726)'
       },
       userNames: localStorage.getItem('realname'),
+      username: localStorage.getItem('username'),
       tableKey: 0,
       list: null,
       total: 0,
@@ -359,6 +360,7 @@ export default {
             delete this.ruleData.id
             this.ruleData.methodId = parseInt(this.$route.path.split('/')[3])
             this.ruleData.creator = this.userNames
+            this.ruleData.creatorEn = this.username
             createRule(this.ruleData).then(response => {
               // this.list.unshift(this.serviceData)
               if (response.code === 200) {