From d977e05a3d74230bcd36e1caf9994fa279bb79a3 Mon Sep 17 00:00:00 2001 From: Hongwei Peng Date: Wed, 17 Jul 2019 21:17:23 +0800 Subject: [PATCH] fix bug and enhance --- src/main/java/me/zhyd/oauth/model/AuthUserGender.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/zhyd/oauth/model/AuthUserGender.java b/src/main/java/me/zhyd/oauth/model/AuthUserGender.java index 910a66a..c3d6824 100644 --- a/src/main/java/me/zhyd/oauth/model/AuthUserGender.java +++ b/src/main/java/me/zhyd/oauth/model/AuthUserGender.java @@ -23,12 +23,12 @@ public enum AuthUserGender { if (code == null) { return UNKNOW; } - String[] males = {"m", "男", "1", "male", "F"}; - if (Arrays.asList(males).contains(code)) { + String[] males = {"m", "男", "1", "male"}; + if (Arrays.asList(males).contains(code.toLowerCase())) { return MALE; } String[] females = {"f", "女", "0", "female"}; - if (Arrays.asList(females).contains(code)) { + if (Arrays.asList(females).contains(code.toLowerCase())) { return FEMALE; } return UNKNOW; -- GitLab