=====☆
我的区服☆=====
@@ -111,6 +107,7 @@ definePageMeta({
const areaData = ref
([]);
const isOnline = ref(false);
const OnCount = ref(0);
+
const Initialize = async (): Promise => {
var result = await PubService.GetMain(StateHelper.Sid);
if (result.code == 0) {
@@ -124,18 +121,20 @@ const Initialize = async (): Promise => {
}
};
+//退出登录
+const offOnline = () => {
+
+ MessageExtend.ShowConfirmDialog("退出游戏", "您确定要退出游戏吗?", () => {
+ StateHelper.OffOnline();
+ MessageExtend.ShowToast("退出成功!", "success");
+ });
+}
+
onMounted(async () => {
-
-
//默认设置身份,正式环境删除
StateHelper.SetSid("kUVjj2cBUemcdokUEIBEKh0qhKkkSkui0x");
-
-
+ //StateHelper.SetSid('');
try {
- const id = PageExtend.QueryString("id");
-
- MessageExtend.ShowToast(id);
-
await Initialize();
}
finally {
diff --git a/Web/src/stores/user.ts b/Web/src/stores/user.ts
index 476847c..af0853e 100644
--- a/Web/src/stores/user.ts
+++ b/Web/src/stores/user.ts
@@ -49,10 +49,11 @@ export const useUserStore = defineStore('user', {
},
// 退出登录:清空用户状态
- clearUserInfo() {
+ offOnline() {
this.token = '',
this.refToken='',
- this.sid=''
+ this.sid='',
+ this.userId = ''
}
},