Merge branch 'develop' of http://25.13.9.101:9000/K17_AITS/tra-app into develop

This commit is contained in:
田岩
2025-06-30 19:07:43 +08:00
2 changed files with 8 additions and 2 deletions
+3
View File
@@ -110,6 +110,8 @@ import { getUserInfo } from '@/common/common';
import { onPullDownRefresh } from '@dcloudio/uni-app';
import { loginOut } from '@/api/login.js';
import { queryTraStdyStatisticsSelf } from '@/api/user.js';
import { useSocketStore } from "@/store/socket.js"
const socketStore = useSocketStore()
const accmTaskCntRef = ref(null);
const accmPointRef = ref(null);
@@ -189,6 +191,7 @@ const click_loginout = () => {
if (!res) return;
try {
common.loading('正在退出登录');
socketStore.closeSocket()
await loginOut();
} catch (e) {}
common.hideLoading();
+5 -2
View File
@@ -15,10 +15,13 @@ export const useSocketStore = defineStore('socketStore',{
},
actions:{
creatSocket(){
let _baseUrl = get_base_url().split('http').join('ws')
console.log(_baseUrl)
if(this.SocketObj && this.SocketObj?.close) {
closeSocket()
this.closeSocket()
}
this.SocketObj = new SocketClass(get_base_url() + '/trastudy/trasoket/open?summary=' + getToken());
this.SocketObj = new SocketClass(_baseUrl + '/trastudy/trasoket/open?summary=' + getToken());
},
closeSocket: () => {
if(!this.SocketObj || !this.SocketObj?.close) return