diff --git a/src/libs/util.js b/src/libs/util.js index 2943822..32458d7 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -89,6 +89,20 @@ const util = { getFileExt(fileName) { return fileName.substring(fileName.lastIndexOf('.') + 1) }, + // 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域 + downloadFile(fileName,url) { + var x = new XMLHttpRequest() + x.open("GET", url, true) + x.responseType = 'blob' + x.onload=function(e) { + var url = window.URL.createObjectURL(x.response) + var a = document.createElement('a') + a.href = url + a.download = fileName + a.click() + } + x.send() + }, } export default util \ No newline at end of file diff --git a/src/pages/client/list/index.vue b/src/pages/client/list/index.vue index a6e7647..ef1ad52 100644 --- a/src/pages/client/list/index.vue +++ b/src/pages/client/list/index.vue @@ -137,8 +137,8 @@ export default { searchContent: this.keyword } this.$get(`${this.api.queryClient}/${this.pageNo}/${this.pageSize}`,data).then(res => { - this.customerData = res.data.list - this.totals = res.data.total + this.customerData = res.data.list.list + this.totals = res.data.list.totalCount }).catch(res => {}); }, getProvince(){ diff --git a/src/pages/quesBank/list/myQuesBank.vue b/src/pages/quesBank/list/myQuesBank.vue index cff2c63..56342ad 100644 --- a/src/pages/quesBank/list/myQuesBank.vue +++ b/src/pages/quesBank/list/myQuesBank.vue @@ -277,7 +277,8 @@ export default { .then(() => { let data = { userId: this.userId, - ids: shareList + ids: shareList, + source: 1 } this.$post(this.api.batchSave,data).then(res => { this.multipleSelection = []; diff --git a/src/pages/quesBank/list/quesDialog.vue b/src/pages/quesBank/list/quesDialog.vue index 6727112..ad529f4 100644 --- a/src/pages/quesBank/list/quesDialog.vue +++ b/src/pages/quesBank/list/quesDialog.vue @@ -46,9 +46,10 @@ :on-exceed="handleExceed" :action="this.api.fileupload" :file-list="uploadList" - > + > 上传视频/音频 + 已上传 @@ -396,12 +397,14 @@ export default { ) }, uploadSuccess(res, file, fileList) { + this.uploading = false this.topicForm.videoAudio = res.data.filesResult.fileId }, showFaild(){ location.href = `${this.api.export_failure}?token=${this.token}` }, uploadError(err, file, fileList) { + this.uploading = false this.$message({ message: "上传出错,请重试!", type: "error", diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue index 2eb0c7f..5ecc07d 100644 --- a/src/pages/system/list/staff.vue +++ b/src/pages/system/list/staff.vue @@ -360,7 +360,7 @@ export default { this.manageForm.phone = user.phone this.manageForm.email = user.email this.manageForm.userAccount = user.account - this.originalAccount = Number(user.account) + this.originalAccount = user.account this.manageForm.userId = user.userId this.manageForm.roleValue = or.roleId diff --git a/src/pages/user/list/index.vue b/src/pages/user/list/index.vue index 742e507..79bb8a6 100644 --- a/src/pages/user/list/index.vue +++ b/src/pages/user/list/index.vue @@ -192,8 +192,8 @@ export default { pageSize: this.pageSize } this.$get(`${this.api.queryUser}/${this.pageNo}/${this.pageSize}`,data).then(res => { - this.userData = res.data.list - this.totals = res.data.total + this.userData = res.data.list.list + this.totals = res.data.list.totalCount }).catch(res => {}); }, accountChange(){ @@ -217,7 +217,7 @@ export default { cityId: '' } this.$get(`${this.api.queryClient}/1/1000`,data).then(res => { - this.clientList = res.data.list + this.clientList = res.data.list.list }).catch(res => {}); }, closeTeacher(){ diff --git a/src/setting.js b/src/setting.js index 9e1f36f..2389a32 100644 --- a/src/setting.js +++ b/src/setting.js @@ -62,7 +62,7 @@ const Setting = { maxSize: 30, }, // 是否使用动态路由 - dynamicRoute: false + dynamicRoute: true }; export default Setting; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index a3843f3..a14340e 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -58,7 +58,7 @@ export default { get(api.logins,{ account: username.trim(), password: password }).then(res => { if(res.success){ let user = res.data.userInfo - if(user.isPort == 0 || user.isPort == 1){ + if((user.isPort == 0 || user.isPort == 1) && user.roleId != 4){ let routes = res.data.permissions[0].children commit('SET_INFO',{ avatar: user.userAvatars,