yonge 5 سال پیش
والد
کامیت
9320e2feba
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

+ 5 - 0
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -7,6 +7,7 @@ import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
+import org.springframework.security.core.Authentication;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -94,4 +95,8 @@ public class IndexController extends BaseController {
 		return succeed(model);
 	}
 
+	@GetMapping(value = "/username")
+    public Object currentUserName(Authentication authentication) {
+        return succeed(authentication);
+    }
 }