@@ -21,6 +21,7 @@ const headers = {
2121 // "user-agent":
2222 // "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.188",
2323}
24+ const staticURL = "https://res.17roco.qq.com/res/combat/icons/"
2425const rocoApi = axios . create ( {
2526 baseURL,
2627 headers,
@@ -34,7 +35,20 @@ interface SpiritListParma {
3435 page : number
3536}
3637
38+ interface ItemListParma {
39+ search : string
40+ id : string
41+ page : number
42+ }
43+
3744export const useApi = ( ) => {
45+ // Angel Feature Map
46+ async function getFeatures ( ) {
47+ const response = await rocoApi . get ( "/feature/" )
48+ return response . data
49+ }
50+
51+ // Angel List
3852 async function getSpiritList (
3953 params : SpiritListParma = {
4054 search : "" ,
@@ -46,7 +60,47 @@ export const useApi = () => {
4660 const response = await rocoApi . post ( "/spiritList/" , params )
4761 return response . data . data
4862 }
63+
64+ // Angel Detail
65+ async function getSpirit ( params : { hash : string } ) {
66+ const response = await rocoApi . post ( "/detail/angel/" , params )
67+ return response . data . data
68+ }
69+
70+ // Item List
71+ async function getItemList (
72+ params : ItemListParma = {
73+ search : "" ,
74+ id : "" ,
75+ page : 1 ,
76+ }
77+ ) {
78+ const response = await rocoApi . post ( "/Itemlist/" , params )
79+ return response . data . data
80+ }
81+
82+ // Angel Skill List
83+ async function getSkillList (
84+ params : SpiritListParma = {
85+ search : "" ,
86+ id : "" ,
87+ feature : "" ,
88+ page : 1 ,
89+ }
90+ ) {
91+ const response = await rocoApi . post ( "/Skilllist/" , params )
92+ return response . data . data
93+ }
94+
4995 return {
96+ getFeatures,
5097 getSpiritList,
98+ getSpirit,
99+ getItemList,
100+ getSkillList,
101+ baseURL,
102+ headers,
103+ timeout,
104+ staticURL,
51105 }
52106}
0 commit comments