Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
addressxy committed Mar 14, 2022
1 parent f3ec4e6 commit a489cfd
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 13 deletions.
52 changes: 47 additions & 5 deletions cloudapp/src/app/main/main.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class MainComponent implements OnInit, OnDestroy {
institutionType:'a',
classification:'690',
holding: '905',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY',
lookupPrefix:'',
classificationNumber: 'd',
titleNumber: 'e',
Expand All @@ -50,7 +50,7 @@ export class MainComponent implements OnInit, OnDestroy {
institutionType:'a',
classification:'690',
holding: '090',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY',
lookupPrefix:'',
classificationNumber: 'd',
titleNumber: 'u',
Expand All @@ -65,11 +65,25 @@ export class MainComponent implements OnInit, OnDestroy {
private translate: TranslateService,
private http: HttpClient,
private alert: AlertService) {

}

ngOnInit() {
this.pageLoad$ = this.eventsService.onPageLoad(this.onPageLoad);
//检测窗口大小
// window.onresize = ()=>{
// if(window.innerWidth > 450){
// console.log( 'onresize:11')
// }else{
// console.log( 'onresize:222')
// }
// }
this.getSettings()

// this.getcckb('ccc').then((res: any) => {
// console.log(res)
// })

}

ngOnDestroy(): void {
Expand Down Expand Up @@ -99,6 +113,8 @@ export class MainComponent implements OnInit, OnDestroy {
} else {
this.apiResult = {};
}


}

setSettings(value: any) {
Expand Down Expand Up @@ -705,7 +721,7 @@ export class MainComponent implements OnInit, OnDestroy {
data => {
this.http.get("https://api.exldevnetwork.net.cn" + lookupUrl.replace("KEY", key), {
headers: {
'X-Proxy-Host': 'http://aleph20.exlibris.com.cn:8992',
'X-Proxy-Host': 'http://n5cloud.library.nenu.edu.cn',
'Authorization': 'Bearer ' + data
}
}).subscribe(function (data) {
Expand All @@ -724,6 +740,32 @@ export class MainComponent implements OnInit, OnDestroy {

}

getcckb(key: string) {
var json = {"apikey":"562930543E3E090957C595704CF28BE4"};
return new Promise((resolve, reject) => {
this.eventsService.getAuthToken().subscribe(
data => {
this.http.post("https://api.exldevnetwork.net.cn" + "/cckbapi/almaBooklist", json,{
headers: {
'X-Proxy-Host': 'http://n5cloud.library.nenu.edu.cn',
'Authorization': 'Bearer ' + data
}
}).subscribe(function (data) {
// this.loading = false;
resolve(data)
}, error => {
// this.loading = false;
// this.alert.error(this.translate.instant('i18n.error', {url: "https://api.exldevnetwork.net.cn" + lookupUrl.replace("KEY", key)}), {autoClose: true, delay: 3000});
reject(error)
})
}
);

// resolve({seq: Math.ceil(Math.random() * 99)})
})

}

updateAnies(anies: string) {
let request: Request = {
url: this.pageEntities[0].link,
Expand Down Expand Up @@ -789,7 +831,7 @@ export class MainComponent implements OnInit, OnDestroy {
if (settings.lookupUrl) {
this.form.value.lookupUrl = settings.lookupUrl
} else {
this.form.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY'
this.form.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY'
}
if (settings.lookupPrefix) {
this.form.value.lookupPrefix = settings.lookupPrefix
Expand Down Expand Up @@ -857,7 +899,7 @@ export class MainComponent implements OnInit, OnDestroy {
if (settings.lookupUrl) {
this.form21.value.lookupUrl = settings.lookupUrl
} else {
this.form21.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY'
this.form21.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY'
}
if (settings.lookupPrefix) {
this.form21.value.lookupPrefix = settings.lookupPrefix
Expand Down
2 changes: 1 addition & 1 deletion cloudapp/src/app/models/cnmarc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export class Cnmarc {
institutionType:String = 'a';
classification:String = ''
holding:String = '905';
lookupUrl:String = '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY';
lookupUrl:String = '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY';
lookupPrefix:String ='';
classificationNumber:String = 'd';
titleNumber:String = 'e';
Expand Down
2 changes: 1 addition & 1 deletion cloudapp/src/app/models/marc21.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export class Marc21 {
institutionType:String = 'a';
classification:String = ''
holding:String = '905';
lookupUrl:String = '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY';
lookupUrl:String = '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY';
lookupPrefix:String ='';
classificationNumber:String = 'a';
titleNumber:String = 'b';
Expand Down
10 changes: 5 additions & 5 deletions cloudapp/src/app/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
institutionType:'a',
classification:'690a',
holding: '905',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY',
lookupPrefix:'',
classificationNumber: 'd',
titleNumber: 'e',
Expand All @@ -54,7 +54,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
institutionType:'a',
classification:'093a',
holding: '905',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY',
lookupUrl: '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY',
lookupPrefix:'',
classificationNumber: 'd',
titleNumber: 'u',
Expand Down Expand Up @@ -216,7 +216,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
data => {
this.http.get("https://api.exldevnetwork.net.cn" + this.form.value.lookupUrl.replace("KEY", key), {
headers: {
'X-Proxy-Host': 'http://aleph20.exlibris.com.cn:8992',
'X-Proxy-Host': 'http://n5cloud.library.nenu.edu.cn',
'Authorization': 'Bearer ' + data
}
}).subscribe(function (data) {
Expand Down Expand Up @@ -266,7 +266,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
if (settings.lookupUrl) {
this.form.value.lookupUrl = settings.lookupUrl
} else {
this.form.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY'
this.form.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY'
}
if (settings.lookupPrefix) {
this.form.value.lookupPrefix = settings.lookupPrefix
Expand Down Expand Up @@ -332,7 +332,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
if (settings.lookupUrl) {
this.form21.value.lookupUrl = settings.lookupUrl
} else {
this.form21.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=exlibris&upass=china&key=KEY'
this.form21.value.lookupUrl = '/proxy/cgi-bin/fetch_z311.cgi?uname=proquest&upass=L0china&key=KEY'
}
if (settings.lookupPrefix) {
this.form21.value.lookupPrefix = settings.lookupPrefix
Expand Down
3 changes: 2 additions & 1 deletion cloudapp/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"digits": "digits",
"errorconfigtip": "Please configure the parameters first",
"call-nosub": "Classification field/sub-field",
"Publishedyear": "Pub. Year included in the call-no. "
"Publishedyear": "Pub. Year included in the call-no. "

}
}
2 changes: 2 additions & 0 deletions cloudapp/src/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@
"errorconfigtip": "请先配置各项参数",
"call-nosub": "分类字段/子字段",
"Publishedyear": "索书号含出版年"


}
}

0 comments on commit a489cfd

Please sign in to comment.