mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 05:16:43 +08:00
提交
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
<el-col :span="12">{{formatsec(form.certify_at *1000)}}</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="认证资料:">
|
||||
<!-- <a href="http://" target="_blank" rel="noopener noreferrer"></a> -->
|
||||
<i style="color:blue" title="点击下载" @click="downloadActioon(form.certification)" class="el-icon-download"></i>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
@@ -332,6 +332,18 @@ export default {
|
||||
...mapGetters(["userInfo"])
|
||||
},
|
||||
methods: {
|
||||
downloadActioon(filePath) {
|
||||
if (!filePath) return;
|
||||
let link = document.createElement('a'); //创建a标签
|
||||
link.style.display = 'none'; //使其隐藏
|
||||
link.download = this.fileBaseUrl + filePath;
|
||||
link.setAttribute('target', '_blank');
|
||||
link.href = this.fileBaseUrl + filePath; //赋予文件下载地址
|
||||
link.setAttribute('download', '资料'); //设置下载属性 以及文件名
|
||||
document.body.appendChild(link); //a标签插至页面中
|
||||
link.click(); //强制触发a标签事件
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
getAvatar(){
|
||||
teacherApi.detail(this.newId).then(res => {
|
||||
if (res.status == 200) {
|
||||
|
||||
Reference in New Issue
Block a user