mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-12 03:48:55 +08:00
refactor: 四端完成 Options API → script setup + vuex → pinia 迁移
- buyer(95) / seller(169) / im(53) / manager(280) 共 597 个组件全部从 Options API 转换为 <script setup> - 四端 vuex 全部移除,状态管理统一迁移至 pinia 4(stores/ 目录) - util.js 等基础设施去除 vm 首参依赖;全局属性($Message/$filters 等)在 script 内改为具名导入 - 被外部 ref 访问的公共组件均已补齐 defineExpose(清单见各端 MIGRATION-VUE3.md) - 各端 eslint 启用 vue/component-api-style 防止新代码回退 Options API - 四端 yarn build 全部通过;迁移约定与注意事项已更新至各端 MIGRATION-VUE3.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { ElNotification, ElMessageBox } from "element-plus";
|
||||
let wsSignIn; // ws 是否是掉线状态
|
||||
import store from "@/store";
|
||||
import { useDialogueStore } from "@/stores/dialogue";
|
||||
class WsSocket {
|
||||
/**
|
||||
* Websocket 连接
|
||||
@@ -81,7 +81,7 @@ class WsSocket {
|
||||
* 重连成功后关闭掉线提示,新增重连提示
|
||||
*/
|
||||
if (wsSignIn) {
|
||||
store.commit('SET_WS_STATUS',true);
|
||||
useDialogueStore().SET_WS_STATUS(true);
|
||||
wsSignIn.close();
|
||||
|
||||
ElNotification({
|
||||
@@ -106,7 +106,7 @@ class WsSocket {
|
||||
connect.onclose = this.onClose.bind(this);
|
||||
this.connect = connect;
|
||||
|
||||
store.commit('SET_WS_STATUS',false);
|
||||
useDialogueStore().SET_WS_STATUS(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ class WsSocket {
|
||||
duration: 0,
|
||||
});
|
||||
// 掉线更改消息状态
|
||||
store.commit('SET_WS_STATUS',true);
|
||||
useDialogueStore().SET_WS_STATUS(true);
|
||||
let reconnect = this.config.reconnect;
|
||||
if (reconnect.lockReconnect || reconnect.number == 0) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user