File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed
Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 11---
22import * as steamApi from " ../utils/steamApi.ts" ;
3+ import * as myApi from " ../utils/myApi.ts" ;
4+ import * as utils from " ../utils/utils.ts" ;
35import GameCard from " ../components//GameCard.astro" ;
4- import apps from " ../../public/assets/app.json" ;
6+ // import apps from "../../public/assets/app.json";
57import orderGames from " ../../public/assets/orderGames.json" ;
68import { delay } from " ../utils/utils" ;
79import { ENABLE_REQUEST } from " astro:env/server" ;
@@ -47,12 +49,23 @@ orderGames.forEach(({ imgurl }) => {
4749 }
4850});
4951
52+ orderGames .forEach (async (game ) => {
53+ if (game .name === " Final Fantasy XIV" ) {
54+ game .playtime_forever = await myApi .getFfPlayTime ();
55+ }
56+ });
57+
5058playedGames = playedGames
5159 .concat (orderGames )
5260 .sort ((a , b ) => b .playtime_forever - a .playtime_forever );
61+
62+ const updateTime = utils .getBeijingDateTime ();
5363---
5464
5565<div >
66+ <div >
67+ <span >上次更新(北京时间):{ updateTime } </span >
68+ </div >
5669 {
5770 playedGames .map ((game ) => {
5871 const { name, playtime_forever, imgurl } = game ;
Original file line number Diff line number Diff line change 1+ import get from "axios" ;
2+ const API_URL = "https://ff.llma.dev" ;
3+ // 自个搭的阴间服务,有兴趣可以直接问我
4+ export const getFfPlayTime = async ( ) => {
5+ const path = "/llmaget/ff_info" ;
6+ const res = await get ( `${ API_URL } ${ path } ` ) ;
7+ return res . data . data . play_time ;
8+ } ;
Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ switch (PATH_MODULE) {
9494 }
9595}
9696
97+ export const getBeijingDateTime = ( ) => {
98+ const beijingTime = new Date ( ) . toLocaleString ( "zh-CN" , {
99+ timeZone : "Asia/Shanghai" ,
100+ } ) ;
101+ return beijingTime ;
102+ } ;
103+
97104/**
98105 * 彩笔监视器:
99106 * 以一种难绷的方式打印元素
You can’t perform that action at this time.
0 commit comments