diff --git a/src/App.vue b/src/App.vue index 38982f264..0c530e84a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,6 +3,16 @@ +
+ +
@@ -13,6 +23,7 @@ import { loginInfo, ProjectIcon } from '@/scripts/ProjectConfig'; import DeomonTopic from '@/views/demonstration/deomonTopic'; import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import LoadingImg from '@/assets/loading.gif'; +import AppLoading from '@/assets/appLoading.png'; import { openIndexedDB } from '@/utils/indexedDb'; export default { @@ -26,6 +37,7 @@ export default { data() { return { loadingImg: LoadingImg, + appLoading: AppLoading, loading: false }; }, @@ -113,4 +125,13 @@ export default { diff --git a/src/api/projectServer.js b/src/api/projectServer.js new file mode 100644 index 000000000..7b266b6ea --- /dev/null +++ b/src/api/projectServer.js @@ -0,0 +1,40 @@ +import request from '@/utils/request'; + +/** 获取请求baseURL */ +export function getBaseUrlByProject(project) { + return request({ + url: `/api/projectServer/project/${project}`, + method: 'get' + }); +} +/** 分页查询项目服务器 */ +export function projectServerPaging(params) { + return request({ + url: `/api/projectServer/paging`, + method: 'get', + params + }); +} +/** 创建项目服务器数据 */ +export function createProjectServer(data) { + return request({ + url: `/api/projectServer`, + method: 'post', + data + }); +} +/** 修改项目服务器数据 */ +export function updateProjectServer(id, data) { + return request({ + url: `/api/projectServer/${id}`, + method: 'put', + data + }); +} +/** 删除项目服务器数据 */ +export function deleteProjectServer(id) { + return request({ + url: `/api/projectServer/${id}`, + method: 'delete' + }); +} diff --git a/src/assets/appLoading.png b/src/assets/appLoading.png new file mode 100644 index 000000000..70efcc116 Binary files /dev/null and b/src/assets/appLoading.png differ diff --git a/src/i18n/langs/en/router.js b/src/i18n/langs/en/router.js index 8d379f7bf..723edc0dc 100644 --- a/src/i18n/langs/en/router.js +++ b/src/i18n/langs/en/router.js @@ -99,5 +99,6 @@ export default { publishISCSManage:'publish ISCS Manage', voiceTraining: 'Voice Training', mapGroup: 'Map Group', - drawingMange:'Drawing Mange' + drawingMange:'Drawing Mange', + projectServer: 'Project Server' }; diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index a8faa5bd5..7cede752b 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -103,5 +103,6 @@ export default { publishISCSManage:'发布ISCS管理', voiceTraining: '语音训练', mapGroup: '地图分组', - drawingMange:'图纸管理' + drawingMange:'图纸管理', + projectServer: '项目域名' }; diff --git a/src/permission.js b/src/permission.js index 4ca73633e..6dffff552 100644 --- a/src/permission.js +++ b/src/permission.js @@ -1,11 +1,13 @@ import Vue from 'vue'; import store from '@/store/index'; import router from './router/index'; -import {loginInfo} from '@/scripts/ProjectConfig'; +import {loginInfo, ProjectCode, localPackageProject} from '@/scripts/ProjectConfig'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; import { setToken, getToken, removeToken, getSessionStorage } from '@/utils/auth'; +import { getBaseUrlByProject } from '@/api/projectServer'; import localStore from 'storejs'; +import { getBaseUrl } from '@/utils/baseUrl'; const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单 @@ -66,8 +68,31 @@ function handleRoute(to, next, loginPath) { } } -router.beforeEach((to, from, next) => { - const project = getSessionStorage('project'); +router.beforeEach( async (to, from, next) => { + let project = ''; + if (to.path.includes('login')) { + project = to.query.project; + const split = to.path.split('/')[1]; + if (process.env.VUE_APP_PRO) { + project = localPackageProject[process.env.VUE_APP_PRO + split]; + } else if (split == 'design') { + project = project ? split + project : split; + } else if (split == 'login') { + project = project || 'login'; + } else { + project = split; + } + } else { + project = getSessionStorage('project'); + } + if (!store.state.user.baseUrl) { + const resp = await getBaseUrlByProject(ProjectCode[project]); + if (resp && resp.data && resp.data.domainName) { + store.dispatch('setBaseUrl', resp.data.domainName); + } else { + store.dispatch('setBaseUrl', getBaseUrl()); + } + } document.title = loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title; NProgress.start(); const loginPath = getRouteInfo(to); diff --git a/src/router/index.js b/src/router/index.js index 2c27c95ea..7fe08c896 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -21,8 +21,6 @@ const Jlmap3dZzwwTest = () => import('@/views/jlmap3d/otherproject/zzww/zzwwtest const XzExam = () => import('@/views/jlmap3d/otherproject/xzexam/xzexam'); const LcJy = () => import('@/views/jlmap3d/otherproject/xzexam/lcjy'); - - const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive'); const Jlmap3dSandbox = () => import('@/views/jlmap3d/simulation/jl3dsimulation'); const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow'); @@ -193,6 +191,7 @@ const UeditorDraftList = () => import('@/views/editor/listDraft'); const UploadPdfList = () => import('@/views/uploadPdf/list'); const ThirdLogin = () => import('@/views/thirdLogin'); +const ProjectServer = () => import('@/views/system/serverManage'); // import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { getSessionStorage } from '@/utils/auth'; @@ -1203,6 +1202,13 @@ export const asyncRouter = [ meta: { i18n: 'router.voiceTraining' } + }, + { + path: 'projectServer', + component: ProjectServer, + meta: { + i18n: 'router.projectServer' + } } // { // path: 'deviceManage', diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 208ce6f86..7c80b1ce9 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,10 +2,10 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.8.152:9000'; // 袁琪 // BASE_API = 'http://192.168.8.172:9200'; // 旭强 - // BASE_API = 'http://192.168.8.109:9000'; // 张赛 + BASE_API = 'http://192.168.8.109:9000'; // 张赛 // BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/utils/request.js b/src/utils/request.js index 0e004c128..2a5ad9f77 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -19,7 +19,7 @@ const service = axios.create({ timeout: 600000 // 请求超时时间 }); -// request拦截器 +// request拦截器108 service.interceptors.request.use(config => { if (getToken()) { config.headers['X-Token'] = getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改 diff --git a/src/views/login/index.vue b/src/views/login/index.vue index a2fb0c9ac..0ff62a1e5 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -593,7 +593,7 @@ export default { }); } else if (this.project === 'zzwwtest') { this.$router.push({ path: '/jlmap3d/zzwwtest', query: {lessonId:'35'} }); - }else if (this.project === 'xzexam') { + } else if (this.project === 'xzexam') { this.$router.push({ path: '/jlmap3d/xzexam', query: {} }); } else if (this.project === 'richorlesson3d') { this.$router.push({ path: '/jlmap3d/lesson3dselect', query: {} }); diff --git a/src/views/system/serverManage/add.vue b/src/views/system/serverManage/add.vue new file mode 100644 index 000000000..5893252d0 --- /dev/null +++ b/src/views/system/serverManage/add.vue @@ -0,0 +1,110 @@ + + + diff --git a/src/views/system/serverManage/index.vue b/src/views/system/serverManage/index.vue new file mode 100644 index 000000000..d94cb2698 --- /dev/null +++ b/src/views/system/serverManage/index.vue @@ -0,0 +1,163 @@ + + +