CHENYIZONG 6 лет назад
Родитель
Сommit
98b8a65a62

+ 3 - 0
src/main/java/com/example/hotel/controller/user/AccountController.java

@@ -6,6 +6,7 @@ import com.example.hotel.vo.UserForm;
 import com.example.hotel.vo.ResponseVO;
 import com.example.hotel.vo.UserVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
@@ -18,6 +19,8 @@ public class AccountController {
     private final static String ACCOUNT_INFO_ERROR="用户名或密码错误";
     @Autowired
     private AccountServiceImpl accountService;
+
+    @CrossOrigin
     @PostMapping("/login")
     public ResponseVO login(@RequestBody UserForm userForm, HttpSession session){
         UserVO user = accountService.login(userForm);