Browse Source

1、修改企业认证
2、修改虚拟机ip

郭超 2 years ago
parent
commit
ba489d1633
2 changed files with 42 additions and 38 deletions
  1. 4 4
      src/components/task/Task.vue
  2. 38 34
      src/pages/UserCenter/EnterpriseAuth.vue

+ 4 - 4
src/components/task/Task.vue

@@ -596,7 +596,7 @@ export default {
     manageVirtualMachine(){
       getToken(this.projectId, this.taskId).then((res) => {
         var token = res.data
-        var url = 'http://49.232.124.49:38080/cloudtest/api/oauth/gateway?website=cofortest&token='+ token + '&userId='+this.user.userVO.id +
+        var url = 'http://docker.chuangchaokeji.cn:38080/cloudtest/api/oauth/gateway?website=cofortest&token='+ token + '&userId='+this.user.userVO.id +
           '&screen=PROJECT' + '&projectId='+this.projectId+'&taskId='+this.taskId;
         window.open(url);
       })
@@ -605,7 +605,7 @@ export default {
     // createVirtualMachine(){
     //   getToken(this.projectId, this.taskId).then((res) => {
     //     var token = res.data
-    //     var url = 'http://49.232.124.49:38080/cloudtest/api/oauth/gateway?website=cofortest&token='+ token + '&userId='+this.user.userVO.id +
+    //     var url = 'http://docker.chuangchaokeji.cn:38080/cloudtest/api/oauth/gateway?website=cofortest&token='+ token + '&userId='+this.user.userVO.id +
     //       '&screen=HOME';
     //     window.open(url);
     //   })
@@ -614,7 +614,7 @@ export default {
     connectVirtualMachine(){
       getToken(this.projectId, this.taskId).then((res) => {
         var token = res.data
-        var url = 'http://49.232.124.49:38080/cloudtest/api/oauth/connect?userId='+this.user.userVO.id+ '&projectId='+
+        var url = 'http://docker.chuangchaokeji.cn:38080/cloudtest/api/oauth/connect?userId='+this.user.userVO.id+ '&projectId='+
           this.projectId+'&taskId='+this.taskId+'&token='+token;
         window.open(url);
       })
@@ -684,7 +684,7 @@ export default {
     handleFormatReport(acceptedUserList) {
       console.log(acceptedUserList,"this.acceptedUserList")
       acceptedUserList.map((user) => {
-        
+
         user.crowdReportVOS && user.crowdReportVOS.map((report) => {
           report.userName = user.userVO.userName;
           this.reportList.push(report);

+ 38 - 34
src/pages/UserCenter/EnterpriseAuth.vue

@@ -117,10 +117,10 @@
           <el-input :disabled="!canEdit" v-model="enterpriseForm.address"></el-input>
         </el-form-item>
         <el-form-item label="认证权限" prop="roleList">
-          <el-checkbox-group v-model="enterpriseForm.roleList" :disabled="!canEdit" :min="1" :max="1">
-            <el-checkbox :label="1">发包企业</el-checkbox>
-            <el-checkbox :label="0">测评机构</el-checkbox>
-          </el-checkbox-group>
+          <el-radio-group v-model="enterpriseForm.roleList" :disabled="!canEdit">
+            <el-radio :label="1">发包企业</el-radio>
+            <el-radio :label="0">测评机构</el-radio>
+          </el-radio-group>
         </el-form-item>
       </el-form>
       <div class="uploader-wrapper">
@@ -216,7 +216,7 @@
           businessLicensePhoto: "",//企业执照
         },
         enterpriseForm: {
-          roleList: [],//0是发包 1是接包 如果两个都有那么权限都有。
+          roleList: 1,//0是发包 1是接包 如果两个都有那么权限都有。
           legalPersonName: "", //法人姓名
           idCardNum: "",//身份证号码
           address: "",//地址
@@ -251,7 +251,7 @@
             {required: false, message: '请选择性别', trigger: 'blur'}
           ],
           roleList: [
-            {type: 'array', required: true, message: '请选择认证权限', trigger: 'change'}
+            {required: true, message: '请选择认证权限', trigger: 'change'}
           ],
           idCardDeadTime: [
             {required: false, message: '请选择身份证过期时间', trigger: 'change'}
@@ -281,6 +281,36 @@
           if (!valid) {
             notify('error', '信息填写不规范');
             return false
+          }else{
+            let firstSubmit = this.$route.query.type;
+            if (this.enterpriseForm.roleList === 0) {
+              this.enterpriseForm.roleList = ["0", "1"]
+            }else{
+              this.enterpriseForm.roleList = ["1"]
+            }
+            let data = {...this.enterpriseForm, ...this.enterpriseForm1};
+            this.showLoading();
+            if (firstSubmit == 1) {
+              Http.post(`/api/user/${this.user.id}/agency`, data).then(res => {
+                if (res) {
+                  notify('success', '提交成功');
+                  this.$router.push('/personal/authentication')
+                }
+              }).catch(err => {
+                this.hideLoading();
+                notify('error', err.data)
+              })
+            } else {
+              Http.put(`/api/user/${this.user.id}/agency`, data).then(res => {
+                if (res) {
+                  notify('success', '修改成功');
+                  this.$router.push('/personal/authentication')
+                }
+              }).catch(err => {
+                this.hideLoading();
+                notify('error', err.data)
+              })
+            }
           }
         })
          //if (!this.enterpriseForm.idCardPositivePhoto) {
@@ -291,33 +321,7 @@
            //notify('error', '身份证反面照片上传不规范');
            //return false;
          //}
-        let firstSubmit = this.$route.query.type;
-        if (this.enterpriseForm.roleList[0]=="0") {
-          this.enterpriseForm.roleList.push("1")
-        }
-        let data = {...this.enterpriseForm, ...this.enterpriseForm1};
-        this.showLoading();
-        if (firstSubmit == 1) {
-          Http.post(`/api/user/${this.user.id}/agency`, data).then(res => {
-            if (res) {
-              notify('success', '提交成功');
-              this.$router.push('/personal/authentication')
-            }
-          }).catch(err => {
-            this.hideLoading();
-            notify('error', err.data)
-          })
-        } else {
-          Http.put(`/api/user/${this.user.id}/agency`, data).then(res => {
-            if (res) {
-              notify('success', '修改成功');
-              this.$router.push('/personal/authentication')
-            }
-          }).catch(err => {
-            this.hideLoading();
-            notify('error', err.data)
-          })
-        }
+
       },
       //获取当前认证状态
       getAuthStatus() {
@@ -338,7 +342,7 @@
       setFormInfo(detail) {
         //回显认证信息
         console.log("回显认证信息rolelist", detail.roleList);
-        this.enterpriseForm.roleList = detail.roleList.length>1? [0] :[1] ;
+        this.enterpriseForm.roleList = detail.roleList.length >1? 0 : 1 ;
         console.log(this.enterpriseForm.roleList,"this.enterpriseForm.roleList");
           this.enterpriseForm.legalPersonName = detail.legalPersonName,
           this.enterpriseForm.gender = detail.gender,