| | |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | |
| | | const Pay = asyncLoadComponent(() => import('@/views/pay')) |
| | | const Sso = asyncLoadComponent(() => import('@/views/sso')) |
| | | const Main = asyncLoadComponent(() => import('@/views/main')) |
| | | const Login = asyncLoadComponent(() => import('@/views/login')) |
| | | const NotFound = asyncComponent(() => import('@/views/404')) |
| | |
| | | {path: '/login', name: 'login', component: Login, auth: false}, |
| | | {path: '/pay/:param', name: 'pay', component: Pay, auth: false}, |
| | | {path: '/print/:param', name: 'print', component: PrintT, auth: false}, |
| | | {path: '/ssologin/:param', name: 'ssologin', auth: true}, |
| | | {path: '/ssologin/:param', name: 'ssologin', component: Sso, auth: false}, |
| | | {path: '/main', name: 'main', component: Main, auth: true}, |
| | | {path: '/mobmanage', name: 'mobmanage', component: MobManage, auth: true}, |
| | | {path: '/mobdesign/:appId/:appType/:appCode/:appName', name: 'mobdesign', component: MobDesign, auth: true}, |
| | |
| | | |
| | | export default class RouteConfig extends Component { |
| | | controlRoute (item, props) { |
| | | if (!item.auth) { // 不需要授权,直接跳转(登录页) |
| | | if (!item.auth) { // 不需要授权,直接跳转 |
| | | return (<item.component {...props}/>) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | return (<item.component {...props}/>) |
| | | } else if (item.name === 'ssologin') { |
| | | try { |
| | | let _param = JSON.parse(window.decodeURIComponent(window.atob(props.match.params.param))) |
| | | if (typeof(_param) === 'object') { |
| | | if (_param.UserID) { |
| | | sessionStorage.setItem('UserID', _param.UserID) |
| | | } |
| | | if (_param.LoginUID) { |
| | | sessionStorage.setItem('LoginUID', _param.LoginUID) |
| | | } |
| | | if (_param.User_Name) { |
| | | sessionStorage.setItem('User_Name', _param.User_Name) |
| | | } |
| | | } |
| | | } catch { |
| | | console.warn('菜单参数解析错误!') |
| | | } |
| | | |
| | | return (<Redirect to={{ pathname: '/main'}}/>) |
| | | } |
| | | |
| | | let userId = sessionStorage.getItem('UserID') // 判断是否存在userid |