fix(auth): secure sessions and app routing
Validate sessions against the API, honor configurable base paths, and route unknown pages to 404. Keep development ports stable so user and admin apps cannot be confused. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
import{D as e,E as t,Et as n,G as r,J as i,N as a,O as o,P as s,T as c,Xt as l,b as u,g as d,t as f,vt as p,w as m}from"./_plugin-vue_export-helper-Bo3WtfwJ.js";import{i as h,n as g}from"./format-C72AoJ2H.js";import{c as _,d as v}from"./index-BAQfYU-Q.js";import{t as y}from"./PageHeader-DTO8lja2.js";import{t as b}from"./PageSkeleton-DHtB6RUa.js";import{t as x}from"./SimpleStatusTimeline-wcI2qobj.js";var S=[{id:`registered`,label:`سفارش ثبت شد`},{id:`priced`,label:`قیمت گذاری انجام شد`},{id:`proforma_sent`,label:`پیش فاکتور ارسال شد`},{id:`proforma_confirmed`,label:`پیش فاکتور تایید شد`},{id:`invoice_sent`,label:`فاکتور ارسال شد`},{id:`shipped`,label:`بار ارسال شد`},{id:`delivered`,label:`بار توسط شما تحویل گرفته شد`}],C={submitted:0,awaiting_review:1,pricing:1,needs_correction:1,awaiting_settlement:2,awaiting_settlement_fix:2,cash_in_progress:2,cash_invoice_issued:2,awaiting_cash_payment:2,cash_payment_submitted:2,check_in_progress:2,awaiting_cash_confirmation:3,awaiting_check_review:3,check_needs_fix:3,check_rejected:3,checks_approved:3,cash_confirmed:3,final_approved:4,preparing:4,ready_to_ship:4,shipped:5,delivered:6,expired:2,cancelled:0,rejected:1},w={registered:[`submitted`],priced:[`pricing`,`awaiting_review`,`needs_correction`],proforma_sent:[`awaiting_settlement`,`awaiting_settlement_fix`,`cash_in_progress`,`cash_invoice_issued`,`awaiting_cash_payment`,`cash_payment_submitted`,`check_in_progress`],proforma_confirmed:[`awaiting_cash_confirmation`,`awaiting_check_review`,`check_needs_fix`,`check_rejected`,`checks_approved`,`cash_confirmed`],invoice_sent:[`final_approved`,`preparing`,`ready_to_ship`],shipped:[`shipped`],delivered:[`delivered`]};function T(e){return C[e]??0}function E(e){let t={};for(let n of S){if(n.id===`registered`){t[n.id]=h(e.createdAt);continue}let r=w[n.id]??[],i=[...e.statusHistory].reverse().find(e=>r.includes(e.toStatus));t[n.id]=i?h(i.changedAt):null}return t}var D={class:`page latest-status-page`},O={class:`page__scroll page__scroll--with-nav body`},k={class:`summary-card`},A={class:`summary-card__value`},j={key:0,class:`summary-card__meta`},M=f(s({__name:`LatestOrderStatusView`,setup(s){let f=d(),h=v(),C=_(),w=p(!0),M=m(()=>{let e=h.userOrders(C.user?.id??``);return e.length?e[0]:null}),N=m(()=>M.value?T(M.value.status):0),P=m(()=>M.value?E(M.value):{});r(async()=>{w.value=!0,await h.hydrate(),w.value=!1});function F(){f.push(`/categories`)}return(r,s)=>(i(),o(`div`,D,[a(y,{class:`mobile-only`,title:`آخرین وضعیت سفارش`,"show-back":``,centered:``,onBack:s[0]||=e=>n(f).push(`/`)}),s[3]||=c(`header`,{class:`desktop-page__head desktop-only`},[c(`div`,null,[c(`h1`,{class:`desktop-page__title`},`آخرین وضعیت سفارش`),c(`p`,{class:`desktop-page__subtitle`},`پیگیری مراحل آخرین سفارش ثبتشده`)])],-1),c(`div`,O,[w.value?(i(),t(b,{key:0})):M.value?(i(),o(u,{key:1},[c(`article`,k,[s[2]||=c(`p`,{class:`summary-card__label`},`سفارش شماره`,-1),c(`strong`,A,l(M.value.orderNumber),1),M.value.finalAmount?(i(),o(`p`,j,l(n(g)(M.value.finalAmount)),1)):e(``,!0)]),a(x,{steps:n(S),"current-index":N.value,timestamps:P.value},null,8,[`steps`,`current-index`,`timestamps`]),c(`button`,{type:`button`,class:`detail-link`,onClick:s[1]||=e=>n(f).push(`/orders/${M.value.id}`)},` مشاهده جزئیات سفارش `)],64)):(i(),o(`button`,{key:2,type:`button`,class:`empty-cta`,onClick:F},` سفارشی ثبت نکرده اید. لطفا جهت مشاهده محصولات کلیک کنید `))])]))}}),[[`__scopeId`,`data-v-030bc575`]]);export{M as default};
|
||||
Reference in New Issue
Block a user