mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-12 16:18:45 +08:00
feat:增加项目鸣谢页
This commit is contained in:
25
backend/src/services/SponsorsService.ts
Normal file
25
backend/src/services/SponsorsService.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { injectable } from "inversify";
|
||||
import { createAxiosInstance } from "../utils/axiosInstance";
|
||||
import { AxiosInstance } from "axios";
|
||||
import sponsors from "../sponsors/sponsors.json";
|
||||
|
||||
@injectable()
|
||||
export class SponsorsService {
|
||||
private axiosInstance: AxiosInstance;
|
||||
|
||||
constructor() {
|
||||
this.axiosInstance = createAxiosInstance("http://oss.jiangmuxin.cn/cloudsaver/");
|
||||
}
|
||||
async getSponsors() {
|
||||
try {
|
||||
const response = await this.axiosInstance.get("sponsors.json");
|
||||
return {
|
||||
data: response.data.sponsors,
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
data: sponsors.sponsors,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user