Commit 4ce5f4e4894275ebaf21e8f826be000a8ba23098

Authored by fangcheng
1 parent 23a289284f
Exists in master

登录问题

Showing 2 changed files with 38 additions and 2 deletions

parent/hospital.web/src/main/java/com/lyms/hospital/controller/LoginController.java View file @ 4ce5f4e
... ... @@ -94,7 +94,10 @@
94 94 }
95 95  
96 96  
97   - @RequestMapping(value = "/tokens", method = RequestMethod.POST)
  97 + @RequestMapping(value = "/tokens")
  98 + @ApiOperation(value = "登录接口", notes = "登录接口")
  99 + @ApiImplicitParams({ @ApiImplicitParam(name = "account", value = "用户account", required = true, dataType = "String"),
  100 + @ApiImplicitParam(name = "password", value = "password", required = true, dataType = "String") })
98 101 @ResponseBody
99 102 public AjaxResult usersLogin(@RequestParam(value = "account") String account,
100 103 @RequestParam(value = "vercode", required = false) String code,
parent/hospital.web/src/main/webapp/WEB-INF/web.xml View file @ 4ce5f4e
... ... @@ -3,7 +3,40 @@
3 3 xmlns="http://java.sun.com/xml/ns/javaee"
4 4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
5 5 metadata-complete="true" version="3.0">
6   -
  6 + <filter>
  7 + <filter-name>CorsFilter</filter-name>
  8 + <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  9 + <init-param>
  10 + <param-name>cors.allowed.origins</param-name>
  11 + <param-value>*</param-value>
  12 + </init-param>
  13 + <init-param>
  14 + <param-name>cors.allowed.methods</param-name>
  15 + <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
  16 + </init-param>
  17 + <init-param>
  18 + <param-name>cors.allowed.headers</param-name>
  19 + <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,authorization</param-value>
  20 + </init-param>
  21 + <init-param>
  22 + <param-name>cors.exposed.headers</param-name>
  23 + <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
  24 + </init-param>
  25 + <init-param>
  26 + <param-name>cors.support.credentials</param-name>
  27 + <param-value>true</param-value>
  28 + </init-param>
  29 + <init-param>
  30 + <param-name>cors.preflight.maxage</param-name>
  31 + <param-value>10</param-value>
  32 + </init-param>
  33 + </filter>
  34 + <filter-mapping>
  35 + <filter-name>CorsFilter</filter-name>
  36 + <url-pattern>/*</url-pattern>
  37 + </filter-mapping>
  38 +
  39 +
7 40 <listener>
8 41 <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
9 42 </listener>