2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00
xiaoyao-cvs-plugin/apps/user.js
2022-08-17 08:01:14 +08:00

53 lines
1.3 KiB
JavaScript

import MihoYoApi from "../model/mys/mihoyo-api.js"
import utils from '../model/mys/utils.js';
import promiseRetry from 'promise-retry';
import {
Cfg,
Data
} from "../components/index.js";
import moment from 'moment';
import Common from "../components/Common.js";
import {
isV3
} from '../components/Changelog.js';
import gsCfg from '../model/gsCfg.js';
import fs from "fs";
import {
segment
} from "oicq";
import YAML from 'yaml'
import User from "../model/user.js"
export const rule = {
userInfo: {
reg: "^#*(ck|stoken|cookie|cookies|签到)查询$",
describe: "用户个人信息查询"
},
}
export async function userInfo(e,{render}){
let user=new User(e);
e.reply("正在获取角色信息请稍等...")
let sumData=await user.getCkData()
let week = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
let day = moment(new Date()).format("yyyy年MM月DD日 HH:mm") + " " + week[new Date().getDay()];
if(Object.keys(sumData).length==0){
return true;
}
let ck="";
if(e.cookie){
ck= user.getCookieMap(e.cookie);
ck=ck.get("ltuid")
}
return await Common.render(`user/userInfo`, {
uid: e.user_id,
ltuid:ck||e.user_id,
save_id:e.user_id,
day,
sumData
}, {
e,
render,
scale: 1.2
})
return true;
}