diff --git a/resources/js/show/config/urls.js b/resources/js/show/config/urls.js index 8efc0d69..00d317f6 100644 --- a/resources/js/show/config/urls.js +++ b/resources/js/show/config/urls.js @@ -4,7 +4,7 @@ const urls = { }, showItem: function(id) { // return `/ShowItem/${id}`; - return `/show-item/${id}`; + return `/api/show-item/${id}`; }, showPackage: function(id) { diff --git a/resources/js/show/router/paths.js b/resources/js/show/router/paths.js index f211f21b..27c9509b 100644 --- a/resources/js/show/router/paths.js +++ b/resources/js/show/router/paths.js @@ -5,37 +5,42 @@ */ export default [ - { - path: '/', - name: 'home', - view: 'Home/Intro', - // meta : { - // onlyWhenLoggedOut : true - // } - }, - { - path: '/Show/Item/:item', - name: 'ShowItem', - view: 'Item/ShowItem' - }, - { - path: '/Show/Package/:package', - name: 'ShowPackage', - view: 'Package/ShowPackage' - }, - { - path: '/Show/Label/:label', - name: 'ShowLabel', - view: 'Label/ShowLabel' - }, - { - path: '/Show/Cycle/:cycle', - name: 'ShowCycle', - view: 'Cycle/ShowCycle' - }, - { - path: '/Show/TestResult/:id', - name: 'ShowTestResult', - view: 'TestResult/ShowTestResult' - }, + { + path: '/', + name: 'home', + view: 'Home/Intro', + // meta : { + // onlyWhenLoggedOut : true + // } + }, + { + path: '/Show/Item/:item', + name: 'ShowItem', + view: 'Item/ShowItem', + meta: {public: true} + }, + { + path: '/Show/Package/:package', + name: 'ShowPackage', + view: 'Package/ShowPackage', + meta: { public: true } + }, + { + path: '/Show/Label/:label', + name: 'ShowLabel', + view: 'Label/ShowLabel', + meta: { public: true } + }, + { + path: '/Show/Cycle/:cycle', + name: 'ShowCycle', + view: 'Cycle/ShowCycle', + meta: { public: true } + }, + { + path: '/Show/TestResult/:id', + name: 'ShowTestResult', + view: 'TestResult/ShowTestResult', + meta: { public: true } + }, ] diff --git a/resources/js/show/views/Item/ShowItem.vue b/resources/js/show/views/Item/ShowItem.vue index b3750af9..bba9603e 100644 --- a/resources/js/show/views/Item/ShowItem.vue +++ b/resources/js/show/views/Item/ShowItem.vue @@ -113,8 +113,11 @@ export default { const result = await axios.get(urls.showItem(id)); if (result.status == 200) { this.data = result.data.data; - this.generateBarcode(this.data.id); - this.MedicalCenter = this.data.user.medical_center.name; + console.log(result,'result',result.data,result.data.data) + if(this.data){ + this.generateBarcode(this.data.id); + this.MedicalCenter = this.data.user.medical_center.name; + } } } catch (error) { console.error("Error loading data:", error); diff --git a/resources/js/show/views/Label/ShowLabel.vue b/resources/js/show/views/Label/ShowLabel.vue index fd334c7d..6b185db5 100644 --- a/resources/js/show/views/Label/ShowLabel.vue +++ b/resources/js/show/views/Label/ShowLabel.vue @@ -227,8 +227,8 @@ export default { } }, created() { + console.log(this.$route.params.label,'this.$route.params'); if (this.$route.params.label) { - console.log(this.$route.params); this.load(this.$route.params.label); } }, diff --git a/resources/js/show/views/Package/ShowPackage.vue b/resources/js/show/views/Package/ShowPackage.vue index 8d956829..82a7c47c 100644 --- a/resources/js/show/views/Package/ShowPackage.vue +++ b/resources/js/show/views/Package/ShowPackage.vue @@ -1,6 +1,6 @@