Enhance deployment process: Add cleanup steps for frontend artifacts in deploy.sh to ensure a clean build environment. Update axios.js to improve token handling and response error management, ensuring proper logout flow. Update index.html with new asset references for improved caching.
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 7s
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 7s
This commit is contained in:
@@ -34,6 +34,11 @@ if ! ensure_command npm; then err "npm not found in PATH"; exit 127; fi
|
||||
log "Fetching latest changes..."
|
||||
git fetch --all --prune || { err "git fetch failed"; exit 1; }
|
||||
|
||||
log "Cleaning generated frontend artifacts..."
|
||||
git restore -- package-lock.json package.json 2>/dev/null || true
|
||||
git restore -- public/index.html 2>/dev/null || true
|
||||
git clean -fd -- dist public/assets || { err "cleanup failed"; exit 1; }
|
||||
|
||||
log "Pulling latest changes..."
|
||||
git pull --ff-only || { err "git pull failed"; exit 1; }
|
||||
|
||||
|
||||
2
public/assets/AddImageDialog-BE6qqLwu.js
Normal file
2
public/assets/AddImageDialog-BE6qqLwu.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{E as e,L as t,c as n,ct as r,d as i,i as a,ot as o,t as s,u as c,w as l}from"./_plugin-vue_export-helper-Conii5fq.js";import{r as u}from"./router-BaWViAU8.js";var d={name:`AddImageDialog`,emits:[`confirm`],setup(e,{emit:n}){let r=t(!1),i=t([]),a=t(null),o=()=>{r.value=!0,l()},s=()=>{r.value=!1},c=()=>{a.value&&n(`confirm`,`${a.value.id}`),s()},l=async()=>{try{i.value=(await u.get(`/image`)).data}catch(e){console.error(`Fehler beim Laden der Bilder:`,e),i.value=[]}};return{isOpen:r,images:i,selectedImage:a,openAddImageDialog:o,closeAddImageDialog:s,confirmAddImageConfiguration:c,selectImage:e=>{console.log(e),a.value=e}}}},f={key:0,class:`dialog-overlay`},p={class:`dialog-content`},m={class:`images-container`},h=[`onClick`],g=[`src`],_=[`title`],v={key:1},y={class:`button-container`};function b(t,s,u,d,b,x){return l(),i(`div`,null,[d.isOpen?(l(),i(`div`,f,[n(`div`,p,[s[2]||=n(`h3`,null,`Bild auswählen`,-1),n(`div`,m,[(l(!0),i(a,null,e(d.images,e=>(l(),i(`div`,{key:e.id,class:o([`image-block`,{selected:e.id===d.selectedImage?.id}]),onClick:t=>d.selectImage(e)},[n(`img`,{src:`/images/uploads/`+e.filename},null,8,g),e.description?(l(),i(`span`,{key:0,title:e.description},r(e.title),9,_)):(l(),i(`span`,v,r(e.title),1))],10,h))),128))]),n(`div`,y,[n(`button`,{onClick:s[0]||=(...e)=>d.confirmAddImageConfiguration&&d.confirmAddImageConfiguration(...e)},`Bestätigen`),n(`button`,{onClick:s[1]||=(...e)=>d.closeAddImageDialog&&d.closeAddImageDialog(...e)},`Schließen`)])])])):c(``,!0)])}var x=s(d,[[`render`,b],[`__scopeId`,`data-v-32c70499`]]);export{x as t};
|
||||
//# sourceMappingURL=AddImageDialog-BE6qqLwu.js.map
|
||||
2
public/assets/ContentComponent-C9mNGlEe.js
Normal file
2
public/assets/ContentComponent-C9mNGlEe.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{O as e,c as t,ct as n,d as r,h as i,t as a,w as o}from"./_plugin-vue_export-helper-Conii5fq.js";import{i as s,r as c}from"./vuex.esm-bundler-CDO_-3pz.js";import{r as l}from"./router-BaWViAU8.js";import{t as u}from"./RenderContentComponent-CJsUla2P.js";var d={name:`ContentComponent`,components:{RenderContentComponent:u},props:{link:{type:String,required:!0}},data(){return{content:``,title:``}},computed:{...s([`menuData`]),...c([`getMenuData`])},watch:{link:{immediate:!0,handler(e){this.fetchContent(e),this.setTitle(e)}}},methods:{async fetchContent(e){try{this.content=(await l.get(`/page-content?link=${e}`)).data.content}catch(e){console.error(`Fehler beim Abrufen des Inhalts:`,e)}},setTitle(e){let t=(e,n)=>{for(let r of e){if(r.link===n)return r.pageTitle||r.name;if(r.submenu&&r.submenu.length>0){let e=t(r.submenu,n);if(e)return`${e}`}}return``};this.title=t(this.menuData,e)}}};function f(a,s,c,l,u,d){let f=e(`RenderContentComponent`);return o(),r(`div`,null,[t(`h1`,null,n(u.title),1),i(f,{content:u.content},null,8,[`content`])])}var p=a(d,[[`render`,f]]);export{p as t};
|
||||
//# sourceMappingURL=ContentComponent-C9mNGlEe.js.map
|
||||
2
public/assets/DefaultComponent-Cs-hJJWs.js
Normal file
2
public/assets/DefaultComponent-Cs-hJJWs.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{O as e,c as t,d as n,l as r,t as i,w as a}from"./_plugin-vue_export-helper-Conii5fq.js";import{i as o}from"./vuex.esm-bundler-CDO_-3pz.js";import{t as s}from"./ContentComponent-C9mNGlEe.js";function c(e){if(!e||typeof e!=`string`)return`/`;let t=e.trim();return t.startsWith(`/`)||(t=`/${t}`),t.length>1&&(t=t.replace(/\/+$/,``)),t||`/`}function l(e,t){let n=c(t);for(let t of e||[])if(c(t?.link||``)===n||Array.isArray(t?.submenu)&&l(t.submenu,n))return!0;return!1}var u={name:`DefaultComponent`,components:{ContentComponent:s},computed:{...o([`menuData`]),normalizedPath(){return c(this.$route.path)},isKnownMenuPath(){return l(this.menuData,this.normalizedPath)}}},d={key:1,class:`not-found`};function f(i,o,s,c,l,u){let f=e(`ContentComponent`);return a(),n(`div`,null,[u.isKnownMenuPath?(a(),r(f,{key:0,link:u.normalizedPath},null,8,[`link`])):(a(),n(`div`,d,[...o[0]||=[t(`h1`,null,`Seite existiert nicht`,-1),t(`p`,null,`Leider existiert die aufgerufene Seite nicht.`,-1)]]))])}var p=i(u,[[`render`,f],[`__scopeId`,`data-v-988aab8e`]]);export{p as default};
|
||||
//# sourceMappingURL=DefaultComponent-Cs-hJJWs.js.map
|
||||
2
public/assets/DefaultContent-CcQvZpZr.js
Normal file
2
public/assets/DefaultContent-CcQvZpZr.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{O as e,d as t,h as n,t as r,w as i}from"./_plugin-vue_export-helper-Conii5fq.js";import{t as a}from"./ContentComponent-C9mNGlEe.js";var o={name:`DefaultPage`,components:{ContentComponent:a},computed:{currentLink(){return this.$route.path}}},s={class:`some-page`};function c(r,a,o,c,l,u){let d=e(`ContentComponent`);return i(),t(`div`,s,[n(d,{link:u.currentLink},null,8,[`link`])])}var l=r(o,[[`render`,c]]);export{l as default};
|
||||
//# sourceMappingURL=DefaultContent-CcQvZpZr.js.map
|
||||
147
public/assets/EditPagesComponent-94eD8cX3.js
Normal file
147
public/assets/EditPagesComponent-94eD8cX3.js
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/EventManagement-FXNjNZNW.js
Normal file
2
public/assets/EventManagement-FXNjNZNW.js
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/ForgotPasswordContent-CPljuYy4.js
Normal file
2
public/assets/ForgotPasswordContent-CPljuYy4.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{M as e,O as t,c as n,ct as r,d as i,h as a,j as o,m as s,t as c,u as l,w as u}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as d,c as f}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{r as p}from"./router-BaWViAU8.js";var m={name:`ForgotPassword`,data(){return{email:``,dialogTitle:``,dialogMessage:``,dialogVisible:!1}},methods:{async submitForgotPassword(){try{let e=await p.post(`/auth/forgot-password`,{email:this.email});this.showDialog(`E-Mail gesendet`,e.data?.message||`Ein Link zum Zurücksetzen wurde an Ihre E-Mail-Adresse gesendet.`),this.email=``}catch(e){let t=e?.response?.data?.message||e?.message||`Ein unbekannter Fehler ist aufgetreten`;this.showDialog(`Fehler`,t)}},showDialog(e,t){this.dialogTitle=e,this.dialogMessage=t,this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1}}},h={class:`forgot-password`},g={key:0,class:`dialog`},_={class:`dialog-content`};function v(c,p,m,v,y,b){let x=t(`router-link`);return u(),i(`div`,h,[p[7]||=n(`h2`,null,`Passwort vergessen`,-1),n(`form`,{onSubmit:p[1]||=f((...e)=>b.submitForgotPassword&&b.submitForgotPassword(...e),[`prevent`])},[p[3]||=n(`label`,{for:`email`},`Email-Adresse:`,-1),e(n(`input`,{type:`email`,id:`email`,"onUpdate:modelValue":p[0]||=e=>y.email=e,required:``},null,512),[[d,y.email]]),p[4]||=n(`button`,{type:`submit`},`Link zum Zurücksetzen senden`,-1)],32),n(`p`,null,[a(x,{to:`/login`},{default:o(()=>[...p[5]||=[s(`Login`,-1)]]),_:1})]),n(`p`,null,[a(x,{to:`/register`},{default:o(()=>[...p[6]||=[s(`Registrieren`,-1)]]),_:1})]),y.dialogVisible?(u(),i(`div`,g,[n(`div`,_,[n(`h3`,null,r(y.dialogTitle),1),n(`p`,null,r(y.dialogMessage),1),n(`button`,{type:`button`,onClick:p[2]||=(...e)=>b.closeDialog&&b.closeDialog(...e)},`Schließen`)])])):l(``,!0)])}var y=c(m,[[`render`,v],[`__scopeId`,`data-v-021070f7`]]);export{y as default};
|
||||
//# sourceMappingURL=ForgotPasswordContent-CPljuYy4.js.map
|
||||
2
public/assets/ImageUpload-BsTr2jHm.js
Normal file
2
public/assets/ImageUpload-BsTr2jHm.js
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/IndexContent-2n0orL-7.js
Normal file
2
public/assets/IndexContent-2n0orL-7.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{C as e,E as t,L as n,O as r,c as i,ct as a,d as o,h as s,i as c,j as l,m as u,t as d,w as f}from"./_plugin-vue_export-helper-Conii5fq.js";import{r as p}from"./router-BaWViAU8.js";var m={name:`DefaultComponent`,setup(){let t=n([]),r=async()=>{try{let e=(await p.get(`/menu-data`)).data.find(e=>e.name===`Admin`);e&&(t.value=e.submenu)}catch(e){console.error(`Fehler beim Abrufen der Menü-Daten:`,e)}};return e(()=>{r()}),{adminSubmenu:t}}};function h(e,n,d,p,m,h){let g=r(`router-link`);return f(),o(`div`,null,[n[0]||=i(`h1`,null,`Seitenpflege`,-1),n[1]||=i(`p`,null,`Herzlich Willkommen. Auf diesen Seiten können Sie die Inhalte der Webseiten pflegen.`,-1),i(`ul`,null,[(f(!0),o(c,null,t(p.adminSubmenu,e=>(f(),o(`li`,{key:e.id},[s(g,{to:e.link},{default:l(()=>[u(a(e.name),1)]),_:2},1032,[`to`])]))),128))])])}var g=d(m,[[`render`,h],[`__scopeId`,`data-v-3f6c9349`]]);export{g as default};
|
||||
//# sourceMappingURL=IndexContent-2n0orL-7.js.map
|
||||
2
public/assets/LoginContent-BSaL4pAW.js
Normal file
2
public/assets/LoginContent-BSaL4pAW.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{M as e,O as t,c as n,ct as r,d as i,h as a,j as o,m as s,t as c,u as l,w as u}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as d,c as f}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{n as p}from"./vuex.esm-bundler-CDO_-3pz.js";import{r as m}from"./router-BaWViAU8.js";var h={name:`DialogComponent`,props:{title:{type:String,required:!0},message:{type:String,required:!0},modelValue:{type:Boolean,default:!1}},methods:{closeDialog(){this.$emit(`update:modelValue`,!1),this.$emit(`close`)}}},g={key:0,class:`dialog-overlay`},_={class:`dialog`};function v(e,t,a,o,s,c){return a.modelValue?(u(),i(`div`,g,[n(`div`,_,[n(`h2`,null,r(a.title),1),n(`p`,null,r(a.message),1),n(`button`,{onClick:t[0]||=(...e)=>c.closeDialog&&c.closeDialog(...e)},`OK`)])])):l(``,!0)}var y={name:`LoginComponent`,components:{DialogComponent:c(h,[[`render`,v],[`__scopeId`,`data-v-7743bdb5`]])},data(){return{email:``,password:``,dialogTitle:``,dialogMessage:``,dialogVisible:!1}},methods:{...p([`login`]),async runLogin(){try{let e=await m.post(`/auth/login`,{email:this.email,password:this.password}),t=e.data.token,n=e.data.user;this.login({user:n,token:t}),m.defaults.headers.common.Authorization=`Bearer ${t}`,this.$router.push(`/admin/index`)}catch(e){e.response?this.showDialog(`Fehler`,e.response.data.message):this.showDialog(`Ein Fehler ist aufgetreten`,e.message)}},showDialog(e,t){this.dialogTitle=e,this.dialogMessage=t,this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1}}},b={class:`login`};function x(r,c,l,p,m,h){let g=t(`router-link`),_=t(`DialogComponent`);return u(),i(`div`,b,[c[9]||=n(`h2`,null,`Login`,-1),n(`form`,{onSubmit:c[2]||=f((...e)=>h.runLogin&&h.runLogin(...e),[`prevent`])},[c[4]||=n(`label`,{for:`email`},`Email-Adresse:`,-1),e(n(`input`,{type:`email`,id:`email`,"onUpdate:modelValue":c[0]||=e=>m.email=e,required:``},null,512),[[d,m.email]]),c[5]||=n(`label`,{for:`password`},`Passwort:`,-1),e(n(`input`,{type:`password`,id:`password`,"onUpdate:modelValue":c[1]||=e=>m.password=e,required:``},null,512),[[d,m.password]]),c[6]||=n(`button`,{type:`submit`},`Login`,-1)],32),n(`p`,null,[a(g,{to:`/register`},{default:o(()=>[...c[7]||=[s(`Registrieren`,-1)]]),_:1})]),n(`p`,null,[a(g,{to:`/forgot-password`},{default:o(()=>[...c[8]||=[s(`Passwort vergessen?`,-1)]]),_:1})]),a(_,{title:m.dialogTitle,message:m.dialogMessage,modelValue:m.dialogVisible,"onUpdate:modelValue":c[3]||=e=>m.dialogVisible=e,onClose:h.closeDialog},null,8,[`title`,`message`,`modelValue`,`onClose`])])}var S=c(y,[[`render`,x],[`__scopeId`,`data-v-1f68aa6b`]]);export{S as default};
|
||||
//# sourceMappingURL=LoginContent-BSaL4pAW.js.map
|
||||
2
public/assets/MenuManagement-D5Hpip4o.js
Normal file
2
public/assets/MenuManagement-D5Hpip4o.js
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/NewsletterImportManagement-CVDnikRG.js
Normal file
2
public/assets/NewsletterImportManagement-CVDnikRG.js
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/PagePreviewComponent-CqzvKVKo.js
Normal file
2
public/assets/PagePreviewComponent-CqzvKVKo.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{A as e,O as t,c as n,ct as r,d as i,h as a,s as o,t as s,w as c}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as l}from"./vuex.esm-bundler-CDO_-3pz.js";import{t as u}from"./RenderContentComponent-CJsUla2P.js";var d={name:`PagePreview`,components:{RenderContentComponent:u},setup(){let t=l(),n=o(()=>t.state.pageContent),r=o(()=>t.state.selectedPage),i=o(()=>t.state.menuData),a=o(()=>t.state.pageTitle),s=e=>{let n=(e,t)=>{for(let r of e){if(r.link===t)return r.pageTitle||r.name;if(r.submenu&&r.submenu.length>0){let e=n(r.submenu,t);if(e)return e}}return``};t.dispatch(`setPageTitle`,n(i.value,e))};return e(()=>{s(r.value)}),{content:n,title:a}}};function f(e,o,s,l,u,d){let f=t(`RenderContentComponent`);return c(),i(`div`,null,[o[0]||=n(`div`,{class:`previewinfo`},`Dies ist eine Vorschau.`,-1),n(`h1`,null,r(l.title),1),a(f,{content:l.content},null,8,[`content`])])}var p=s(d,[[`render`,f],[`__scopeId`,`data-v-e0906dd8`]]);export{p as default};
|
||||
//# sourceMappingURL=PagePreviewComponent-CqzvKVKo.js.map
|
||||
2
public/assets/RegisterContent-nnbko0P0.js
Normal file
2
public/assets/RegisterContent-nnbko0P0.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{M as e,O as t,c as n,ct as r,d as i,h as a,j as o,m as s,t as c,u as l,w as u}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as d,c as f}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{r as p}from"./router-BaWViAU8.js";var m={name:`RegisterComponent`,components:{},data(){return{name:``,email:``,password:``,dialogTitle:``,dialogMessage:``,dialogVisible:!1}},methods:{async register(){try{let e=await p.post(`/auth/register`,{name:this.name,email:this.email,password:this.password});this.showDialog(`Registrierung erfolgreich`,e.data?.message||`Ihr Konto wurde erfolgreich erstellt.`),this.name=``,this.email=``,this.password=``}catch(e){let t=e?.response?.data?.message||e?.message||`Ein unbekannter Fehler ist aufgetreten`;this.showDialog(`Fehler`,t)}},showDialog(e,t){this.dialogTitle=e,this.dialogMessage=t,this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1}}},h={class:`register`},g={key:0,class:`dialog`},_={class:`dialog-content`};function v(c,p,m,v,y,b){let x=t(`router-link`);return u(),i(`div`,h,[p[11]||=n(`h2`,null,`Registrieren`,-1),n(`form`,{onSubmit:p[3]||=f((...e)=>b.register&&b.register(...e),[`prevent`])},[p[5]||=n(`label`,{for:`name`},`Name:`,-1),e(n(`input`,{type:`text`,id:`name`,"onUpdate:modelValue":p[0]||=e=>y.name=e,required:``},null,512),[[d,y.name]]),p[6]||=n(`label`,{for:`email`},`Email-Adresse:`,-1),e(n(`input`,{type:`email`,id:`email`,"onUpdate:modelValue":p[1]||=e=>y.email=e,required:``},null,512),[[d,y.email]]),p[7]||=n(`label`,{for:`password`},`Passwort:`,-1),e(n(`input`,{type:`password`,id:`password`,"onUpdate:modelValue":p[2]||=e=>y.password=e,required:``},null,512),[[d,y.password]]),p[8]||=n(`button`,{type:`submit`},`Registrieren`,-1)],32),n(`p`,null,[a(x,{to:`/login`},{default:o(()=>[...p[9]||=[s(`Login`,-1)]]),_:1})]),n(`p`,null,[a(x,{to:`/forgot-password`},{default:o(()=>[...p[10]||=[s(`Passwort vergessen?`,-1)]]),_:1})]),y.dialogVisible?(u(),i(`div`,g,[n(`div`,_,[n(`h3`,null,r(y.dialogTitle),1),n(`p`,null,r(y.dialogMessage),1),n(`button`,{type:`button`,onClick:p[4]||=(...e)=>b.closeDialog&&b.closeDialog(...e)},`Schließen`)])])):l(``,!0)])}var y=c(m,[[`render`,v],[`__scopeId`,`data-v-70d90412`]]);export{y as default};
|
||||
//# sourceMappingURL=RegisterContent-nnbko0P0.js.map
|
||||
2
public/assets/RenderContentComponent-CJsUla2P.js
Normal file
2
public/assets/RenderContentComponent-CJsUla2P.js
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/ResetPasswordContent-CXZ7K3S8.js
Normal file
2
public/assets/ResetPasswordContent-CXZ7K3S8.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{M as e,O as t,c as n,ct as r,d as i,h as a,j as o,m as s,t as c,u as l,w as u}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as d,c as f}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{r as p}from"./router-BaWViAU8.js";var m={name:`ResetPasswordComponent`,data(){return{password:``,confirmPassword:``,token:``,dialogTitle:``,dialogMessage:``,dialogVisible:!1}},computed:{isFormValid(){return this.password.length>=6&&this.password===this.confirmPassword&&this.token}},mounted(){this.token=new URLSearchParams(window.location.search).get(`token`),this.token||this.showDialog(`Fehler`,`Ungültiger Reset-Link. Bitte fordern Sie einen neuen Link an.`)},methods:{async submitResetPassword(){if(this.password!==this.confirmPassword){this.showDialog(`Fehler`,`Die Passwörter stimmen nicht überein.`);return}try{let e=await p.post(`/auth/reset-password`,{token:this.token,password:this.password});this.showDialog(`Erfolg`,e.data?.message||`Passwort erfolgreich zurückgesetzt. Sie können sich jetzt anmelden.`),this.password=``,this.confirmPassword=``,setTimeout(()=>{this.$router.push(`/auth/login`)},3e3)}catch(e){let t=e?.response?.data?.message||e?.message||`Ein unbekannter Fehler ist aufgetreten`;this.showDialog(`Fehler`,t)}},showDialog(e,t){this.dialogTitle=e,this.dialogMessage=t,this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1}}},h={class:`reset-password`},g=[`disabled`],_={key:0,class:`dialog`},v={class:`dialog-content`};function y(c,p,m,y,b,x){let S=t(`router-link`);return u(),i(`div`,h,[p[7]||=n(`h2`,null,`Neues Passwort setzen`,-1),n(`form`,{onSubmit:p[2]||=f((...e)=>x.submitResetPassword&&x.submitResetPassword(...e),[`prevent`])},[p[4]||=n(`label`,{for:`password`},`Neues Passwort:`,-1),e(n(`input`,{type:`password`,id:`password`,"onUpdate:modelValue":p[0]||=e=>b.password=e,required:``,minlength:`6`},null,512),[[d,b.password]]),p[5]||=n(`label`,{for:`confirmPassword`},`Passwort bestätigen:`,-1),e(n(`input`,{type:`password`,id:`confirmPassword`,"onUpdate:modelValue":p[1]||=e=>b.confirmPassword=e,required:``,minlength:`6`},null,512),[[d,b.confirmPassword]]),n(`button`,{type:`submit`,disabled:!x.isFormValid},`Passwort zurücksetzen`,8,g)],32),n(`p`,null,[a(S,{to:`/login`},{default:o(()=>[...p[6]||=[s(`Zurück zum Login`,-1)]]),_:1})]),b.dialogVisible?(u(),i(`div`,_,[n(`div`,v,[n(`h3`,null,r(b.dialogTitle),1),n(`p`,null,r(b.dialogMessage),1),n(`button`,{type:`button`,onClick:p[3]||=(...e)=>x.closeDialog&&x.closeDialog(...e)},`Schließen`)])])):l(``,!0)])}var b=c(m,[[`render`,y],[`__scopeId`,`data-v-3a4e9538`]]);export{b as default};
|
||||
//# sourceMappingURL=ResetPasswordContent-CXZ7K3S8.js.map
|
||||
2
public/assets/UploadFileManagement-Cpuc4NQI.js
Normal file
2
public/assets/UploadFileManagement-Cpuc4NQI.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{C as e,E as t,L as n,M as r,c as i,ct as a,d as o,i as s,t as c,w as l}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as u}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{r as d}from"./router-BaWViAU8.js";var f={name:`UploadFilesComponent`,setup(){let t=n(null),r=n(``),i=n([]);return e(async()=>{try{i.value=(await d.get(`/files`)).data}catch(e){console.error(`Fehler beim Abrufen der Dateien:`,e)}}),{fileToUpload:t,fileTitle:r,uploadedFiles:i,handleFileUpload:e=>{t.value=e.target.files[0]},uploadFiles:async()=>{if(!t.value||!r.value){alert(`Bitte wählen Sie eine Datei aus und geben Sie einen Titel ein.`);return}let e=new FormData;e.append(`file`,t.value),e.append(`title`,r.value);try{let n=(await d.post(`/files`,e,{headers:{"Content-Type":`multipart/form-data`}})).data;i.value.push({id:n.id,title:n.title,originalName:n.originalName,createdAt:n.createdAt,hash:n.hash}),t.value=null,r.value=``}catch(e){console.error(`Fehler beim Hochladen der Datei:`,e)}},downloadFile:async e=>{let t=e.originalName.substring(e.originalName.lastIndexOf(`.`)),n=await d.get(`/files/download/${e.hash}`,{responseType:`blob`}),r=new Blob([n.data],{type:n.data.type}),i=document.createElement(`a`);i.href=window.URL.createObjectURL(r),i.download=`${e.title}${t}`,i.click(),window.URL.revokeObjectURL(i.href)},formatDate:e=>new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}}},p={class:`upload-files`},m={class:`file-list`},h={class:`file-info`},g=[`onClick`],_=[`onClick`],v={class:`file-date`};function y(e,n,c,d,f,y){return l(),o(`div`,p,[n[5]||=i(`h2`,null,`Dateien hochladen`,-1),i(`div`,null,[n[3]||=i(`label`,{for:`file-upload`},`Datei auswählen:`,-1),i(`input`,{id:`file-upload`,type:`file`,onChange:n[0]||=(...e)=>d.handleFileUpload&&d.handleFileUpload(...e)},null,32)]),i(`div`,null,[n[4]||=i(`label`,{for:`file-title`},`Titel eingeben:`,-1),r(i(`input`,{id:`file-title`,type:`text`,"onUpdate:modelValue":n[1]||=e=>d.fileTitle=e},null,512),[[u,d.fileTitle]])]),i(`button`,{onClick:n[2]||=(...e)=>d.uploadFiles&&d.uploadFiles(...e)},`Hochladen`),i(`ul`,m,[(l(!0),o(s,null,t(d.uploadedFiles,e=>(l(),o(`li`,{key:e.id},[i(`div`,h,[i(`span`,{class:`file-title`,onClick:t=>d.downloadFile(e)},a(e.title),9,g),i(`span`,{class:`file-name`,onClick:t=>d.downloadFile(e)},a(e.originalName),9,_),i(`span`,v,a(d.formatDate(e.createdAt)),1)])]))),128))])])}var b=c(f,[[`render`,y],[`__scopeId`,`data-v-8ac38dc3`]]);export{b as default};
|
||||
//# sourceMappingURL=UploadFileManagement-Cpuc4NQI.js.map
|
||||
2
public/assets/UserAdministration-DDmZnEoo.js
Normal file
2
public/assets/UserAdministration-DDmZnEoo.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{E as e,M as t,c as n,ct as r,d as i,i as a,t as o,u as s,w as c}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as l,c as u,r as d}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{r as f}from"./router-BaWViAU8.js";var p={name:`UserAdministration`,data(){return{users:[],currentUser:{name:``,email:``,password:``,active:!1},isCreating:!0}},computed:{formTitle(){return this.isCreating?`Benutzer erstellen`:`Benutzer bearbeiten`}},methods:{async fetchUsers(){try{this.users=(await f.get(`/users`)).data}catch(e){console.error(`Fehler beim Abrufen der Benutzer:`,e)}},async saveUser(){this.isCreating?await this.createUser():await this.updateUser(),this.resetForm(),this.fetchUsers()},async createUser(){try{await f.post(`/users`,this.currentUser)}catch(e){console.error(`Fehler beim Erstellen des Benutzers:`,e)}},async updateUser(){try{await f.put(`/users/${this.currentUser.id}`,this.currentUser)}catch(e){console.error(`Fehler beim Aktualisieren des Benutzers:`,e)}},editUser(e){this.currentUser={...e,password:``},this.isCreating=!1},resetForm(){this.currentUser={name:``,email:``,password:``,active:!1},this.isCreating=!0}},mounted(){this.fetchUsers()}},m={class:`user-administration`},h=[`required`],g={type:`submit`},_={key:1},v=[`onClick`];function y(o,f,p,y,b,x){return c(),i(`div`,m,[f[11]||=n(`h1`,null,`Benutzerverwaltung`,-1),n(`h2`,null,r(x.formTitle),1),n(`form`,{onSubmit:f[4]||=u((...e)=>x.saveUser&&x.saveUser(...e),[`prevent`])},[f[7]||=n(`label`,{for:`name`},`Name:`,-1),t(n(`input`,{id:`name`,"onUpdate:modelValue":f[0]||=e=>b.currentUser.name=e,required:``},null,512),[[l,b.currentUser.name]]),f[8]||=n(`label`,{for:`email`},`Email:`,-1),t(n(`input`,{id:`email`,"onUpdate:modelValue":f[1]||=e=>b.currentUser.email=e,type:`email`,required:``},null,512),[[l,b.currentUser.email]]),f[9]||=n(`label`,{for:`password`},`Passwort:`,-1),t(n(`input`,{id:`password`,"onUpdate:modelValue":f[2]||=e=>b.currentUser.password=e,type:`password`,required:b.isCreating},null,8,h),[[l,b.currentUser.password]]),n(`div`,null,[f[6]||=n(`label`,{for:`active`},`Aktiv:`,-1),t(n(`input`,{id:`active`,"onUpdate:modelValue":f[3]||=e=>b.currentUser.active=e,type:`checkbox`},null,512),[[d,b.currentUser.active]])]),n(`button`,g,r(b.isCreating?`Erstellen`:`Aktualisieren`),1)],32),b.isCreating?s(``,!0):(c(),i(`button`,{key:0,onClick:f[5]||=(...e)=>x.resetForm&&x.resetForm(...e)},`Zurück zu Benutzer erstellen`)),b.users.length?(c(),i(`div`,_,[f[10]||=n(`h2`,null,`Vorhandene Benutzer`,-1),n(`ul`,null,[(c(!0),i(a,null,e(b.users,e=>(c(),i(`li`,{key:e.id,onClick:t=>x.editUser(e)},r(e.name)+` (`+r(e.email)+`) `,9,v))),128))])])):s(``,!0)])}var b=o(p,[[`render`,y],[`__scopeId`,`data-v-b4cc64c6`]]);export{b as default};
|
||||
//# sourceMappingURL=UserAdministration-DDmZnEoo.js.map
|
||||
2
public/assets/WorshipLeaderAdministration-DXvAwkTa.js
Normal file
2
public/assets/WorshipLeaderAdministration-DXvAwkTa.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import{E as e,M as t,c as n,ct as r,d as i,i as a,m as o,t as s,u as c,w as l}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as u,c as d,r as f}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{r as p}from"./router-BaWViAU8.js";var m={name:`WorshipLeaderAdministration`,data(){return{leaders:[],includeInactive:!1,currentLeader:{code:``,name:``,aliases:``,active:!0},isCreating:!0}},computed:{formTitle(){return this.isCreating?`Kürzel anlegen`:`Kürzel bearbeiten`}},methods:{async fetchLeaders(){try{this.leaders=(await p.get(`/worship-leaders`,{params:{includeInactive:+!!this.includeInactive}})).data||[]}catch(e){console.error(`Fehler beim Abrufen der Kürzel:`,e)}},async saveLeader(){try{this.isCreating?await p.post(`/worship-leaders`,this.currentLeader):await p.put(`/worship-leaders/${this.currentLeader.id}`,this.currentLeader),this.resetForm(),await this.fetchLeaders()}catch(e){let t=e.response?.data?.message||e.message;alert(`Fehler: ${t}`)}},editLeader(e){this.currentLeader={...e},this.isCreating=!1},async deleteLeader(e){if(confirm(`Kürzel "${e.code}" wirklich löschen?`))try{await p.delete(`/worship-leaders/${e.id}`),await this.fetchLeaders()}catch(e){console.error(`Fehler beim Löschen:`,e)}},resetForm(){this.currentLeader={code:``,name:``,aliases:``,active:!0},this.isCreating=!0}},mounted(){this.fetchLeaders()}},h={class:`worship-leader-admin`},g={class:`row`},_={type:`submit`},v={class:`list`},y={class:`tools`},b={key:0},x=[`onClick`],S={key:0},C={key:1},w=[`onClick`],T={key:1};function E(s,p,m,E,D,O){return l(),i(`div`,h,[p[14]||=n(`h1`,null,`Gestalter (Kürzel)`,-1),n(`h2`,null,r(O.formTitle),1),n(`form`,{onSubmit:p[5]||=d((...e)=>O.saveLeader&&O.saveLeader(...e),[`prevent`])},[p[9]||=n(`label`,{for:`code`},`Kürzel (z.B. "Eif"):`,-1),t(n(`input`,{id:`code`,"onUpdate:modelValue":p[0]||=e=>D.currentLeader.code=e,required:``},null,512),[[u,D.currentLeader.code]]),p[10]||=n(`label`,{for:`name`},`Name (wird als Gestalter gespeichert):`,-1),t(n(`input`,{id:`name`,"onUpdate:modelValue":p[1]||=e=>D.currentLeader.name=e,required:``},null,512),[[u,D.currentLeader.name]]),p[11]||=n(`label`,{for:`aliases`},`Aliase (kommagetrennt):`,-1),t(n(`input`,{id:`aliases`,"onUpdate:modelValue":p[2]||=e=>D.currentLeader.aliases=e},null,512),[[u,D.currentLeader.aliases]]),n(`div`,g,[p[8]||=n(`label`,{for:`active`},`Aktiv:`,-1),t(n(`input`,{id:`active`,"onUpdate:modelValue":p[3]||=e=>D.currentLeader.active=e,type:`checkbox`},null,512),[[f,D.currentLeader.active]])]),n(`button`,_,r(D.isCreating?`Erstellen`:`Aktualisieren`),1),D.isCreating?c(``,!0):(l(),i(`button`,{key:0,type:`button`,onClick:p[4]||=(...e)=>O.resetForm&&O.resetForm(...e)},`Abbrechen`))],32),n(`div`,v,[p[13]||=n(`h2`,null,`Vorhandene Kürzel`,-1),n(`div`,y,[n(`label`,null,[t(n(`input`,{type:`checkbox`,"onUpdate:modelValue":p[6]||=e=>D.includeInactive=e,onChange:p[7]||=(...e)=>O.fetchLeaders&&O.fetchLeaders(...e)},null,544),[[f,D.includeInactive]]),p[12]||=o(` Inaktive anzeigen`,-1)])]),D.leaders.length?(l(),i(`ul`,b,[(l(!0),i(a,null,e(D.leaders,e=>(l(),i(`li`,{key:e.id,class:`item`},[n(`button`,{type:`button`,class:`link`,onClick:t=>O.editLeader(e)},[n(`strong`,null,r(e.code),1),o(` – `+r(e.name)+` `,1),e.aliases?(l(),i(`span`,S,` (`+r(e.aliases)+`)`,1)):c(``,!0),e.active?c(``,!0):(l(),i(`span`,C,` [inaktiv]`))],8,x),n(`button`,{type:`button`,class:`danger`,onClick:t=>O.deleteLeader(e)},`Löschen`,8,w)]))),128))])):(l(),i(`p`,T,`Keine Einträge.`))])])}var D=s(m,[[`render`,E],[`__scopeId`,`data-v-46ecca06`]]);export{D as default};
|
||||
//# sourceMappingURL=WorshipLeaderAdministration-DXvAwkTa.js.map
|
||||
2
public/assets/index-B9rR4tZ_.js
Normal file
2
public/assets/index-B9rR4tZ_.js
Normal file
File diff suppressed because one or more lines are too long
3
public/assets/router-BaWViAU8.js
Normal file
3
public/assets/router-BaWViAU8.js
Normal file
File diff suppressed because one or more lines are too long
@@ -5,11 +5,11 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<title>Miriamgemeinde</title>
|
||||
<script type="module" crossorigin src="/assets/index-Du6sfhKY.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-B9rR4tZ_.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-Conii5fq.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/axios-DHQprbt3.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/vuex.esm-bundler-CDO_-3pz.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/router-CLi6dkmN.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/router-BaWViAU8.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/runtime-dom.esm-bundler-CI28bPhn.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-FsAvsxvA.css">
|
||||
<link rel="stylesheet" crossorigin href="/assets/vue-multiselect-d_KC3g6j.css">
|
||||
|
||||
17
src/axios.js
17
src/axios.js
@@ -10,7 +10,7 @@ console.log('Axios baseURL:', axios.defaults.baseURL);
|
||||
|
||||
axios.interceptors.request.use(
|
||||
config => {
|
||||
const token = store.state.token;
|
||||
const token = store.state.token || localStorage.getItem('token');
|
||||
if (token) {
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
@@ -26,12 +26,15 @@ axios.interceptors.response.use(
|
||||
return response;
|
||||
},
|
||||
error => {
|
||||
if (error.response && error.response.status === 401) {
|
||||
store.dispatch('logout').then(() => {
|
||||
if (router.currentRoute.value.path !== '/auth/login') {
|
||||
router.replace('/auth/login');
|
||||
}
|
||||
});
|
||||
const requestUrl = error.config?.url || '';
|
||||
const isLoginRequest = requestUrl.includes('/auth/login');
|
||||
const isLogoutRequest = requestUrl.includes('/auth/logout');
|
||||
|
||||
if (error.response && error.response.status === 401 && !isLoginRequest && !isLogoutRequest) {
|
||||
store.commit('logout');
|
||||
if (router.currentRoute.value.path !== '/auth/login') {
|
||||
router.replace('/auth/login');
|
||||
}
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user