mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
feat:at
This commit is contained in:
parent
b450b7f08b
commit
1c9e390178
3 changed files with 9 additions and 6 deletions
|
|
@ -9,10 +9,10 @@ export class ZZZPlugin extends plugin {
|
|||
* @returns {Promise<string>}
|
||||
*/
|
||||
async getUID() {
|
||||
const user = this.e;
|
||||
// if (this.e.at) {
|
||||
// user = this.e.at;
|
||||
// }
|
||||
let user = this.e;
|
||||
if (this.e.at) {
|
||||
user = this.e.at;
|
||||
}
|
||||
this.User = await NoteUser.create(user);
|
||||
// let uid = this.e.msg.match(/\d+/)?.[0];
|
||||
const uid = this.User?.getUid('zzz');
|
||||
|
|
@ -29,7 +29,9 @@ export class ZZZPlugin extends plugin {
|
|||
async getAPI() {
|
||||
let uid = await this.getUID();
|
||||
if (!uid) return false;
|
||||
|
||||
if (this.e.at) {
|
||||
this.e.user_id = this.e.at;
|
||||
}
|
||||
const ck = await getCk(this.e);
|
||||
if (!ck || Object.keys(ck).filter(k => ck[k].ck).length === 0) {
|
||||
await this.reply('尚未绑定cookie,请先绑定cookie');
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ function render(e, renderPath, renderData = {}, cfg = {}) {
|
|||
return {
|
||||
player: e?.playerCard?.player,
|
||||
avatar: e?.playerCard?.avatar,
|
||||
qqId: e?.at || e.user_id,
|
||||
...data,
|
||||
_res_path: resPath,
|
||||
_layout_path: layoutPath,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="{{@sys.resourcesPath}}/common/layout/playerinfo.css" />
|
||||
<div class="user-info">
|
||||
<div class="avatar">
|
||||
<img src="{{avatar}}" alt="Avatar">
|
||||
<img src="https://q1.qlogo.cn/g?b=qq&s=0&nk={{qqId}}}'" alt="Avatar">
|
||||
</div>
|
||||
<div class="info-bar">
|
||||
<div class="info">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue