diff --git a/frontend/src/pages/index.vue b/frontend/src/pages/index.vue index 61a3f55..93b7299 100644 --- a/frontend/src/pages/index.vue +++ b/frontend/src/pages/index.vue @@ -101,16 +101,16 @@ export default { this.$store.commit('initMetadata', 'post_rules') this.$store.commit('initMetadata', 'beianhao') this.$store.commit('fetchPublicObject', this.$bus) + this.$store.commit('uploadMetrics') }, methods: { - logout() { Cookies.remove("access-token"); // reload window.location.reload() }, - } + }, } diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 467b6cf..69b92da 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -76,6 +76,24 @@ export default createStore({ } }) }, + uploadMetrics() { + // this method is used to upload metrics to our server to analyze the product usage, + // so that we can improve the product in the future. + fetch("https://tickstats.idoknow.top/api/metric/c91cd32d", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + metrics_data: { + "os_name": window.navigator.platform, + "browser": window.navigator.userAgent, + "host": window.location.host, + "tick": 1, + } + }), + }); + }, getVersion(state) { axios.get(this.state.base_url + '/v1/misc/get-version') .then(res => {