|
|
|
|
|
|
|
|
import type { RequestConfig } from "@umijs/max"; |
|
|
import type { RequestConfig } from "@umijs/max"; |
|
|
import { message, Modal, Dropdown, MenuProps, theme } from "antd"; |
|
|
import { message, Modal, Dropdown, MenuProps, theme } from "antd"; |
|
|
import { BulbOutlined, LogoutOutlined } from '@ant-design/icons'; |
|
|
import { BulbOutlined, LogoutOutlined } from '@ant-design/icons'; |
|
|
import { baseUrl } from './constants/index' |
|
|
|
|
|
|
|
|
// import { baseUrl } from './constants/index' |
|
|
import routes from '../config/routes' |
|
|
import routes from '../config/routes' |
|
|
import { history } from '@umijs/max'; |
|
|
import { history } from '@umijs/max'; |
|
|
import { |
|
|
import { |
|
|
|
|
|
|
|
|
} from '@ant-design/pro-components'; |
|
|
} from '@ant-design/pro-components'; |
|
|
|
|
|
|
|
|
import { GetUserMenulist } from '@/apis/api'; |
|
|
import { GetUserMenulist } from '@/apis/api'; |
|
|
console.log(process.env) |
|
|
|
|
|
export async function getInitialState(): Promise<{ permissions: object[] }> { |
|
|
export async function getInitialState(): Promise<{ permissions: object[] }> { |
|
|
const token = sessionStorage.getItem('token'); |
|
|
const token = sessionStorage.getItem('token'); |
|
|
let permissions = []; |
|
|
let permissions = []; |
|
|
|
|
|
|
|
|
sessionStorage.setItem('path', location.pathname) |
|
|
sessionStorage.setItem('path', location.pathname) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log(process.env.NODE_ENV) |
|
|
|
|
|
const baseUrl = process.env.NODE_ENV == 'production' ? 'https://admin1.jcjob.cn/api' : 'https://rcsc-test.jcjob.cn/api' |
|
|
|
|
|
|
|
|
export const request: RequestConfig = { |
|
|
export const request: RequestConfig = { |
|
|
baseURL: baseUrl, |
|
|
baseURL: baseUrl, |
|
|
errorConfig: { |
|
|
errorConfig: { |