xy 1 year ago
parent 2445aed80d
commit 754c6dc3f5

@ -97,6 +97,7 @@ export default {
page: 1, page: 1,
page_size: 10 page_size: 10
}, },
timer: null,
tableHeight: 120, tableHeight: 120,
loading: false, loading: false,
list: [], list: [],
@ -132,18 +133,21 @@ export default {
} }
}, },
created() { created() {
this.getNotices() this.getNotices(true)
setInterval(this.getNotices, 5000)
},
beforeDestroy() {
clearInterval(this.timer)
}, },
mounted() { mounted() {
this.init() this.init()
}, },
methods: { methods: {
test() { async getNotices(loading=false) {
console.log(this.list.abc.ddd)
},
async getNotices() {
try { try {
this.loading = true if (loading) {
this.loading = true
}
const res = await axios.get(`${process.env.VUE_APP_BASE_API}/api/notification/todo`, { const res = await axios.get(`${process.env.VUE_APP_BASE_API}/api/notification/todo`, {
headers: { headers: {
'Authorization': `Bearer ${getToken()}` 'Authorization': `Bearer ${getToken()}`

Loading…
Cancel
Save