| | |
| | | import { getRemoteMenu, getRoutersInfo, getUserInfo, setRemoteMenu, patchRouteWithRemoteMenus } from './services/route'; |
| | | import { getToken, setToken } from '@/utils/token-util' |
| | | import { TOKEN_HEADER_NAME, TOKEN_STORE_NAME } from '@/config/setting'; |
| | | import { API_BASE_URL } from '@/config/setting' |
| | | import { API_BASE_URL, API_TIMEOUT } from '@/config/setting' |
| | | import { message } from 'antd'; |
| | | |
| | | import logo from '../public/img/logo.png' |
| | |
| | | export const request = { |
| | | baseURL: API_BASE_URL, |
| | | ...errorConfig, |
| | | timeout: 60000, |
| | | timeout: API_TIMEOUT * 1000, |
| | | // 前置守卫 |
| | | requestInterceptors: [ |
| | | (url, options) => { |
| | |
| | | // 接口地址 |
| | | export const API_BASE_URL: string = 'http://127.0.0.1:9090/wcs'; |
| | | |
| | | export const API_TIMEOUT: number = 60; |
| | | |
| | | // 项目名称 |
| | | export const PROJECT_NAME: string = 'admin'; |
| | | |
| | |
| | | 'common.fail':'Fail', |
| | | 'common.account.logout': 'Logout', |
| | | 'common.search.placeholder': 'Please enter search content', |
| | | 'common.loading.api.message': 'Calling Server...', |
| | | '':'', |
| | | '':'', |
| | | '':'', |
| | |
| | | border-radius: 0px !important; |
| | | } |
| | | |
| | | .map-header-button { |
| | | border-radius: 0px !important; |
| | | font-weight: bolder !important; |
| | | } |
| | | |
| | | .map-header-select.ant-select .ant-select-selector .ant-select-selection-item { |
| | | font-weight: bolder !important; |
| | | } |
| | | |
| | | .map-header-select .ant-select-selector .ant-select-selection-search .ant-select-selection-search-input { |
| | | font-weight: bolder !important; |
| | | } |
| | | } |
| | |
| | | {model !== MapModel.OBSERVER_MODEL && ( |
| | | <> |
| | | <Button |
| | | className='map-header-button' |
| | | size={'large'} |
| | | onClick={() => { |
| | | Utils.saveMapData(); |
| | | Utils.saveMapData(intl); |
| | | }} |
| | | > |
| | | <FormattedMessage id='map.save' defaultMessage='保存地图' /> |
| | |
| | | import * as PIXI from 'pixi.js'; |
| | | import * as TWEEDLE from 'tweedle.js'; |
| | | import Http from '@/utils/http'; |
| | | import { message } from 'antd'; |
| | | import { API_TIMEOUT } from '@/config/setting' |
| | | |
| | | let app = null; |
| | | let mapContainer = null; |
| | |
| | | |
| | | } |
| | | |
| | | export const saveMapData = async () => { |
| | | export const saveMapData = async (intl) => { |
| | | if (!mapContainer) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | }) |
| | | |
| | | const resp = await Http.doPost('api/map/save', { itemList: mapItemList }) |
| | | console.log(resp); |
| | | const closeLoading = message.loading({ content: intl.formatMessage({ id: 'common.loading.api.message', defaultMessage: '等待服务器......' }), duration: API_TIMEOUT }); |
| | | await Http.doPostPromise('api/map/save', { itemList: mapItemList }, (res) => { |
| | | closeLoading(); |
| | | console.log(res); |
| | | }).catch((error) => { |
| | | closeLoading(); |
| | | console.error(error); |
| | | }) |
| | | } |