|
@@ -6,6 +6,7 @@
|
|
@change="handleChange"
|
|
@change="handleChange"
|
|
action="/service/manage/common/upload/files"
|
|
action="/service/manage/common/upload/files"
|
|
:showUploadList="false"
|
|
:showUploadList="false"
|
|
|
|
+ :headers="{token}"
|
|
accept=".jpg,.jpeg,.gif,.png,.webp"
|
|
accept=".jpg,.jpeg,.gif,.png,.webp"
|
|
>
|
|
>
|
|
<a-button type="primary" v-bind="{ ...getButtonProps }">
|
|
<a-button type="primary" v-bind="{ ...getButtonProps }">
|
|
@@ -16,7 +17,8 @@
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { defineComponent, computed } from 'vue';
|
|
import { defineComponent, computed } from 'vue';
|
|
-
|
|
|
|
|
|
+ import { useUserStore } from '/@/store/modules/user';
|
|
|
|
+ import { getToken } from '/@/utils/auth';
|
|
import { Upload } from 'ant-design-vue';
|
|
import { Upload } from 'ant-design-vue';
|
|
import { useDesign } from '/@/hooks/web/useDesign';
|
|
import { useDesign } from '/@/hooks/web/useDesign';
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
@@ -37,7 +39,7 @@
|
|
emits: ['uploading', 'done', 'error'],
|
|
emits: ['uploading', 'done', 'error'],
|
|
setup(props, { emit }) {
|
|
setup(props, { emit }) {
|
|
let uploading = false;
|
|
let uploading = false;
|
|
-
|
|
|
|
|
|
+ const token = getToken();
|
|
const { uploadUrl } = useGlobSetting();
|
|
const { uploadUrl } = useGlobSetting();
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
const { prefixCls } = useDesign('tinymce-img-upload');
|
|
const { prefixCls } = useDesign('tinymce-img-upload');
|
|
@@ -73,6 +75,7 @@
|
|
prefixCls,
|
|
prefixCls,
|
|
handleChange,
|
|
handleChange,
|
|
uploadUrl,
|
|
uploadUrl,
|
|
|
|
+ token,
|
|
t,
|
|
t,
|
|
getButtonProps,
|
|
getButtonProps,
|
|
};
|
|
};
|