This commit is contained in:
Liwanyi 2023-08-23 15:40:13 +08:00
parent 9c1db27ebe
commit 2bcd3a83e4
6 changed files with 36 additions and 11 deletions

View File

@ -5,6 +5,14 @@
# CHANGE # CHANGE
## 1.0.8
2023年08月23日
### 修改
- 通知浏览修复
## 1.0.7 ## 1.0.7
2023年06月27日 2023年06月27日

View File

@ -1,6 +1,6 @@
{ {
"name": "wuhu-torn-helper", "name": "wuhu-torn-helper",
"version": "1.0.7", "version": "1.0.8",
"description": "芜湖助手", "description": "芜湖助手",
"scripts": { "scripts": {
"release": "cross-env NODE_ENV=production rollup -c && node build.mjs", "release": "cross-env NODE_ENV=production rollup -c && node build.mjs",

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import ClassName from "../container/ClassName"; import ClassName, { GetClassName } from "../container/ClassName";
import { Injectable } from "../container/Injectable"; import { Injectable } from "../container/Injectable";
import Log from "./Log"; import Log from "./Log";
import { InjectionKey } from "vue"; import { InjectionKey } from "vue";
@ -29,6 +29,23 @@ export default class Logger {
getTime() { getTime() {
return Log.getTime() return Log.getTime()
} }
static factory<T extends {}>(classT: T): Logger {
let className = GetClassName(classT);
return new class extends Logger {
info(...o: any): void {
return super.info(`[${ className }]`, ...o);
}
warn(...o: any): void {
return super.warn(`[${ className }]`, ...o);
}
error(...o: any): void {
return super.error(`[${ className }]`, ...o);
}
}();
}
} }
export const LoggerKey = Symbol() as InjectionKey<Logger>; export const LoggerKey = Symbol() as InjectionKey<Logger>;

View File

@ -36,7 +36,7 @@ const loadData = async () => {
try { try {
res = await (await doFetch()).json(); res = await (await doFetch()).json();
if (res.success) { if (res.success) {
events.value = res.events; events.value = res.list;
if (res['newEventsAmount']) { if (res['newEventsAmount']) {
for (let i = 0; i < res['newEventsAmount']; i++) { for (let i = 0; i < res['newEventsAmount']; i++) {
events.value[i].isNew = true; events.value[i].isNew = true;

View File

@ -2,7 +2,7 @@
import { Check, Delete, Promotion } from "@element-plus/icons-vue" import { Check, Delete, Promotion } from "@element-plus/icons-vue"
import { ElMessage } from "element-plus" import { ElMessage } from "element-plus"
import { inject, onMounted, ref, watch } from "vue" import { inject, onMounted, ref } from "vue"
import { LoggerKey } from "../ts/class/Logger" import { LoggerKey } from "../ts/class/Logger"
import { itemNameDict } from "../ts/dictionary/translation" import { itemNameDict } from "../ts/dictionary/translation"
import Sleep from "../ts/func/utils/Sleep" import Sleep from "../ts/func/utils/Sleep"
@ -231,7 +231,7 @@ const _equipItem = async (item: Item) => {
onMounted(async () => { onMounted(async () => {
itemList.value = parseListHtml(await fetchList()) itemList.value = parseListHtml(await fetchList())
}) })
watch(itemList, (_cb) => logger.info(_cb))
</script> </script>
<template> <template>