1
0
mirror of https://github.com/fumiama/go-nd-portal.git synced 2026-07-02 00:50:25 +08:00

feat: support sh campus login (#6)

- added login type: sh-edu, sh-dx, sh-cmcc
This commit is contained in:
chasey-dev
2025-09-03 12:55:51 +08:00
committed by GitHub
parent f2459dd8d9
commit 4d9b9e1886
4 changed files with 49 additions and 2 deletions

View File

@@ -11,8 +11,22 @@ func TestAutoSelectServerIP(t *testing.T) {
if err != nil {
t.Fatal(err)
}
t.Log(u.sip)
t.Log(LoginTypeQshEdu, u.sip)
assert.Equal(t, PortalServerIPQsh, u.sip)
u, err = NewPortal("2000010101001", "12345678", "", "1.2.3.4", LoginTypeQshDormDX)
if err != nil {
t.Fatal(err)
}
t.Log(LoginTypeQshDormDX, u.sip)
assert.Equal(t, PortalServerIPQshDorm, u.sip)
u, err = NewPortal("2000010101001", "12345678", "", "1.2.3.4", LoginTypeShEdu)
if err != nil {
t.Fatal(err)
}
t.Log(LoginTypeShEdu, u.sip)
assert.Equal(t, PortalServerIPSh, u.sip)
}
func TestResolveLocalClientIP(t *testing.T) {