马宇豪
2024-01-08 4ef6c36c631c3aa3916e0861fd211dec9b03231b
src/views/coalMine/cPeopleManage/index.vue
@@ -62,7 +62,8 @@
      </el-table-column>
      <el-table-column label="证件照片" align="center" prop="photoPath">
        <template #default="scope">
          <el-button type="text" @click="viewFile(scope.row.photoAttachment)">预览</el-button>
          <el-button type="text" v-if="scope.row.photoAttachment && scope.row.photoAttachment.fileUrl !==''" @click="viewFile(scope.row.photoAttachment)">预览</el-button>
          <span type="text" v-else>暂无</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="个人履历" align="center">-->
@@ -230,7 +231,7 @@
    },
    viewFile(file){
      const t = this
      axios.get(process.env.VUE_APP_BASE_API + file.fileUrl,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob'}).then(res=>{
      axios.get(process.env.VUE_APP_BASE_API + file.fileUrl,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob',timeout: 3000}).then(res=>{
        if (res && res.data) {
          const link = document.createElement('a')
          let blob = new Blob([res.data],{type: res.data.type})