PageSourceSearch

https://www.mechrevo.com/en/_nuxt/DSOLBxil.js

js mechrevo.com collected 2026-10-02 11:06:22 UTC 4,903 bytes, 1 lines download raw bytes

1import{u as b,i as h,c as r,a as e,f as l,d,t as a,F as _,D as w,x as c,o}from"./CBVuVATE.js";import{_ as k}from"./DlAUqK2U.js";const C={class:"min-h-screen flex items-center justify-center bg-gray-50"},T={class:"max-w-lg w-full bg-white rounded-2xl shadow-2xl p-10"},j={class:"space-y-6"},S={key:0,class:"text-center"},B={key:1},M={key:0,class:"space-y-4"},E={class:"bg-green-50 border-2 border-green-200 rounded-xl p-6"},L={class:"flex items-start"},R={class:"ml-4 flex-1"},D={class:"mt-3 text-sm text-green-700 space-y-2"},F={class:"mt-2 space-y-1 ml-4"},H={class:"flex items-center"},N={class:"text-xs text-green-600 font-medium"},P={class:"mt-3 bg-green-100 px-3 py-2 rounded-lg"},V={class:"text-xs text-green-700"},$={key:1,class:"space-y-4"},I={class:"bg-red-50 border-2 border-red-200 rounded-xl p-6"},O={class:"flex items-start"},U={class:"ml-4"},q={class:"mt-2 text-sm text-red-700"},z={class:"mb-2"},A={__name:"clear-cache",setup(G){const u=c(!0),i=c(!1),x=c(""),n=c({clearTime:"",clearedTypes:[]});async function p(){try{const t=await $fetch("/internal-api/cache/clear",{method:"POST"});if(t.status==="SUCCESS")return t.result;throw new Error(t.message||"清除缓存失败")}catch(t){throw console.error("清除缓存失败:",t),new Error(`清除缓存时发生错误: ${t.message||t}`)}}const g=async()=>{try{await new Promise(s=>setTimeout(s,500));const t=await p();n.value={clearTime:t.clearTime,clearedTypes:t.clearedTypes,clearedCounts:t.clearedCounts,totalCleared:t.totalCleared},i.value=!0}catch(t){console.error("清除缓存失败:",t),x.value=t.message||"未知错误",i.value=!1}finally{u.value=!1}};function m(){location.href="/"}function v(){u.value=!0,i.value=!1,x.value="",g()}return b({title:"清除缓存 - 管理工具",meta:[{name:"robots",content:"noindex, nofollow"},{name:"description",content:"Redis 缓存清除工具"}]}),h(()=>{g()}),(t,s)=>(o(),r("div",C,[e("div",T,[s[12]||(s[12]=e("div",{class:"text-center mb-8"},[e("h1",{class:"text-3xl font-bold text-gray-800 mb-2"},"缓存清除工具"),e("p",{class:"text-gray-600"},"正在清除缓存数据...")],-1)),e("div",j,[l(u)?(o(),r("div",S,[...s[0]||(s[0]=[e("div",{class:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-black mb-4"},null,-1),e("p",{class:"text-gray-700 font-medium"},"正在清除缓存,请稍候...",-1),e("p",{class:"text-sm text-gray-500 mt-2"},"这可能需要几秒钟时间",-1)])])):(o(),r("div",B,[l(i)?(o(),r("div",M,[e("div",E,[e("div",L,[s[8]||(s[8]=e("div",{class:"flex-shrink-0"},[e("div",{class:"w-12 h-12 bg-green-100 rounded-full flex items-center justify-center"},[e("svg",{class:"w-6 h-6 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])])],-1)),e("div",R,[s[7]||(s[7]=e("h3",{class:"text-lg font-semibold text-green-800"},"清除成功!",-1)),e("div",D,[e("p",null,[s[1]||(s[1]=e("strong",null,"清除时间:",-1)),d(a(l(n).clearTime),1)]),e("div",null,[s[3]||(s[3]=e("strong",null,"已清é
1™¤çš„缓存类型:",-1)),e("ul",F,[(o(!0),r(_,null,w(l(n).clearedTypes,(y,f)=>(o(),r("li",{key:f,class:"flex items-center justify-between bg-green-50 px-3 py-2 rounded-lg"},[e("span",H,[s[2]||(s[2]=e("span",{class:"w-2 h-2 bg-green-500 rounded-full mr-2"},null,-1)),d(" "+a(y),1)]),e("span",N,a(l(n).clearedCounts?.[f]||0)+" 个键 ",1)]))),128))])]),e("div",P,[e("p",V,[s[4]||(s[4]=d(" 总计清除缓存:",-1)),e("strong",null,a(l(n).totalCleared||0),1),s[5]||(s[5]=d(" 个键 ",-1))]),s[6]||(s[6]=e("p",{class:"text-xs text-green-700 mt-1"}," 提示:清除完成后,页面将使用最新的数据重新加载 ",-1))])])])])]),e("div",{class:"flex gap-3"},[e("button",{onClick:m,class:"flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 font-medium py-3 px-4 rounded-lg transition-colors"}," 返回首页 ")])])):(o(),r("div",$,[e("div",I,[e("div",O,[s[11]||(s[11]=e("div",{class:"flex-shrink-0"},[e("div",{class:"w-12 h-12 bg-red-100 rounded-full flex items-center justify-center"},[e("svg",{class:"w-6 h-6 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})])])],-1)),e("div",U,[s[10]||(s[10]=e("h3",{class:"text-lg font-semibold text-red-800"},"清除失败",-1)),e("div",q,[e("p",z,a(l(x)),1),s[9]||(s[9]=e("p",{class:"text-xs text-red-600"},"请检查 Redis 服务是否正常运行",-1))])])])]),e("div",{class:"flex gap-3"},[e("button",{onClick:v,class:"flex-1 bg-black hover:bg-black text-white font-medium py-3 px-4 rounded-lg transition-colors"}," 重试 "),e("button",{onClick:m,class:"flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 font-medium py-3 px-4 rounded-lg transition-colors"}," 返回首页 ")])]))]))])])]))}},Q=k(A,[["__scopeId","data-v-cc4f2baf"]]);export{Q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.