1
1
export const sponsorUrl : string = typeof window !== 'undefined' ? window . location . origin + '/fastapi_best_architecture_docs/sponsors.html' : 'https://fastapi-practices.github.io/fastapi_best_architecture_docs/sponsors.html' ;
2
2
3
- interface Sponsor {
3
+ export interface Sponsor {
4
+ link : string ;
4
5
href ?: string ;
5
- link ?: string ;
6
6
alt ?: string ;
7
7
expiryTime : string ; // ISO 格式日期:2099-12-31T23:59:59
8
8
}
@@ -11,58 +11,40 @@ export const defaultSponsor: Sponsor = {
11
11
link : '' ,
12
12
href : sponsorUrl ,
13
13
alt : '成为赞助商' ,
14
- expiryTime : '2099-12-31T23:59:59 ' ,
14
+ expiryTime : '' ,
15
15
} ;
16
16
17
17
export const homeSponsor : Sponsor = { ...defaultSponsor } ;
18
18
19
19
20
20
export const goldSponsors : Sponsor [ ] = [
21
- {
22
- link : 'https://dscache.tencent-cloud.cn/upload//rhino-design-800x450-fea2ea55b7b63624628bf9bb22454cb8f91b7d69.png' ,
23
- href : 'https://curl.qcloud.com/f9VMAii8' ,
24
- alt : '2核2G云服务器低至 68元/年' ,
25
- expiryTime : '2025-12-31T23:59:59' ,
26
- } ,
27
21
{
28
22
link : 'https://img14.360buyimg.com/ddimg/jfs/t1/284966/5/22913/37242/68023351Faddd8304/6337ad52ea02ad10.jpg' ,
29
23
href : 'https://share.302.ai/LJojhb' ,
30
24
alt : '302.AI' ,
31
25
expiryTime : '2025-06-18T16:35:00' ,
32
- } ,
33
- { ...defaultSponsor }
26
+ }
34
27
]
35
28
36
29
export const generalSponsors : Sponsor [ ] = [
37
30
{
38
- link : 'https://user.by.ltd/templates/lagom2/assets/img/logo/logo_big_inverse.1753622506.png ' ,
31
+ link : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQQImbvY5S8IbJ1iL6yHfExtHiAhUtLIoi7AQ&s ' ,
39
32
href : 'https://user.by.ltd/aff.php?aff=12215' ,
40
33
alt : 'Bywave' ,
41
34
expiryTime : '2099-12-31T23:59:59' ,
42
35
} ,
43
- { ...defaultSponsor } ,
44
- { ...defaultSponsor } ,
45
- { ...defaultSponsor } ,
46
- { ...defaultSponsor } ,
47
36
{ ...defaultSponsor }
48
37
]
49
38
50
39
export const openSponsorLink = ( href : string ) => {
51
40
window . open ( href ) ;
52
41
} ;
53
42
54
- export function shouldShowSponsor ( sponsor : {
55
- href ?: string ;
56
- link ?: string ;
57
- expiryTime ?: string ;
58
- } ) : boolean {
59
- if ( ! sponsor . link ) return false ;
60
-
61
- if ( sponsor . expiryTime ) {
43
+ export function shouldShowSponsor ( expiryTime ?: string ) : boolean {
44
+ if ( expiryTime ) {
62
45
const now = new Date ( ) ;
63
- const expiryDate = new Date ( sponsor . expiryTime ) ;
46
+ const expiryDate = new Date ( expiryTime ) ;
64
47
return now < expiryDate ;
65
48
}
66
-
67
- return true ;
49
+ return false ;
68
50
}
0 commit comments