Merge branch 'master' of https://gitaa.cn/KxGame/Kg.SeaTime
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Application.Web.Controllers.Pub
|
|||||||
{
|
{
|
||||||
private readonly IAreaService _areaService;
|
private readonly IAreaService _areaService;
|
||||||
private readonly INoticeService _noticeService;
|
private readonly INoticeService _noticeService;
|
||||||
|
|
||||||
public PubController(IAreaService areaService, INoticeService noticeService)
|
public PubController(IAreaService areaService, INoticeService noticeService)
|
||||||
{
|
{
|
||||||
_areaService = areaService;
|
_areaService = areaService;
|
||||||
@@ -24,7 +25,7 @@ namespace Application.Web.Controllers.Pub
|
|||||||
/// <param name="sid"></param>
|
/// <param name="sid"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<IPoAction> GetMain(string sid)
|
public async Task<IPoAction> GetMain(string? sid)
|
||||||
{
|
{
|
||||||
bool isOnline = false;
|
bool isOnline = false;
|
||||||
if (!string.IsNullOrEmpty(sid))
|
if (!string.IsNullOrEmpty(sid))
|
||||||
@@ -34,6 +35,7 @@ namespace Application.Web.Controllers.Pub
|
|||||||
|
|
||||||
var areaData = await _areaService.GetAreaData();
|
var areaData = await _areaService.GetAreaData();
|
||||||
var notice = await _noticeService.GetNoticeDataByTake(5);
|
var notice = await _noticeService.GetNoticeDataByTake(5);
|
||||||
|
|
||||||
int OnCount = 100;
|
int OnCount = 100;
|
||||||
return PoAction.Ok(new { area = areaData, notice, isOnline, onCount = OnCount });
|
return PoAction.Ok(new { area = areaData, notice, isOnline, onCount = OnCount });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,9 @@ export class StateHelper {
|
|||||||
this.userStore.setSid(sid);
|
this.userStore.setSid(sid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static OffOnline()
|
||||||
|
{
|
||||||
|
this.userStore.offOnline();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,12 +8,12 @@ export class MessageExtend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 提示弹窗
|
// 提示弹窗
|
||||||
static ShowDialog(message: string, title?: string) {
|
static ShowDialog(title: string, message: string) {
|
||||||
showDialog({ title: title, message: message })
|
showDialog({ title: title, message: message })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确认提示弹窗
|
// 确认提示弹窗
|
||||||
static Dialog(title: string, message: string, onConfirm?: () => void, onCancel?: () => void, confirmButtonText?: string) {
|
static ShowConfirmDialog(title: string, message: string, onConfirm?: () => void, onCancel?: () => void, confirmButtonText?: string) {
|
||||||
showConfirmDialog({
|
showConfirmDialog({
|
||||||
title: title,
|
title: title,
|
||||||
message: message,
|
message: message,
|
||||||
@@ -58,7 +58,6 @@ export class MessageExtend {
|
|||||||
} else if (type == 'fail') {
|
} else if (type == 'fail') {
|
||||||
showFailToast(text)
|
showFailToast(text)
|
||||||
} else {
|
} else {
|
||||||
console.log(text)
|
|
||||||
showToast(text)
|
showToast(text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
|
||||||
<div class="head">
|
<div class="head">
|
||||||
<div>
|
|
||||||
<img src="/images/logo.png" class="logo" />
|
<img src="/images/logo.png" class="logo" />
|
||||||
<br />
|
<br />
|
||||||
【驰骋四海·社区版】
|
【驰骋四海】
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
✧当前在线<strong> {{ OnCount }} </strong>位玩家在驰骋四海✧
|
✧当前在线<strong> {{ OnCount }} </strong>位玩家在驰骋四海✧
|
||||||
</div>
|
</div>
|
||||||
<div class="content" style="font-size:17px">
|
<div class="content" style="font-size:17px" v-if="isOnline">
|
||||||
<div>
|
<div>
|
||||||
亲爱的 <strong style="color:red">探玩玩家</strong>,欢迎来到驰骋四海·社区版!
|
亲爱的 <strong style="color:red">探玩玩家</strong>,欢迎来到驰骋四海·社区版!
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top:5px;">
|
<div style="margin-top:5px;">
|
||||||
<div>
|
<div>
|
||||||
➢<a href="http://m.twbar.cn/Home/Index?sid=KrWxKypJuDO0zFKrTig0bG">返回探玩驿站</a>
|
➢<a href="http://m.twbar.cn/Home/Index?sid=KrWxKypJuDO0zFKrTig0bG">返回探玩驿站</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
➸<a href="http://m.twbar.cn/b/1145?sid=KrWxKypJuDO0zFKrTig0bG">游戏论坛</a> ➸<a class=""
|
➸<a href="http://m.twbar.cn/b/1145?sid=KrWxKypJuDO0zFKrTig0bG">游戏论坛</a>
|
||||||
href="/Login/LoginOut?sid=klxy7ADn96CBYGWQ9AG4xPqFC2Ib6Ty1Kx">退出游戏</a>
|
➸<a @click.stop="offOnline">退出游戏</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="content" v-else>
|
||||||
|
<a href="https://3g.fan/Login">立即进入游戏?</a>
|
||||||
|
</div>
|
||||||
<div class="common">
|
<div class="common">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
=====☆<a class="" href="/Pallet/GameOpen/GameUser?sid=klxy7ADn96CBYGWQ9AG4xPqFC2Ib6Ty1Kx">我的区服</a>☆=====
|
=====☆<a class="" href="/Pallet/GameOpen/GameUser?sid=klxy7ADn96CBYGWQ9AG4xPqFC2Ib6Ty1Kx">我的区服</a>☆=====
|
||||||
@@ -111,6 +107,7 @@ definePageMeta({
|
|||||||
const areaData = ref<any>([]);
|
const areaData = ref<any>([]);
|
||||||
const isOnline = ref(false);
|
const isOnline = ref(false);
|
||||||
const OnCount = ref(0);
|
const OnCount = ref(0);
|
||||||
|
|
||||||
const Initialize = async (): Promise<void> => {
|
const Initialize = async (): Promise<void> => {
|
||||||
var result = await PubService.GetMain(StateHelper.Sid);
|
var result = await PubService.GetMain(StateHelper.Sid);
|
||||||
if (result.code == 0) {
|
if (result.code == 0) {
|
||||||
@@ -124,18 +121,20 @@ const Initialize = async (): Promise<void> => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//退出登录
|
||||||
|
const offOnline = () => {
|
||||||
|
|
||||||
|
MessageExtend.ShowConfirmDialog("退出游戏", "您确定要退出游戏吗?", () => {
|
||||||
|
StateHelper.OffOnline();
|
||||||
|
MessageExtend.ShowToast("退出成功!", "success");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
||||||
|
|
||||||
//默认设置身份,正式环境删除
|
//默认设置身份,正式环境删除
|
||||||
StateHelper.SetSid("kUVjj2cBUemcdokUEIBEKh0qhKkkSkui0x");
|
StateHelper.SetSid("kUVjj2cBUemcdokUEIBEKh0qhKkkSkui0x");
|
||||||
|
//StateHelper.SetSid('');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const id = PageExtend.QueryString("id");
|
|
||||||
|
|
||||||
MessageExtend.ShowToast(id);
|
|
||||||
|
|
||||||
await Initialize();
|
await Initialize();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|||||||
@@ -49,10 +49,11 @@ export const useUserStore = defineStore('user', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 退出登录:清空用户状态
|
// 退出登录:清空用户状态
|
||||||
clearUserInfo() {
|
offOnline() {
|
||||||
this.token = '',
|
this.token = '',
|
||||||
this.refToken='',
|
this.refToken='',
|
||||||
this.sid=''
|
this.sid='',
|
||||||
|
this.userId = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user