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 @@