(summonerId?:number|string)
| 7 | |
| 8 | // 查询本地召唤师信息 |
| 9 | export const querySummonerInfo = async (summonerId?:number|string):Promise<summonerInfo | null> => { |
| 10 | const endpoint = summonerId |
| 11 | ? `/lol-summoner/v1/summoners/${summonerId}` |
| 12 | : '/lol-summoner/v1/current-summoner'; |
| 13 | |
| 14 | const summonerInfo: lcuSummonerInfo | null = await invokeLcu('get', endpoint) |
| 15 | |
| 16 | if (summonerInfo === null){ |
| 17 | return null |
| 18 | } |
| 19 | |
| 20 | return { |
| 21 | privacy:summonerInfo.privacy, |
| 22 | puuid:summonerInfo.puuid, |
| 23 | tagLine:summonerInfo.tagLine, |
| 24 | name:summonerInfo.gameName||summonerInfo.displayName, |
| 25 | currentId: summonerInfo.summonerId, |
| 26 | lv:"Lv "+summonerInfo.summonerLevel, |
| 27 | xp:parseInt(String((summonerInfo.xpSinceLastLevel / summonerInfo.xpUntilNextLevel ) * 100)), |
| 28 | imgUrl:`https://wegame.gtimg.com/g.26-r.c2d3c/helper/lol/assis/images/resources/usericon/${summonerInfo.profileIconId}.png` |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | // 查询所在服务器ID |
| 33 | export const queryPlatformId = async (puuid:string):Promise<string> => { |
no test coverage detected