-
-
+
+
-
{}}
- okText="确定"
- cancelText="取消"
- onOk={() => {}}
- onCancel={() => {
- setIsModalOpen(false);
- }}
- >
- cascsa
-
);
};
-export default inject("homeStore")(observer(HomeLeft));
+export default HomeLeft;
diff --git a/src/pages/home/homeLeft/turn.tsx b/src/pages/home/homeLeft/turn.tsx
new file mode 100644
index 0000000..6c5a0eb
--- /dev/null
+++ b/src/pages/home/homeLeft/turn.tsx
@@ -0,0 +1,110 @@
+import { Store } from "antd/es/form/interface";
+import * as echarts from "echarts";
+import { inject, observer } from "mobx-react";
+import { useEffect, useState } from "react";
+import "./left.less";
+import { Col, Modal, Row } from "antd";
+const Turn = (props: Store) => {
+ const { homeStore } = props;
+ const [isModalOpen, setisModalOpen] = useState(false);
+ const initChart = (data) => {
+ var myChart = echarts.init(document.getElementById("xunlian"));
+ var option = {
+ xAxis: {
+ type: "category",
+ data: data.map((item) => item.name),
+ axisLabel: {
+ show: true,
+ interval: 0,
+ rotate: 30,
+ },
+ },
+ grid: { top: "10%", bottom: "45%", right: "5%" },
+ yAxis: {
+ type: "value",
+ splitLine: {
+ show: false, // 去除网格线
+ },
+ },
+ series: [
+ {
+ data: data.map((item) => item.count),
+ type: "line",
+ smooth: true,
+ areaStyle: {
+ opacity: 0.1,
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ {
+ offset: 0,
+ color: "rgb(128, 255, 165)",
+ },
+ {
+ offset: 1,
+ color: "rgb(1, 191, 236)",
+ },
+ ]),
+ },
+ },
+ ],
+ };
+ option && myChart.setOption(option);
+ };
+ useEffect(() => {
+ homeStore.getTr().then((res) => {
+ initChart(res.data.record);
+ });
+ }, [homeStore]);
+ const trunHandler = () => {
+ setisModalOpen(true);
+ };
+ return (
+ <>
+
+
{}}
+ onOk={() => {}}
+ footer={null}
+ onCancel={() => {
+ setisModalOpen(false);
+ }}
+ >
+ <>
+
+
+ {[7, 8, 9, 10, 11].map((item, index) => {
+ return (
+
+

+
+ );
+ })}
+
+
+
+

+
+
+
+ >
+
+ >
+ );
+};
+
+export default inject("homeStore")(observer(Turn));
diff --git a/src/service/base.ts b/src/service/base.ts
index 18c8db6..269af73 100644
--- a/src/service/base.ts
+++ b/src/service/base.ts
@@ -18,16 +18,17 @@ axios.interceptors.request.use((config) => {
// 添加响应拦截器
axios.interceptors.response.use((res: AxiosResponse) => {
if (res.data?.status === 401) {
- console.log("res.data.status",res.data.status);
store.usrStore.openLoginDilog()
store.usrStore.logOut()
+ window.location.href = '#/login'
}
return res;
}, (err) => {
- console.log(err.status===401);
+
if (err.status === 401) {
store.usrStore.openLoginDilog()
store.usrStore.logOut()
+ window.location.href = '#/login'
}
return Promise.reject(err);
});
diff --git a/src/store/user.ts b/src/store/user.ts
index 3fdb46b..460aa8c 100644
--- a/src/store/user.ts
+++ b/src/store/user.ts
@@ -40,6 +40,7 @@ class UserStore extends BaseStore
{
if (!this._userinfo.token) {
let token = window.localStorage.getItem("token")
this._userinfo.token = token;
+
}
return this._userinfo;
}
diff --git a/src/util/config.ts b/src/util/config.ts
index e3a0e5f..c758532 100644
--- a/src/util/config.ts
+++ b/src/util/config.ts
@@ -1,12 +1,13 @@
class Config {
- // static baseUrl = "https://rw.quwanya.cn/";
- // static uploadUrl = "https://rw.quwanya.cn/";
- // static ws = "wss://rw.quwanya.cn/ws?id=admin";
-
+ static baseUrl = "https://rw.quwanya.cn/";
+ static uploadUrl = "https://rw.quwanya.cn/";
+ static ws = "wss://rw.quwanya.cn/ws";
- static baseUrl = "http://127.0.0.1:12214/";
- static uploadUrl = "http://127.0.0.1:12214/";
- static ws = "ws://rw.quwanya.cn:12217/ws";
+ // static ws = "wss://rw.quwanya.cn/ws?id=admin";
+ // static baseUrl = "http://127.0.0.1:12214/";
+ // static uploadUrl = "http://127.0.0.1:12214/";
+ // static ws = "ws://rw.quwanya.cn/ws";
}
-export default Config;
\ No newline at end of file
+export default Config;
+
diff --git a/src/util/webRtc.ts b/src/util/webRtc.ts
index 93d3cf1..66d4c9b 100644
--- a/src/util/webRtc.ts
+++ b/src/util/webRtc.ts
@@ -1,4 +1,6 @@
-import SocketService from "./socket";
+// import SocketService from "./socket";
+
+import Config from "./config";
// const socketService = SocketService.getInstance();
class WebRtc {
@@ -17,7 +19,7 @@ class WebRtc {
}))
}
async init() {
- this.ws = new WebSocket("ws://rw.quwanya.cn:12217/ws")
+ this.ws = new WebSocket(Config.ws)
this.ws.addEventListener('open', this.open);
let that = this;
this.createOffer()