职站河海自动识别

master
yujialong 3 years ago
parent f2d791bddd
commit 621580c173
  1. BIN
      public/favicon.ico
  2. BIN
      src/assets/img/logo-hh.png
  3. 9
      src/components/codemirror.vue
  4. 11
      src/config/index.js
  5. 10
      src/utils/api.js
  6. 4
      src/utils/http.js
  7. 24
      src/views/Home.vue

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@ -1,6 +1,6 @@
<template> <template>
<div style="display:flex;"> <div style="display:flex;">
<div style="position:relative;width: 100%;" class="button"> <div class="left">
<codemirror <codemirror
v-model="exampleData" v-model="exampleData"
:value="codeid" :value="codeid"
@ -324,7 +324,8 @@ export default {
} }
} }
}) })
.catch(err => { .catch(res => {
res.status == 500 && this.$message.error('检测到代码里有非法代码,请检查是否有调用系统命令。')
this.loadIns.close() this.loadIns.close()
}); });
clearTimeout(this.timer); clearTimeout(this.timer);
@ -366,6 +367,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.left{
position: relative;
width: calc(100% - 400px);
}
.text-wrapper { .text-wrapper {
white-space: pre-wrap; white-space: pre-wrap;
} }

@ -1,8 +1,17 @@
const isHh = location.host.includes('10.196.131.73') //是否是河海版本
export default { export default {
/**
* @description 域名切换liuwan职站测试环境occupationlab.com职站正式环境10.196.131.73河海版本
*/
host: (process.env.NODE_ENV === 'development' || location.host.includes('liuwanr.cn')) ? 'http://www.liuwanr.cn/' : (location.host.includes('10.196.131.73') ? 'http://10.196.131.73/' : 'http://www.occupationlab.com/'),
/**
* @description 是否是河海版本
*/
isHh,
/** /**
* @description 配置显示在浏览器标签的title * @description 配置显示在浏览器标签的title
*/ */
title: '经济金融建模实验教学系统', title: isHh ? '智信云经济金融建模实验教学系统' : '经济金融建模实验教学系统',
/** /**
* @description 是否使用国际化默认为false * @description 是否使用国际化默认为false
* 如果不使用则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'} * 如果不使用则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}

@ -1,11 +1,5 @@
// let host = 'http://192.168.31.125:8081/python'//林 import config from '@/config'
// let host = 'http://192.168.31.152:8081/python'//榕 let host = `${config.host}python`
let host = ''
if(location.host.includes('liuwanr.cn') || process.env.NODE_ENV === 'development'){
host = 'http://www.liuwanr.cn/python'
}else{
host = 'http://www.occupationlab.com/python'
}
export default { export default {
QueryProject: `${host}/python/queryProject`, //项目选择下拉框+项目信息+判分点信息展示 QueryProject: `${host}/python/queryProject`, //项目选择下拉框+项目信息+判分点信息展示

@ -185,9 +185,7 @@ export function post(url, params) {
); );
break; break;
case 500: case 500:
this.$message.error( reject(res.data)
res.data.errmessage
);
break; break;
case 404: case 404:
this.$message.error( this.$message.error(

@ -1,13 +1,15 @@
<template> <template>
<div> <div>
<div class="flex header"> <div class="flex header" :class="{hh: $config.isHh}">
<p>{{$config.title}}</p> <img v-if="$config.isHh" src="../assets/img/logo-hh.png" alt="" class="logo">
<p v-else>{{$config.title}}</p>
<div class="bt"> <div class="bt">
<el-button type="primary" @click="back()">退出实验</el-button> <el-button type="primary" @click="back()">退出实验</el-button>
</div> </div>
</div> </div>
<div class="flex center"> <div class="flex center">
<p v-if="$config.isHh" style="font-size: 18px">{{$config.title}}</p>
<p>编程语言</p> <p>编程语言</p>
<el-input placeholder="请输入内容" v-model="value" :disabled="true"></el-input> <el-input placeholder="请输入内容" v-model="value" :disabled="true"></el-input>
</div> </div>
@ -112,7 +114,7 @@ export default {
? parseInt(sessionStorage.getItem("timer")) ? parseInt(sessionStorage.getItem("timer"))
: 0, : 0,
codeKey: 1, codeKey: 1,
host: location.host.includes('liuwanr.cn') ? 'http://www.liuwanr.cn/' : 'http://www.occupationlab.com/' host: this.$config.host
}; };
}, },
components: { components: {
@ -188,17 +190,9 @@ export default {
back() { back() {
this.leavePage() this.leavePage()
if(this.projectPermissions){ if(this.projectPermissions){
if(location.host.includes('liuwanr.cn')){ location.href = `${this.host}#/dashboard#2`
location.href = `http://www.liuwanr.cn/#/dashboard#2`
}else{ }else{
location.href = `http://www.occupationlab.com/#/dashboard#2` location.href = `${this.host}#/dashboard#1`
}
}else{
if(location.host.includes('liuwanr.cn')){
location.href = `http://www.liuwanr.cn/#/dashboard#1`
}else{
location.href = `http://www.occupationlab.com/#/dashboard#1`
}
} }
this.$refs.mainindex.getClearTime(); this.$refs.mainindex.getClearTime();
}, },
@ -364,6 +358,10 @@ export default {
justify-content: space-between; justify-content: space-between;
height: 58px; height: 58px;
line-height: 58px; line-height: 58px;
.logo{
width: 200px;
margin-left: 10px;
}
} }
// //
p { p {

Loading…
Cancel
Save