update:添加全校心率跳转

This commit is contained in:
ltx 2025-07-18 14:57:45 +08:00
parent 114e7c93ac
commit b3b8d74a8b
3 changed files with 38 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import viewgird from './viewGird'
import store from '../store/index'
import redirect from './redirect'
import charts from './charts'
import links from './outlink'
const routes = [{
path: '/',
name: 'index',
@ -22,6 +23,7 @@ const routes = [{
...viewgird,
...redirect,
...charts,
...links, //外链
// {
// path: '/home',
// name: 'home',

8
src/router/outlink.js Normal file
View File

@ -0,0 +1,8 @@
let links=[
{
path: '/heart',
name: 'heart',
component: () => import('@/views/outlink/heart/index.vue')
}]
export default links

View File

@ -0,0 +1,28 @@
<template>
<!-- 页面无内容自动跳转外部链接 -->
</template>
<script setup>
import { onMounted } from 'vue'
import { useRouter , useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
onMounted(() => {
let externalUrl = 'https://allheartrates.yuedongsports.com/#/auth/login?token=' //
if (process.env.NODE_ENV == 'development') {
externalUrl = 'http://localhost:5666/auth/login?token='
}else if(window.location.host == 'smartsports-qa.yuedongsports.com'){
externalUrl = 'https://allheartrates-qa.yuedongsports.com/#/auth/login?token='
}
const token = 'Bearer' + JSON.parse(localStorage.getItem('user'))?.token || ''
// const token ='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxNjIiLCJpYXQiOiIxNzUyODE5MzcyIiwibmJmIjoiMTc1MjgxOTM3MiIsImV4cCI6IjE3NTI4MjY1NzIiLCJpc3MiOiJ2b2wuY29yZS5vd25lciIsImF1ZCI6InZvbC5jb3JlIn0.fIlBVdJdMd7kcIrmtyKKKRDaqK8GhReheHfVse5FSk4'
window.open(externalUrl + token)
console.log(router, route.matched[route.matched.length - 2],localStorage.getItem('user'))
router.replace('/')
})
</script>