diff --git a/plugins/genshin/model/base.js b/plugins/genshin/model/base.js index adfa651..ac398a5 100644 --- a/plugins/genshin/model/base.js +++ b/plugins/genshin/model/base.js @@ -1,22 +1,23 @@ import fs from 'node:fs' import _ from 'lodash' +import cfg from '../../../lib/config/config.js' import { Common, Version } from '#miao' import { Character } from '#miao.models' export default class base { - constructor (e = {}) { + constructor(e = {}) { this.e = e this.userId = e?.user_id this.model = 'genshin' this._path = process.cwd().replace(/\\/g, '/') } - get prefix () { + get prefix() { return `Yz:genshin:${this.model}:` } // 统一封装渲染 - async renderImg (tpl, data, cfg = {}) { + async renderImg(tpl, data, cfg = {}) { return Common.render('genshin', `html/${tpl}`, data, { ...cfg, e: this.e @@ -29,12 +30,23 @@ export default class base { * @param tplFile 模板html路径 * @param pluResPath 插件资源路径 */ - get screenData () { + get screenData() { const layoutPath = process.cwd() + '/plugins/genshin/resources/html/layout/' + let yunzaiName = cfg.package.name + if (yunzaiName == 'miao-yunzai') { + yunzaiName = 'Miao-Yunzai' + } else if (yunzaiName == 'yunzai') { + yunzaiName = 'Yunzai-Bot' + } else if (yunzaiName == 'trss-yunzai') { + yunzaiName = 'TRSS-Yunzai' + } else { + yunzaiName = _.capitalize(yunzaiName) + } let data = { saveId: this.userId, cwd: this._path, yzVersion: `v${Version.yunzai}`, + yzName: yunzaiName, genshinLayout: layoutPath + 'genshin.html', defaultLayout: layoutPath + 'default.html' } diff --git a/plugins/genshin/model/exportLog.js b/plugins/genshin/model/exportLog.js index db047d6..8f49534 100644 --- a/plugins/genshin/model/exportLog.js +++ b/plugins/genshin/model/exportLog.js @@ -63,14 +63,23 @@ export default class ExportLog extends base { if (!this.uid) return false let list = this.getAllList().list - + let yunzaiName = cfg.package.name + if (yunzaiName == 'miao-yunzai') { + yunzaiName = 'Miao-Yunzai' + } else if (yunzaiName == 'yunzai') { + yunzaiName = 'Yunzai-Bot' + } else if (yunzaiName == 'trss-yunzai') { + yunzaiName = 'TRSS-Yunzai' + } else { + yunzaiName = _.capitalize(yunzaiName) + } let data = { info: { uid: this.uid, lang: list[0].lang, export_time: moment().format('YYYY-MM-DD HH:mm:ss'), export_timestamp: moment().format('X'), - export_app: 'Miao-Yunzai', + export_app: yunzaiName, export_app_version: cfg.package.version, }, list diff --git a/plugins/genshin/resources/StarRail/html/mysNews-list/mysNews-list.html b/plugins/genshin/resources/StarRail/html/mysNews-list/mysNews-list.html index 03473b2..b041c1b 100644 --- a/plugins/genshin/resources/StarRail/html/mysNews-list/mysNews-list.html +++ b/plugins/genshin/resources/StarRail/html/mysNews-list/mysNews-list.html @@ -42,7 +42,7 @@ - + diff --git a/plugins/genshin/resources/StarRail/html/mysNews/mysNews.html b/plugins/genshin/resources/StarRail/html/mysNews/mysNews.html index 6e61134..608aefb 100644 --- a/plugins/genshin/resources/StarRail/html/mysNews/mysNews.html +++ b/plugins/genshin/resources/StarRail/html/mysNews/mysNews.html @@ -120,7 +120,7 @@ - + diff --git a/plugins/genshin/resources/html/admin/userAdmin.html b/plugins/genshin/resources/html/admin/userAdmin.html index a4ef497..fe34f90 100644 --- a/plugins/genshin/resources/html/admin/userAdmin.html +++ b/plugins/genshin/resources/html/admin/userAdmin.html @@ -77,7 +77,7 @@
  • #删除无效用户: 删除当前所有请求失效的用户的CK数据,暂不会删除公共CK
  • - + diff --git a/plugins/genshin/resources/html/deck/deck.html b/plugins/genshin/resources/html/deck/deck.html index 97758ae..dd71ba0 100644 --- a/plugins/genshin/resources/html/deck/deck.html +++ b/plugins/genshin/resources/html/deck/deck.html @@ -77,7 +77,7 @@ - + diff --git a/plugins/genshin/resources/html/deckCard/deckCard.html b/plugins/genshin/resources/html/deckCard/deckCard.html index b769726..09e66d1 100644 --- a/plugins/genshin/resources/html/deckCard/deckCard.html +++ b/plugins/genshin/resources/html/deckCard/deckCard.html @@ -115,7 +115,7 @@ {{/if}} - + diff --git a/plugins/genshin/resources/html/deckList/deckList.html b/plugins/genshin/resources/html/deckList/deckList.html index d21b4a1..f077bc4 100644 --- a/plugins/genshin/resources/html/deckList/deckList.html +++ b/plugins/genshin/resources/html/deckList/deckList.html @@ -50,7 +50,7 @@ {{/each}} - + diff --git a/plugins/genshin/resources/html/layout/genshin.html b/plugins/genshin/resources/html/layout/genshin.html index 1833472..8cb510e 100644 --- a/plugins/genshin/resources/html/layout/genshin.html +++ b/plugins/genshin/resources/html/layout/genshin.html @@ -18,7 +18,7 @@
    {{block 'main'}}{{/block}} - +
    diff --git a/plugins/genshin/resources/html/mysNews-list/mysNews-list.html b/plugins/genshin/resources/html/mysNews-list/mysNews-list.html index 03473b2..b041c1b 100644 --- a/plugins/genshin/resources/html/mysNews-list/mysNews-list.html +++ b/plugins/genshin/resources/html/mysNews-list/mysNews-list.html @@ -42,7 +42,7 @@ - + diff --git a/plugins/genshin/resources/html/mysNews/mysNews.html b/plugins/genshin/resources/html/mysNews/mysNews.html index 22e3827..56d2a02 100644 --- a/plugins/genshin/resources/html/mysNews/mysNews.html +++ b/plugins/genshin/resources/html/mysNews/mysNews.html @@ -120,7 +120,7 @@ - + diff --git a/plugins/genshin/resources/html/payLog/payLog.html b/plugins/genshin/resources/html/payLog/payLog.html index 9d2db9e..153fddc 100644 --- a/plugins/genshin/resources/html/payLog/payLog.html +++ b/plugins/genshin/resources/html/payLog/payLog.html @@ -52,7 +52,7 @@
    详细统计
    - +