Merge remote-tracking branch 'origin/demo' into demo
3 files modified
1 files added
| | |
| | | // http |
| | | // http://172.16.13.64:8100 |
| | | // baseURL: 'http://192.168.1.133:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/' |
| | | baseURL: 'http://192.168.1.198:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/' |
| | | // baseURL: 'https://dev.jxpskj.com:36789', // This url must end with "/". Example: 'http://192.168.1.1:6789/' |
| | | // baseURL: 'http://192.168.1.198:6789', // This url must end with "/". Example: 'http://192.168.1.1:6789/' |
| | | baseURL: 'https://dev.jxpskj.com:36789', // This url must end with "/". Example: 'http://192.168.1.1:6789/' |
| | | // ws: 'ws//127.0.0.1:6789/api/v1/ws', |
| | | // ws://192.168.1.198:1883/ |
| | | websocketURL: 'ws://192.168.1.198:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws' |
| | | // websocketURL: 'ws://192.168.1.198:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws' |
| | | // websocketURL: 'ws://192.168.1.133:6789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws' |
| | | // websocketURL: 'wss://dev.jxpskj.com:36789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws' |
| | | websocketURL: 'wss://dev.jxpskj.com:36789/api/v1/ws', // Example: 'ws://192.168.1.198:6789/api/v1/ws' |
| | | |
| | | // livestreaming |
| | | // RTMP Note: This IP is the address of the streaming server. If you want to see livestream on web page, you need to convert the RTMP stream to WebRTC stream. |
| | |
| | | /* |
| | | * @Author: husq 931347610@qq.com |
| | | * @Date: 2023-09-13 18:21:07 |
| | | * @LastEditors: husq 931347610@qq.com |
| | | * @LastEditTime: 2023-09-25 15:54:31 |
| | | * @FilePath: \Cloud-API-Demo-Web\src\main.ts |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. |
| | | */ |
| | | import App from './App.vue' |
| | | import router from './router' |
| | | import { antComponents } from './antd' |
| | |
| | | import 'virtual:svg-icons-register' |
| | | import store, { storeKey } from './store' |
| | | import { createInstance } from '/@/root' |
| | | import './permission' |
| | | import '/@/styles/index.scss' |
| | | const app = createInstance(App) // 引入css |
| | | app.use(store, storeKey) |
| New file |
| | |
| | | import { ELocalStorageKey, ERouterName } from './types/enums' |
| | | import router from '/@/router/index' |
| | | |
| | | const whiteList = ['/' + ERouterName.LOGIN] // 设置白名单 |
| | | |
| | | router.beforeEach(async (to, from, next) => { |
| | | // 确定用户是否已登录过,存在Token |
| | | const hasToken = localStorage.getItem(ELocalStorageKey.Token) |
| | | |
| | | if (hasToken) { |
| | | if (to.path === '/' + ERouterName.LOGIN) { |
| | | // 如果已登录,请重定向到主页 |
| | | next({ path: '/' + ERouterName.PROJECT_LIST }) |
| | | } else { |
| | | try { |
| | | next() // // 如果不传参数就会重新执行路由拦截,重新进到这里 |
| | | } catch (error) { |
| | | next(`/${ERouterName.LOGIN}?redirect=${to.path}`) |
| | | } |
| | | } |
| | | } else { |
| | | if (whiteList.indexOf(to.path) !== -1) { |
| | | next() |
| | | } else { |
| | | next(`/${ERouterName.LOGIN}?redirect=${to.path}`) |
| | | } |
| | | } |
| | | }) |