|
@@ -22,7 +22,7 @@
|
|
|
<el-upload
|
|
<el-upload
|
|
|
ref="upload"
|
|
ref="upload"
|
|
|
style="width: 384px; height: 192px; border-radius: 8px"
|
|
style="width: 384px; height: 192px; border-radius: 8px"
|
|
|
- :headers="headers"
|
|
|
|
|
|
|
+ :headers="getHeaders()"
|
|
|
:multiple="false"
|
|
:multiple="false"
|
|
|
:limit="1"
|
|
:limit="1"
|
|
|
drag
|
|
drag
|
|
@@ -103,22 +103,15 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { computed, ref } from 'vue';
|
|
import { computed, ref } from 'vue';
|
|
|
import axios, { AxiosRequestConfig } from 'axios';
|
|
import axios, { AxiosRequestConfig } from 'axios';
|
|
|
- import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
import { genFileId, ElMessage } from 'element-plus';
|
|
import { genFileId, ElMessage } from 'element-plus';
|
|
|
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
|
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
|
|
import { Close, Document, WarnTriangleFilled, Download } from '@element-plus/icons-vue';
|
|
import { Close, Document, WarnTriangleFilled, Download } from '@element-plus/icons-vue';
|
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
|
import urlJoin from 'url-join';
|
|
import urlJoin from 'url-join';
|
|
|
|
|
+ import { getHeaders } from '@/utils/http/axios';
|
|
|
|
|
|
|
|
const emits = defineEmits(['close', 'update']);
|
|
const emits = defineEmits(['close', 'update']);
|
|
|
|
|
|
|
|
- const userStore = useUserStore();
|
|
|
|
|
- const headers = {
|
|
|
|
|
- Satoken: userStore.getToken,
|
|
|
|
|
- Tenantid: userStore.getTenantId,
|
|
|
|
|
- targetTenantId: localStorage.getItem('targetTenantId') || '',
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const upload = ref<UploadInstance>();
|
|
const upload = ref<UploadInstance>();
|
|
|
const cardVisible = ref<boolean>(true);
|
|
const cardVisible = ref<boolean>(true);
|
|
|
const isImportEnable = ref<boolean>(true);
|
|
const isImportEnable = ref<boolean>(true);
|
|
@@ -137,7 +130,7 @@
|
|
|
const handleDownloadSceneCode = async () => {
|
|
const handleDownloadSceneCode = async () => {
|
|
|
try {
|
|
try {
|
|
|
const config: AxiosRequestConfig = {
|
|
const config: AxiosRequestConfig = {
|
|
|
- headers,
|
|
|
|
|
|
|
+ headers: getHeaders(),
|
|
|
responseType: 'blob',
|
|
responseType: 'blob',
|
|
|
};
|
|
};
|
|
|
const response = await axios.get(
|
|
const response = await axios.get(
|
|
@@ -165,7 +158,7 @@
|
|
|
const handleDownloadTemplate = async () => {
|
|
const handleDownloadTemplate = async () => {
|
|
|
try {
|
|
try {
|
|
|
const config: AxiosRequestConfig = {
|
|
const config: AxiosRequestConfig = {
|
|
|
- headers,
|
|
|
|
|
|
|
+ headers: getHeaders(),
|
|
|
responseType: 'blob',
|
|
responseType: 'blob',
|
|
|
};
|
|
};
|
|
|
const response = await axios.get(
|
|
const response = await axios.get(
|