提交 8f9d5842 作者: 毛细亚

bug 修改完成

上级 ed464ba7
<template>
<!-- 开发模式触发区域 - 隐藏的点击区域 -->
<div class="debug-container">
<div class="dev-mode-trigger" @click="handleDevModeClick" title="开发模式触发区域"></div>
<div class="dev-mode-cookie" @click="cleanCookie" title="清除所有 cookie"></div>
<div class="dev-mode-console" @click="handleDevModeClick" title="开发模式触发区域"></div>
<div class="dev-mode-cookie" @click="cleanCookie" title="连续点击7次清除所有 cookie"></div>
</div>
</template>
<script>
import devModeManager from '@/utils/devMode'
import Cookies from 'js-cookie'
export default {
name: 'Debug',
methods: {
......@@ -16,14 +15,8 @@ export default {
devModeManager.handleClick()
},
cleanCookie() {
// 清除所有 cookie
Cookies.remove('token')
Cookies.remove('userid')
Cookies.remove('corp_id')
Cookies.remove('cser_id')
Cookies.remove('accountSelect')
Cookies.remove('signData')
this.$message.success('清除所有 cookie 成功')
// 调用 devModeManager 中的 handleCookieClearClick 方法
devModeManager.handleCookieClearClick()
}
}
}
......@@ -31,17 +24,22 @@ export default {
<style lang="scss" scoped>
.debug-container{
width: 100%;
height: 5px;
height: 50px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: 999;
}
/* 开发模式触发区域 */
.dev-mode-trigger {
position: absolute;
top: 0px;
left: 0px;
.dev-mode-console {
width: 50px;
height: 20px;
background: transparent;
cursor: pointer;
z-index: 999;
user-select: none;
}
.dev-mode-cookie {
width: 50px;
height: 20px;
background: transparent;
......@@ -51,17 +49,11 @@ export default {
}
/* 开发环境下显示边框提示 */
.dev-mode-trigger:hover {
.dev-mode-console:hover {
background: rgba(0, 191, 138, 0.1);
border-radius: 4px;
}
.dev-mode-cookie{
position: absolute;
top: 0px;
right: 0px;
width: 50px;
height: 20px;
}
.dev-mode-cookie:hover {
background: rgba(138, 2, 162, 0.1);
border-radius: 4px;
......
<template>
<div class="loading rowFlex allCenter">
<svg-icon icon-class="loading" class="loadingIcon" />
<p class="text">加载中</p>
</div>
</template>
<script>
export default {
data() {
return {
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.loading{
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 0;
.loadingIcon{
font-size: 24px;
animation: rotage linear 1s infinite;
}
.text{
color: #00bf8a;
font-size: 14px;
margin-left: 5px;
}
}
@keyframes rotage {
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(360deg);
}
}
</style>
\ No newline at end of file
......@@ -699,30 +699,12 @@ li {
&:last-child {
border-bottom: none;
}
p {
font-size: 14px;
color: #333;
margin: 0;
flex: 1;
}
.el-button {
background: #3491FA;
border-color: #3491FA;
color: #fff;
&:hover {
background: #5BA8FC;
border-color: #5BA8FC;
}
&:disabled {
background: #f5f5f5;
border-color: #d9d9d9;
color: #bfbfbf;
}
}
}
}
}
......
......@@ -43,7 +43,7 @@ class DevModeManager {
}
}
// 处理点击事件
// 处理点击事件 - 切换开发模式
handleClick() {
// 如果正在销毁VConsole,忽略点击事件
if (this.isDestroyingVConsole) {
......@@ -75,6 +75,66 @@ class DevModeManager {
}, this.resetTime)
}
// 新增:处理点击事件 - 清除cookie
handleCookieClearClick() {
// 初始化计数器变量和定时器
if (this.cookieClickCount === undefined) {
this.cookieClickCount = 0
this.cookieClickTimer = null
}
this.cookieClickCount++
console.log(`清除Cookie激活进度: ${this.cookieClickCount}/${this.maxClicks}`)
// 清除之前的定时器
if (this.cookieClickTimer) {
clearTimeout(this.cookieClickTimer)
}
// 如果达到指定次数,清除所有cookie
if (this.cookieClickCount >= this.maxClicks) {
this.clearAllCookies()
this.resetCookieClickCount()
return
}
// 设置重置定时器
this.cookieClickTimer = setTimeout(() => {
if (this.cookieClickCount > 0) {
console.log('清除Cookie激活超时,重置计数')
this.resetCookieClickCount()
}
}, this.resetTime)
}
// 新增:清除所有cookie
clearAllCookies() {
try {
const cookies = document.cookie.split(';')
for (let i = 0; i < cookies.length; i++) {
const cookie = cookies[i]
const eqPos = cookie.indexOf('=')
const name = eqPos > -1 ? cookie.substr(0, eqPos).trim() : cookie.trim()
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/'
}
console.log('🍪 已清除所有 cookie')
alert('已清除所有 cookie')
} catch (error) {
console.error('清除 cookie 失败:', error)
}
}
// 新增:重置cookie点击计数
resetCookieClickCount() {
this.cookieClickCount = 0
if (this.cookieClickTimer) {
clearTimeout(this.cookieClickTimer)
this.cookieClickTimer = null
}
}
// 重置点击计数
resetClickCount() {
this.clickCount = 0
......@@ -174,6 +234,7 @@ class DevModeManager {
enabled: this.isDevMode,
environment: process.env.NODE_ENV,
clickCount: this.clickCount,
cookieClickCount: this.cookieClickCount || 0,
maxClicks: this.maxClicks,
hasVConsole: !!this.vConsole,
isDestroyingVConsole: this.isDestroyingVConsole
......@@ -183,6 +244,7 @@ class DevModeManager {
// 安全销毁方法
destroy() {
this.resetClickCount()
this.resetCookieClickCount()
this.disableDevMode()
}
}
......@@ -198,6 +260,7 @@ if (typeof window !== 'undefined') {
disable: () => devModeManager.disableDevMode(),
status: () => devModeManager.getDevModeStatus(),
reset: () => devModeManager.resetClickCount(),
clearCookies: () => devModeManager.clearAllCookies(),
destroy: () => devModeManager.destroy()
}
......
......@@ -185,7 +185,7 @@ export default {
};
},
computed: {
...mapState("game", ["accountSelect", "gameTabActive"]),
...mapState("game", ["accountSelect"]),
},
mounted() {
this.requestViolationList()
......
......@@ -58,7 +58,7 @@
@click="terminaProcess(item, index)"
>
<div class="terminaItem rowFlex spaceBetween columnCenter">
<!-- <i :class=" item.showStep?'el-icon-bottom':'el-icon-right'"></i> -->
<i :class=" item.showStep?'el-icon-arrow-down':'el-icon-arrow-right'" class="svgicon"></i>
<div class="terminaItemLeft">
<p><span class="label">新区角色:</span><span class="value">{{ item.role_name }}({{ item.server_name }})</span></p>
<p><span class="label">老区角色:</span><span class="value">{{ item.old_role_name }} ({{ item.old_server_name }}) </span></p>
......@@ -529,7 +529,7 @@ export default {
width: calc(100% - 20px);
margin-left: 10px;
position: relative;
.el-icon-right,.el-icon-down{
.svgicon{
position: absolute;
bottom: 12px;
right: 2px;
......
......@@ -493,11 +493,9 @@ export default {
this.handleClose()
} else {
this.loading = false
this.$message.error(res.message || '提交失败')
}
} catch (error) {
console.error('提交失败:', error)
this.$message.error('提交失败: ' + (error.message || '未知错误'))
this.loading = false
} finally {
this.loading = false
......
......@@ -123,7 +123,7 @@
props: ['show', 'width', 'title', 'info'],
computed: {
...mapState('game', ['accountSelect']),
...mapState('user', [ 'cser_name','cser_id'])
...mapState('user', [ 'cser_name','cser_id','userInfo'])
},
data() {
return {
......@@ -201,6 +201,7 @@
}
},
mounted() {
console.log(this.info, 'info')
// this.gameMemberView()
this.searchHandleStatus()
if (this.info) {
......@@ -356,6 +357,7 @@
})
},
async submitForm() {
console.log(this.info, 'info')
try {
let res = {}
if (this.info && this.info.role_id) {
......
......@@ -139,12 +139,12 @@ export default {
}
},
computed: {
...mapState('game', ['accountSelect', 'gameTabActive']),
...mapState('user', ['isGameSystem', 'userInfo'])
...mapState('game', ['accountSelect']),
...mapState('user', ['userInfo'])
},
watch: {
accountSelect(newVal, oldVal) {
if (newVal && newVal !== '' && this.gameTabActive == 9) {
if (newVal && newVal !== '') {
this.pageInfo = {
page: 0,
page_size: 20,
......
......@@ -10,6 +10,7 @@
:model="formData"
:rules="rules"
ref="formData"
label-position="top"
label-width="100px"
>
<el-form-item
......
......@@ -2,7 +2,7 @@
<div class="vipToolsContent">
<div class="gameList">
<!-- VIP 自助工具 -->
<div class="gameListItem rowFlex columnCenter spaceBetween">
<div class="gameListItem rowFlex columnCenter spaceBetween" v-if="false">
<p class="rowFlex columnCenter">
<img src="@/assets/icon/vipIcon.svg" alt="vipIcon" style="width: 16px;height: 16px;margin-right: 5px;">
VIP自助工具</p>
......@@ -74,11 +74,13 @@
slot="reference"
type="text"
size="medium"
style="margin-right: 10px;"
>礼包内容</el-button>
</el-popover>
</p>
<el-button
size="mini"
type="primary"
@click="sendGameCode(items)"
>发送礼包码</el-button>
</div>
......
......@@ -28,18 +28,18 @@
<div class="rowFlex titleFixed columnCenter">
<div class="num">{{ items.message.attachments.length > 1 ? `+${items.message.attachments.length - 1}条` : '' }}</div>
<!-- <el-button class="button rowFlex allCenter" :disabled="Boolean(setIntervalTimer)" @click.stop="sendMessage(items.message.attachments, items._id)">发送</el-button> -->
</div>
<el-collapse-item title="" :name="items._id" class="contentItem">
<div v-for="(i, j) in items.message.attachments" :key="j">
<div>
<div v-if="i.msgtype == 'text'" class="contentItemDetails rowFlex spaceBetween columnCenter">
<div class="text">{{ i.text.content }}</div>
<el-button class="sendButton rowFlex allCenter" :disabled="Boolean(setIntervalTimer)" @click.stop="sendMessageEdit(i, items._id)">发送</el-button>
<el-button class="sendButton rowFlex allCenter" @click.stop="sendMessageEdit(i, items._id)">发送</el-button>
</div>
<div v-if="i.msgtype == 'image'" class="contentItemDetails rowFlex spaceBetween columnCenter">
<el-image class="image" :src="i.image.picurl" :preview-src-list="[i.image.picurl]" fit="contain"></el-image>
<el-button class="sendButton rowFlex allCenter" :disabled="Boolean(setIntervalTimer)" @click.stop="sendMessageEdit(i, items._id)">发送</el-button>
<el-button class="sendButton rowFlex allCenter" @click.stop="sendMessageEdit(i, items._id)">发送</el-button>
</div>
</div>
</div>
......@@ -101,12 +101,11 @@ export default {
}
},
computed: {
...mapState('game', ['accountSelect', 'gameTabActive']),
...mapState('user', ['setIntervalTimer'])
...mapState('game', ['accountSelect']),
},
watch: {
accountSelect(newVal, oldVal) {
if (newVal && newVal !== '' && this.gameTabActive == 3) {
if (newVal && newVal !== '') {
this.pageInfo = {
page: 1,
page_size: 100,
......@@ -125,13 +124,6 @@ export default {
// this.requestGroup()
},
methods: {
...mapMutations('common', ['set_sendSkillMessage', 'set_isEditSkill']),
sendMessage: throttle(function(item, id) {
if (!this.setIntervalTimer) {
this.set_sendSkillMessage(item)
this.skillQuote(id, item.length)
}
}, 500),
handleDragStart(e, item, index) {
this.sortID._id = item._id
this.dragging = item
......
......@@ -113,7 +113,7 @@ export default {
},
watch: {
accountSelect(newVal, oldVal) {
if (newVal && newVal !== '' && this.gameTabActive == 3) {
if (newVal && newVal !== '') {
this.pageInfo = {
page: 1,
page_size: 20,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论