File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 103103 <a-button class =" cancel-btn" @click =" hideCloseConfirm" >
104104 取消
105105 </a-button >
106+ <a-button type =" primary" status =" warning" class =" clear-cache-btn" @click =" clearSessionStorage" >
107+ 仅清缓存
108+ </a-button >
106109 <a-button type =" primary" status =" danger" class =" confirm-btn" @click =" confirmClose" >
107110 确认关闭
108111 </a-button >
@@ -346,6 +349,17 @@ export default defineComponent({
346349 hideCloseConfirm () {
347350 this .showConfirmModal = false ;
348351 },
352+ clearSessionStorage () {
353+ try {
354+ // 清除当前页面的sessionStorage
355+ sessionStorage .clear ();
356+ this .showConfirmModal = false ;
357+ Message .success (" 缓存已清除" );
358+ } catch (error) {
359+ console .error (' 清除缓存失败:' , error);
360+ Message .error (" 清除缓存失败" );
361+ }
362+ },
349363 confirmClose () {
350364 this .showConfirmModal = false ;
351365 Message .info (" 正在关闭应用..." );
@@ -700,6 +714,13 @@ export default defineComponent({
700714 font-weight : 500 ;
701715}
702716
717+ .clear-cache-btn {
718+ min-width : 90px ;
719+ height : 36px ;
720+ border-radius : 6px ;
721+ font-weight : 500 ;
722+ }
723+
703724.confirm-btn {
704725 min-width : 100px ;
705726 height : 36px ;
You can’t perform that action at this time.
0 commit comments