fix 修复ueditor 单图上传,修复刷新页面router警告,添加手动清缓存
This commit is contained in:
parent
d77f88e0e6
commit
a884c08fc7
@ -26853,25 +26853,33 @@ UE.plugin.register("simpleupload", function() {
|
|||||||
|
|
||||||
function callback() {
|
function callback() {
|
||||||
try {
|
try {
|
||||||
var link,
|
var link,loader;
|
||||||
json,
|
var imageActionUrl = me.getActionUrl(me.getOpt("imageActionName"));
|
||||||
loader,
|
var imageUrlPrefix = me.getOpt("imageUrlPrefix");
|
||||||
body = (iframe.contentDocument || iframe.contentWindow.document)
|
var allowFiles = me.getOpt("imageAllowFiles");
|
||||||
.body,
|
var formData = new FormData()
|
||||||
result = body.innerText || body.textContent || "";
|
formData.append('upfile', input.files[0]);
|
||||||
json = new Function("return " + result)();
|
// 替换你的URL
|
||||||
link = me.options.imageUrlPrefix + json.url;
|
fetch(imageActionUrl,{
|
||||||
if (json.state == "SUCCESS" && json.url) {
|
method: "post",
|
||||||
loader = me.document.getElementById(loadingId);
|
body: formData
|
||||||
domUtils.removeClasses(loader, "loadingclass");
|
}).then(p=>p.json()).then(json=>{
|
||||||
loader.setAttribute("src", link);
|
link = me.options.imageUrlPrefix + json.url;
|
||||||
loader.setAttribute("_src", link);
|
if (json.state == "SUCCESS" && json.url) {
|
||||||
loader.setAttribute("alt", json.original || "");
|
loader = me.document.getElementById(loadingId);
|
||||||
loader.removeAttribute("id");
|
domUtils.removeClasses(loader, "loadingclass");
|
||||||
me.fireEvent("contentchange");
|
loader.setAttribute("src", link);
|
||||||
} else {
|
loader.setAttribute("_src", link);
|
||||||
showErrorLoader && showErrorLoader(json.state);
|
loader.setAttribute("alt", json.original || "");
|
||||||
}
|
loader.removeAttribute("id");
|
||||||
|
me.fireEvent("contentchange");
|
||||||
|
} else {
|
||||||
|
showErrorLoader && showErrorLoader(json.state);
|
||||||
|
}
|
||||||
|
}).catch(e=>{
|
||||||
|
showErrorLoader &&
|
||||||
|
showErrorLoader(me.getLang("simpleupload.loadError"));
|
||||||
|
})
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
showErrorLoader &&
|
showErrorLoader &&
|
||||||
showErrorLoader(me.getLang("simpleupload.loadError"));
|
showErrorLoader(me.getLang("simpleupload.loadError"));
|
||||||
|
9
src/api/system/cache/index.ts
vendored
Normal file
9
src/api/system/cache/index.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import request from '/@/utils/request';
|
||||||
|
|
||||||
|
// 清除缓存
|
||||||
|
export function removeCache() {
|
||||||
|
return request({
|
||||||
|
url: '/api/v1/system/cache/remove',
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
@ -32,6 +32,9 @@
|
|||||||
<div class="layout-navbars-breadcrumb-user-icon" @click="onLayoutSetingClick">
|
<div class="layout-navbars-breadcrumb-user-icon" @click="onLayoutSetingClick">
|
||||||
<i class="icon-skin iconfont" :title="$t('message.user.title3')"></i>
|
<i class="icon-skin iconfont" :title="$t('message.user.title3')"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layout-navbars-breadcrumb-user-icon" @click="removeCacheClick">
|
||||||
|
<i class="fa-trash fa" title="清除缓存"></i>
|
||||||
|
</div>
|
||||||
<div class="layout-navbars-breadcrumb-user-icon">
|
<div class="layout-navbars-breadcrumb-user-icon">
|
||||||
<el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false">
|
<el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
@ -90,6 +93,7 @@ import { Session, Local } from '/@/utils/storage';
|
|||||||
import UserNews from '/@/layout/navBars/breadcrumb/userNews.vue';
|
import UserNews from '/@/layout/navBars/breadcrumb/userNews.vue';
|
||||||
import Search from '/@/layout/navBars/breadcrumb/search.vue';
|
import Search from '/@/layout/navBars/breadcrumb/search.vue';
|
||||||
import {logout} from "/@/api/login";
|
import {logout} from "/@/api/login";
|
||||||
|
import {removeCache} from "/@/api/system/cache";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'layoutBreadcrumbUser',
|
name: 'layoutBreadcrumbUser',
|
||||||
@ -133,6 +137,12 @@ export default defineComponent({
|
|||||||
const onLayoutSetingClick = () => {
|
const onLayoutSetingClick = () => {
|
||||||
proxy.mittBus.emit('openSetingsDrawer');
|
proxy.mittBus.emit('openSetingsDrawer');
|
||||||
};
|
};
|
||||||
|
//清除缓存
|
||||||
|
const removeCacheClick = ()=>{
|
||||||
|
removeCache().then(()=>{
|
||||||
|
ElMessage.success('缓存清除成功');
|
||||||
|
})
|
||||||
|
};
|
||||||
// 下拉菜单点击时
|
// 下拉菜单点击时
|
||||||
const onHandleCommandClick = (path: string) => {
|
const onHandleCommandClick = (path: string) => {
|
||||||
if (path === 'logOut') {
|
if (path === 'logOut') {
|
||||||
@ -171,7 +181,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
} else if (path === 'wareHouse') {
|
} else if (path === 'wareHouse') {
|
||||||
window.open('https://gitee.com/lyt-top/vue-next-admin');
|
window.open('https://gitee.com/tiger1103/gfast');
|
||||||
} else {
|
} else {
|
||||||
router.push(path);
|
router.push(path);
|
||||||
}
|
}
|
||||||
@ -247,6 +257,7 @@ export default defineComponent({
|
|||||||
onSearchClick,
|
onSearchClick,
|
||||||
onComponentSizeChange,
|
onComponentSizeChange,
|
||||||
onLanguageChange,
|
onLanguageChange,
|
||||||
|
removeCacheClick,
|
||||||
searchRef,
|
searchRef,
|
||||||
layoutUserFlexNum,
|
layoutUserFlexNum,
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
|
@ -46,7 +46,7 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
// 前往通知中心点击
|
// 前往通知中心点击
|
||||||
const onGoToGiteeClick = () => {
|
const onGoToGiteeClick = () => {
|
||||||
window.open('https://gitee.com/lyt-top/vue-next-admin');
|
window.open('https://gitee.com/tiger1103/gfast');
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
onAllReadClick,
|
onAllReadClick,
|
||||||
|
@ -1163,4 +1163,11 @@ export const staticRoutes: Array<RouteRecordRaw> = [
|
|||||||
title: 'message.router.visualizingLinkDemo2',
|
title: 'message.router.visualizingLinkDemo2',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/:pathMatch(.*)*',
|
||||||
|
component: () => import('/@/layout/routerView/parent.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '加载中',
|
||||||
|
},
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user