PageSourceSearch

https://csap.ai/assets/WechatPaymentCallbackView-C6PMF3b9.js

js csap.ai collected 2026-10-05 12:13:17 UTC 2,561 bytes, 1 lines download raw bytes

1import{d as L,r as M,w as U,c as p,o as j,Z as q,y as d,A as a,C as i,X as D,B as l}from"./vendor-vue-CsbjxI08.js";import{a as I}from"./index-BzylLGuI.js";import{u as Q}from"./vendor-i18n-5MxlSExE.js";import"./vendor-misc-CU62nypU.js";const V={class:"min-h-screen bg-gray-50 px-4 py-10 dark:bg-dark-900"},z={class:"mx-auto max-w-2xl"},F={class:"card p-6"},N={class:"text-lg font-semibold text-gray-900 dark:text-white"},O={class:"mt-2 text-sm text-gray-600 dark:text-gray-400"},X={key:0,class:"mt-6 flex items-center justify-center py-10"},Z={key:1,class:"mt-6 rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-dark-700 dark:bg-dark-800/80"},G={class:"text-sm text-gray-700 dark:text-gray-300"},ee=L({__name:"WechatPaymentCallbackView",setup(H){const{t:c}=Q(),f=D(),m=q(),g=I(),s=M("");U(s,t=>{t&&g.showError(t)});const k=p(()=>c("auth.wechatPayment.callbackProcessing")),b=p(()=>c("auth.wechatPayment.callbackTitle")),w=p(()=>c("auth.wechatPayment.backToPayment"));function x(t){const e=f.query[t];return Array.isArray(e)?typeof e[0]=="string"?e[0]:"":typeof e=="string"?e:""}function v(){const t=typeof window<"u"?window.location.hash:"",e=t.startsWith("#")?t.slice(1):t;return new URLSearchParams(e)}function P(t){const e=(t||"").trim();return!e||!e.startsWith("/")||e.startsWith("//")||e.includes("://")||e==="/payment"?"/purchase":e.startsWith("/payment?")?"/purchase"+e.slice(8):e}function n(t,e,o){o&&(t[e]=o)}function T(){m.replace("/purchase")}return j(async()=>{const t=v(),e=_=>t.get(_)||x(_),o=e("error")||e("err_msg")||e("errmsg"),R=e("error_description")||e("message");if(o){s.value=R||o;return}const u=e("wechat_resume_token"),y=e("openid"),B=e("state"),S=e("scope"),W=e("payment_type"),A=e("amount"),C=e("order_type"),E=e("plan_id"),h=new URL(P(e("redirect")),window.location.origin);if(!u&&!y){s.value=c("auth.wechatPayment.callbackMissingResumeToken");return}const r={...Object.fromEntries(h.searchParams.entries()),wechat_resume:"1"};u?r.wechat_resume_token=u:(r.openid=y,n(r,"state",B),n(r,"scope",S),n(r,"payment_type",W),n(r,"amount",A),n(r,"order_type",C),n(r,"plan_id",E)),await m.replace({path:h.pathname,query:r})}),(t,e)=>(l(),d("div",V,[a("div",z,[a("div",F,[a("h1",N,i(b.value),1),a("p",O,i(s.value||k.value),1),s.value?(l(),d("div",Z,[a("p",G,i(s.value),1),a("button",{class:"btn btn-primary mt-4",type:"button",onClick:T},i(w.value),1)])):(l(),d("div",X,[...e[0]||(e[0]=[a("div",{class:"h-8 w-8 animate-spin rounded-full border-4 border-primary-500 border-t-transparent"},null,-1)])]))])])]))}});export{ee 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.