| | |
| | | # COOL_API_BASE_URL = http://localhost:9046 |
| | | COOL_API_BASE_URL = http://127.0.0.1:9046 |
| | | COOL_API_BASE_URL = http://127.0.0.1:9090 |
| | |
| | | |
| | | export const UN_AUTH_CODE = 403; |
| | | |
| | | export const API_BASE_URL = import.meta.env.COOL_API_BASE_URL; |
| | | // export const API_BASE_URL = import.meta.env.COOL_API_BASE_URL; |
| | | export const API_BASE_URL = 'http://localhost:9090/wcs'; |
| | |
| | | Input, |
| | | theme, |
| | | } from 'antd'; |
| | | import React, { useState } from 'react'; |
| | | import React from 'react'; |
| | | import defaultProps from './_defaultProps'; |
| | | import logo from '@/assets/logo.png'; |
| | | import G6 from './G6'; |
| | |
| | | return <div />; |
| | | } |
| | | |
| | | const [menu, setMenu] = useState([]); |
| | | const [menu, setMenu] = React.useState([]); |
| | | |
| | | useEffect(() => { |
| | | React.useEffect(() => { |
| | | getMenuList().then(res => { |
| | | setMenu(res.data); |
| | | }).catch(error => { |
| | |
| | | }, []); |
| | | |
| | | |
| | | const [settings, setSetting] = useState({ |
| | | const [settings, setSetting] = React.useState({ |
| | | fixSiderbar: true, |
| | | layout: 'side', // mix top |
| | | splitMenus: true, |
| | | }); |
| | | const [pathname, setPathname] = useState('/list/sub-page/sub-sub-page1'); |
| | | const [pathname, setPathname] = React.useState('/list/sub-page/sub-sub-page1'); |
| | | |
| | | return ( |
| | | <div |
New file |
| | |
| | | package com.zy.asrs.wcs.common.config; |
| | | |
| | | import com.zy.asrs.wcs.utils.Utils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.AsyncHandlerInterceptor; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-13 |
| | | */ |
| | | @Configuration |
| | | public class WebConfig implements WebMvcConfigurer { |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(getAsyncHandlerInterceptor()) |
| | | .addPathPatterns("/**") |
| | | ; |
| | | } |
| | | |
| | | @Bean |
| | | public AsyncHandlerInterceptor getAsyncHandlerInterceptor() { |
| | | return new AsyncHandlerInterceptor(){ |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | Utils.cors(response); |
| | | return true; |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | |
| | | public class SecurityConfig extends WebSecurityConfigurerAdapter { |
| | | |
| | | public static final String[] FILTER_PATH = new String[]{ |
| | | "/api/**", |
| | | "/test/**", |
| | | "/rpc/**", |
| | | "/api/login", |
| | | "/druid/**", |
| | | "/swagger-ui.html", |
| | |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private Long meunId; |
| | | private Long menuId; |
| | | |
| | | public RoleMenu() {} |
| | | |
| | | public RoleMenu(Long roleId,Long meunId) { |
| | | public RoleMenu(Long roleId,Long menuId) { |
| | | this.roleId = roleId; |
| | | this.meunId = meunId; |
| | | this.menuId = menuId; |
| | | } |
| | | |
| | | // RoleMenu roleMenu = new RoleMenu( |
| | |
| | | |
| | | import com.zy.asrs.framework.common.Cools; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | |
| | | } |
| | | } |
| | | |
| | | public static void cors(HttpServletResponse response){ |
| | | // 跨域设置 |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | response.setHeader("Access-Control-Allow-Methods", "*"); |
| | | response.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token,Authorization"); |
| | | response.setHeader("Access-Control-Expose-Headers", "*"); |
| | | } |
| | | |
| | | } |
| | |
| | | select menu_id from sys_role_menu |
| | | where role_id in ( |
| | | select sur.role_id from sys_user_role sur |
| | | left join sys_role sr on sur.role_id = sr.role_id |
| | | left join sys_role sr on sur.role_id = sr.id |
| | | where 1=1 |
| | | and sur.user_id = #{userId} |
| | | and sr.deleted = 0 |