master
yujialong 5 months ago
parent 190bfe4fb8
commit 9f816354a2
  1. 3
      src/api/http.js
  2. 7
      src/config/index.js
  3. 95
      src/views/Home.vue

@ -5,6 +5,7 @@ import {
import router from '../router/index' import router from '../router/index'
import Cookie from 'js-cookie' import Cookie from 'js-cookie'
import config from '@/config' import config from '@/config'
import Util from '@/util'
const service = axios.create({ const service = axios.create({
baseURL: config.host, baseURL: config.host,
@ -42,7 +43,7 @@ service.interceptors.response.use(
if (!logouted) { if (!logouted) {
Message.error(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!') Message.error(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => { setTimeout(() => {
history.back() Util.exit()
}, 1500) }, 1500)
logouted = 1 logouted = 1
} }

@ -2,8 +2,7 @@ import Cookie from 'js-cookie'
const url = location.host const url = location.host
const isDev = process.env.NODE_ENV === 'development' //是否本地 const isDev = process.env.NODE_ENV === 'development' //是否本地
// const isTest = url.includes('121.37.12.51') //测试服 const isTest = url.includes('121.37.12.51') //测试服
const isTest = true //测试服
const isHh = url.includes('10.196.131.73') //是否是河海版本 const isHh = url.includes('10.196.131.73') //是否是河海版本
const isPro = url.includes('occupationlab.com') //是否职站生产 const isPro = url.includes('occupationlab.com') //是否职站生产
const isZxy = url.includes('izhixinyun.com') //是否智信云 const isZxy = url.includes('izhixinyun.com') //是否智信云
@ -14,8 +13,8 @@ let host = location.origin + '/'
let bankPath = `${location.origin}/banksystem` // 银行系统 let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151 // 121.37.12.51 | 192.168.31.151
if (isDev) { if (isDev) {
host = 'http://192.168.31.51:9000/' host = 'http://192.168.31.217:9000/'
// host = 'http://121.37.12.51:9000/' host = 'http://121.37.12.51:9000/'
// host = 'https://occupationlab.com/' // host = 'https://occupationlab.com/'
bankPath = `http://${location.hostname}:8093` bankPath = `http://${location.hostname}:8093`
} else if (isPro) { } else if (isPro) {

@ -3,9 +3,13 @@
<div class="header" :class="{ hh: $config.isHh }"> <div class="header" :class="{ hh: $config.isHh }">
<img v-if="$config.isHh" src="@/assets/images/logo-hh.png" alt="" class="logo"> <img v-if="$config.isHh" src="@/assets/images/logo-hh.png" alt="" class="logo">
<p v-else>{{ curriculumName }}</p> <p v-else>{{ curriculumName }}</p>
<p v-if="isAI">账号{{ account }}密码112233aa</p>
<el-button class="back btn" type="primary" @click="back">退出实验</el-button> <el-button class="back btn" type="primary" @click="back">退出实验</el-button>
</div> </div>
<template v-if="!notAllowed"> <template v-if="isAI">
<iframe class="AI" src="https://ai.huorantech.cn/" frameborder="0" width="100%"></iframe>
</template>
<template v-else-if="!notAllowed">
<div class="top"> <div class="top">
<div class="language"> <div class="language">
<p v-if="$config.isHh" style="font-size: 18px">{{ $config.title }}</p> <p v-if="$config.isHh" style="font-size: 18px">{{ $config.title }}</p>
@ -61,6 +65,7 @@ export default {
data () { data () {
return { return {
Config, Config,
isAI: Cookie.get('admin-isAI') == 'true' ? true : false,
isSubmit: Cookie.get('admin-isSubmit') == 'true' ? true : false, // isSubmit: Cookie.get('admin-isSubmit') == 'true' ? true : false, //
loaded: false, // loaded: false, //
loadIns: null, // loading loadIns: null, // loading
@ -70,7 +75,7 @@ export default {
curriculumName: Cookie.get('admin-curriculumName') ? decodeURIComponent(Cookie.get('admin-curriculumName')) : 'python', // curriculumName: Cookie.get('admin-curriculumName') ? decodeURIComponent(Cookie.get('admin-curriculumName')) : 'python', //
assessmentId: Cookie.get('admin-assessmentId'), // id assessmentId: Cookie.get('admin-assessmentId'), // id
mallId: Cookie.get('admin-mallId'), mallId: Cookie.get('admin-mallId'),
language: Cookie.get('admin-language') || 'python3.7.9', // language: Cookie.get('admin-language') || 'python3.10.9', //
projectId: '', projectId: '',
systemId: '', systemId: '',
modelIsShow: false, // modelIsShow: false, //
@ -83,7 +88,7 @@ export default {
name: 'python3.9' name: 'python3.9'
}, },
{ {
name: 'python3.10' name: 'python3.10.9'
}, },
{ {
name: 'python3.12.4' name: 'python3.12.4'
@ -96,6 +101,7 @@ export default {
workbench: [], // workbench: [], //
codeKey: 1, // codeKey: 1, //
notAllowed: 1, notAllowed: 1,
account: '',
}; };
}, },
components: { components: {
@ -103,42 +109,58 @@ export default {
testPanel testPanel
}, },
mounted () { mounted () {
Cookie.get('admin-language') || Cookie.set('admin-language', 'python3.7.9') if (this.isAI) {
// const opened = +localStorage.getItem('opened') this.handleAI()
// if (opened) { document.body.style.overflow = 'hidden'
// localStorage.setItem('opened', opened + 1) this.loaded = true
// this.$alert('', '', { } else {
// confirmButtonText: '退', Cookie.set('admin-language', 'python3.10.9')
// showClose: false, // const opened = +localStorage.getItem('opened')
// beforeClose: () => { // if (opened) {
// Util.exit() // localStorage.setItem('opened', opened + 1)
// }, // this.$alert('', '', {
// }) // confirmButtonText: '退',
// } else { // showClose: false,
// this.notAllowed = 0 // beforeClose: () => {
// localStorage.setItem('opened', 1) // Util.exit()
// } // },
this.notAllowed = 0 // })
// } else {
document.onkeydown = function (event) { // this.notAllowed = 0
var e = event || window.event || arguments.callee.caller.arguments[0]; // localStorage.setItem('opened', 1)
// }
if (e && e.keyCode == 123) { this.notAllowed = 0
e.returnValue = false;
return (false); document.onkeydown = function (event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode == 123) {
e.returnValue = false;
return (false);
}
} }
}
this.loadIns = Loading.service({ this.loadIns = Loading.service({
background: 'rgba(255, 255, 255, .1)' background: 'rgba(255, 255, 255, .1)'
}) })
// //
newmain.$on("isSubmit", isSubmit => { newmain.$on("isSubmit", isSubmit => {
this.isSubmit = isSubmit this.isSubmit = isSubmit
}) })
}
this.autoLogout() this.autoLogout()
}, },
methods: { methods: {
// ai
async handleAI () {
const res = await this.$get(`${this.api.getTheMostRecentlyRunProject}`, {
ai: 1,
cid: Cookie.get('admin-courseId')
})
if (res.account) {
this.account = res.account
}
},
// //
getModelStatus (systemId) { getModelStatus (systemId) {
this.$post(`${this.api.displayListOrNotByStudent}?systemId=${systemId}`).then(res => { this.$post(`${this.api.displayListOrNotByStudent}?systemId=${systemId}`).then(res => {
@ -230,6 +252,7 @@ export default {
margin-left: 10px; margin-left: 10px;
} }
.back { .back {
padding: 23px 50px; padding: 23px 50px;
border: none; border: none;
@ -237,6 +260,10 @@ export default {
} }
} }
.AI {
height: calc(100vh - 58px);
}
/deep/.top { /deep/.top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

Loading…
Cancel
Save