mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-02-04 15:43:14 +08:00
Lint Code [skip actions]
This commit is contained in:
parent
8cc725e45c
commit
afce31e53b
@ -21,14 +21,19 @@ export function setTargetPlayer(player: number): void {
|
|||||||
* @param talents The level for the avatar's talents.
|
* @param talents The level for the avatar's talents.
|
||||||
*/
|
*/
|
||||||
export async function grantAvatar(
|
export async function grantAvatar(
|
||||||
avatar: number, level = 90,
|
avatar: number,
|
||||||
constellations = 6, talents = 6
|
level = 90,
|
||||||
|
constellations = 6,
|
||||||
|
talents = 6
|
||||||
): Promise<CommandResponse> {
|
): Promise<CommandResponse> {
|
||||||
return await fetch(`https://localhost:443/handbook/avatar`, {
|
return await fetch(`https://localhost:443/handbook/avatar`, {
|
||||||
method: "POST", body: JSON.stringify({
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
player: targetPlayer.toString(),
|
player: targetPlayer.toString(),
|
||||||
avatar: avatar.toString(),
|
avatar: avatar.toString(),
|
||||||
level, constellations, talentLevels: talents
|
level,
|
||||||
|
constellations,
|
||||||
|
talentLevels: talents
|
||||||
})
|
})
|
||||||
}).then(res => res.json());
|
}).then((res) => res.json());
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ export enum ItemCategory {
|
|||||||
export type CommandResponse = {
|
export type CommandResponse = {
|
||||||
status: number | 200 | 500;
|
status: number | 200 | 500;
|
||||||
message: string;
|
message: string;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a string is a page.
|
* Checks if a string is a page.
|
||||||
|
@ -26,11 +26,9 @@ class AvatarsPage extends React.PureComponent {
|
|||||||
|
|
||||||
<div className={"AvatarsPage_List"}>
|
<div className={"AvatarsPage_List"}>
|
||||||
{listAvatars().map((avatar) =>
|
{listAvatars().map((avatar) =>
|
||||||
avatar.id > 11000000 ? undefined :
|
avatar.id > 11000000 ? undefined : (
|
||||||
<Character
|
<Character key={avatar.id} data={avatar} onClick={this.grantAvatar.bind(this, avatar)} />
|
||||||
key={avatar.id} data={avatar}
|
)
|
||||||
onClick={this.grantAvatar.bind(this, avatar)}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user