🐛 甘肃农业大学适配

This commit is contained in:
sugarBecomer
2025-11-22 15:28:13 +08:00
parent b5b2103372
commit c3019b741c
2 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ func ActivateSession(ctx context.Context, host string, client *resty.Client) {
defer sessionResponse.Body.Close()
if !sessionResponse.IsSuccess() {
if !sessionResponse.IsSuccess() && sessionResponse.StatusCode() != 502 {
utils.OkOrPanic(errors.NewBusinessError(503, "Session激活失败"),
func(err error) error {
return oops.
@@ -65,7 +65,7 @@ func GetSchoolDetail(ctx context.Context, tenantId string) SchoolDetailInfo {
var ret SchoolDetailInfo
err := sonic.Unmarshal([]byte(redisResult.Val()), &ret)
utils.OkOrPanic(err)
return ret
return parseSpecialSchool(ret)
}
response, err := httpclient.Cpdaily.Clone(ctx).R().
SetHeaders(map[string]string{
@@ -105,5 +105,13 @@ func GetSchoolDetail(ctx context.Context, tenantId string) SchoolDetailInfo {
Wrap(errors.NewBusinessError(503, "学校ID不存在").Decorate("empty school detail")))
}
client.Set(ctx, cst2.RedisSchoolInfo+tenantId, ret[0], time.Duration(cst2.RedisSchoolInfoExpire)*time.Second)
return ret[0]
return parseSpecialSchool(ret[0])
}
func parseSpecialSchool(s SchoolDetailInfo) SchoolDetailInfo {
// 甘肃农业大学
if s.Id == "gsau" {
s.WecloudUrl = "https://fdm.gsau.edu.cn"
}
return s
}