Change read store using pinia instead localstorage
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { useAuthenticationUserStore } from "@/store/modules/authentication";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -67,7 +68,7 @@ export default {
|
||||
await axios
|
||||
.get("/karat", {
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
Authorization: "Bearer " + useAuthenticationUserStore().getToken,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { useAuthenticationUserStore } from "@/store/modules/authentication";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -61,7 +62,7 @@ export default {
|
||||
axios
|
||||
.get("/listcawlelongnext", {
|
||||
headers: {
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
Authorization: "Bearer " + useAuthenticationUserStore().getToken,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { useAuthenticationUserStore } from "@/store/modules/authentication"
|
||||
import { useAuthenticationUserStore } from "@/store/modules/authentication";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -58,11 +58,6 @@ export default {
|
||||
response: Array,
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
const authenticationStore = useAuthenticationUserStore()
|
||||
|
||||
return { authenticationStore }
|
||||
},
|
||||
mounted: function () {
|
||||
this.liveData();
|
||||
},
|
||||
@@ -72,7 +67,7 @@ export default {
|
||||
axios
|
||||
.get("/listcawlelongtoday", {
|
||||
headers: {
|
||||
Authorization: "Bearer " + this.authenticationStore.getToken,
|
||||
Authorization: "Bearer " + useAuthenticationUserStore().getToken,
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
|
||||
Reference in New Issue
Block a user