public: 发布2.8.0版本 (#1998)
* feat:修改token获取优先级,优先从header获取 * feat: 增加业务ctx的传递 * fix文件选择问题, 有公共函数onDownloadFile,去掉downloadFile * 没问题 * feat: 增加context引入 * fix: 修复图片多选的情况下点击确定抽屉无法收起的bug * feat: 提高header的token优先级,优化导出表格逻辑,不再依赖于cookie鉴权 --------- Co-authored-by: piexlMax(奇淼 <qimiaojiangjizhao@gmail.com> Co-authored-by: task <121913992@qq.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
:before-upload="beforeImageUpload"
|
||||
:multiple="false"
|
||||
:data="{'classId': props.classId}"
|
||||
:headers="{'x-token': token}"
|
||||
>
|
||||
<el-button type="primary" :icon="Upload">压缩上传</el-button>
|
||||
</el-upload>
|
||||
@@ -17,7 +18,8 @@
|
||||
import ImageCompress from '@/utils/image'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getBaseUrl } from '@/utils/format'
|
||||
import {Upload} from "@element-plus/icons-vue";
|
||||
import { Upload } from "@element-plus/icons-vue";
|
||||
import { useUserStore } from "@/pinia";
|
||||
|
||||
defineOptions({
|
||||
name: 'UploadImage'
|
||||
@@ -43,6 +45,10 @@
|
||||
}
|
||||
})
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const token = userStore.token
|
||||
|
||||
const beforeImageUpload = (file) => {
|
||||
const isJPG = file.type?.toLowerCase() === 'image/jpeg'
|
||||
const isPng = file.type?.toLowerCase() === 'image/png'
|
||||
|
Reference in New Issue
Block a user