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);
+    }
 }