-
+
@@ -92,9 +92,9 @@ export default {
}
},
methods: {
- toggleSideBar() {
- this.$store.dispatch('app/toggleSideBar')
- },
+ // toggleSideBar() {
+ // this.$store.dispatch('app/toggleSideBar')
+ // },
async logout() {
this.$confirm('确定注销并退出系统吗?', '提示', {
confirmButtonText: '确定',
diff --git a/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue b/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
index 4252aa4..c0f13a6 100644
--- a/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
+++ b/ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
@@ -63,21 +63,27 @@ export default {
if (!children) {
children = []
}
+
const showingChildren = children.filter(item => {
+
if (item.hidden) {
+
return false
} else {
+
// Temp set(will be used if only has one showing child)
this.onlyOneChild = item
return true
}
})
// When there is only one child router, the child router is displayed by default
- if (showingChildren.length === 1) {
+ if (showingChildren.length == 1) {
+ console.log(this.item,"onlyOneChild");
return true
}
// Show parent if there are no child router to display
if (showingChildren.length === 0) {
+
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
return true
}
diff --git a/ruoyi-ui/src/layout/components/Sidebar/index.vue b/ruoyi-ui/src/layout/components/Sidebar/index.vue
index 1c450f5..f5a9731 100644
--- a/ruoyi-ui/src/layout/components/Sidebar/index.vue
+++ b/ruoyi-ui/src/layout/components/Sidebar/index.vue
@@ -68,7 +68,8 @@ export default {
return variables;
},
isCollapse() {
- return !this.sidebar.opened;
+ // return !this.sidebar.opened;
+ return false
},
},
data() {
diff --git a/ruoyi-ui/src/layout/index.vue b/ruoyi-ui/src/layout/index.vue
index 5356b35..eaca450 100644
--- a/ruoyi-ui/src/layout/index.vue
+++ b/ruoyi-ui/src/layout/index.vue
@@ -45,8 +45,8 @@ export default {
classObj() {
console.log(this.sidebar,"sidebar");
return {
- hideSidebar: !this.sidebar.opened,
- openSidebar: this.sidebar.opened,
+ // hideSidebar: !this.sidebar.opened,
+ // openSidebar: this.sidebar.opened,
withoutAnimation: this.sidebar.withoutAnimation,
mobile: this.device === 'mobile'
}
diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js
index a21d754..f8ebd40 100644
--- a/ruoyi-ui/src/permission.js
+++ b/ruoyi-ui/src/permission.js
@@ -3,12 +3,14 @@ import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
-import { getToken, getroleId } from '@/utils/auth'
+import { getToken, getroleId ,getusername,removememberId,getmemberId} from '@/utils/auth'
import { getRouters } from '@/api/menu'
import { isRelogin } from '@/utils/request'
import { addRoutes } from '@/router'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register']
+// 不发送请求白名单
+const whiteList1 = ['/student/training/List', '/student/index']
var datas = []
router.beforeEach((to, from, next) => {
@@ -25,9 +27,25 @@ router.beforeEach((to, from, next) => {
// // router.push({ path: '/teacher' })
// // } else if (getroleId() === 3) {
// router.push({ path: '/student/index' })
+ // console.log(to.path, "to.path");
// // }
// }
+ next()
+ if( getroleId ()== 4){
+ if(to.path =="/student/training/List" || to.path == '/student/index'){
+ removememberId()
+ next()
+ }else{
+ if(to.path =="/student/training/homepageage" || to.path == '/student/transactionRecords'|| to.path =='/student/training/index' || to.path=='/student/training/homepageage'){
+ return next()
+ }else{
+ store.dispatch('GetMemberId',getusername()).then(res=>{
+ } )
+ }
+
+ }
next()
+ }
// to.meta.title && store.dispatch('settings/setTitle', "外汇模拟交易")
/* has token*/
// if (to.path === '/login') {
diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js
index 04f34b1..8977cb3 100644
--- a/ruoyi-ui/src/router/index.js
+++ b/ruoyi-ui/src/router/index.js
@@ -99,26 +99,33 @@ export const dynamicRoutes = [{
children: [
{
path: 'index',
+ name: 'index',
component: () => import('@/views/index'),
- name: 'Index',
- meta: { title: '首页', icon: 'dashboard', affix: true }
- }
- ]
-},
-{
- path: '/student/transactionRecords',
- component: Layout,
- hidden: true,
- permissions: ['system:user:edit'],
- children: [
+ meta: {
+ title: '首页', affix: true, title: '首页',
+ icon: 'dashboard'
+ },
+ },
{
- path: 'index',
+ path: 'homepagege',
+ name: 'homepagege',
+ hidden: true,
+ component: () => import('@/views/PracticeZone/index.vue'),
+ meta: { title: '练习专区', affix: true,activeMenu: '/student/index' }
+ },
+ {
+ path: 'transactionRecords',
component: () => import('@/views/transactionRecords/index'),
name: 'transactionRecords',
+ hidden: true,
meta: { title: '交易记录', icon: 'null', affix: true, activeMenu: '/student/index' }
- }
+ },
+
+ // 练习专区
+
]
},
+
{
path: '/student/training',
component: Layout,
@@ -130,62 +137,98 @@ export const dynamicRoutes = [{
component: () => import('@/views/training/index'),
name: 'training',
meta: { title: '实训任务', icon: 'quest', affix: true }
- }
- ]
-},
-{
- path: '/student/task',
- component: Layout,
- hidden: true,
- permissions: ['system:user:edit'],
- children: [
+ },
{
path: 'homepageage',
+ hidden: true,
component: () => import('@/views/task/index'),
name: 'homepageage',
meta: { title: '任务主页', affix: true, activeMenu: '/student/training/List' }
+ },
+ {
+ path: 'index',
+ component: () => import('@/views/trade/index.vue'),
+ name: 'Index',
+ hidden: true,
+ meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
}
]
},
+// {
+// path: '/student/task',
+// component: Layout,
+// hidden: true,
+// permissions: ['system:user:edit'],
+// children: [
+// {
+// path: 'homepageage',
+// component: () => import('@/views/task/index'),
+// name: 'homepageage',
+// meta: { title: '任务主页', affix: true, activeMenu: '/student/training/List' }
+// }
+// ]
+// },
{
path: '/student/PracticeZone',
component: Layout,
- hidden: true,
+ hidden: false,
permissions: ['system:user:edit'],
children: [
{
path: 'homepagege',
component: () => import('@/views/PracticeZone/index.vue'),
name: 'PracticeZone',
- meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
+ meta: { title: '练习专区', affix: true, icon: 'exercise' }
+ },
+ {
+ path: 'index',
+ component: () => import('@/views/trade/index.vue'),
+ name: 'Index',
+ hidden: true,
+ meta: { title: '练习专区', affix: true, activeMenu: '/student/PracticeZone/homepagege' }
}
]
},
+// {
+// path: '/student/trade',
+// component: Layout,
+// hidden: true,
+// permissions: ['system:user:edit'],
+// children: [
+// {
+// path: 'index',
+// component: () => import('@/views/trade/index.vue'),
+// name: 'Index',
+// meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
+// }
+// ]
+// },
{
- path: '/student/trade',
+ path: '/student/transactionRecords',
component: Layout,
- hidden: true,
+ hidden: false,
permissions: ['system:user:edit'],
children: [
{
path: 'index',
- component: () => import('@/views/trade/index.vue'),
- name: 'Index',
- meta: { title: '练习专区', affix: true, activeMenu: '/student/training/List' }
+ component: () => import('@/views/transactionRecords/index'),
+ name: 'transactionRecords',
+ meta: { title: '交易记录', icon: 'deal', affix: true, }
}
]
},
+// 系统预警
{
- path: '/student/teachingPlan',
+ path: '/student/systemWarning',
component: Layout,
hidden: false,
permissions: ['system:user:edit'],
children: [
{
- path: 'case',
- component: () => import('@/views/teachingpan/index.vue'),
- name: 'teachingPlan',
- meta: { title: '实训教案', icon: 'teachingplan', affix: true }
+ path: 'index',
+ component: () => import('@/views/systemWarning/index'),
+ name: 'systemWarning',
+ meta: { title: '系统预警', icon: 'early', affix: true }
}
]
},
@@ -203,6 +246,21 @@ export const dynamicRoutes = [{
}
]
},
+{
+ path: '/student/teachingPlan',
+ component: Layout,
+ hidden: false,
+ permissions: ['system:user:edit'],
+ children: [
+ {
+ path: 'case',
+ component: () => import('@/views/teachingpan/index.vue'),
+ name: 'teachingPlan',
+ meta: { title: '实训教案', icon: 'teachingplan', affix: true }
+ }
+ ]
+},
+
{
path: '/system/user-auth',
component: Layout,
@@ -277,7 +335,7 @@ export const dynamicRoutes = [{
]
// 教师端路由
export const teacher = [
- {
+ {
path: '/teacher',
component: Layout,
redirect: 'ageIssue',
@@ -329,7 +387,7 @@ export const teacher = [
path: 'testreport',
component: () => import('@/views/task/report.vue'),
name: 'testreport',
- meta: { icon: 'teachingplan', affix: true ,activeMenu: '/teacher/index'}
+ meta: { icon: 'teachingplan', affix: true, activeMenu: '/teacher/index' }
}
]
},
diff --git a/ruoyi-ui/src/store/modules/user.js b/ruoyi-ui/src/store/modules/user.js
index ae1644d..2db16d1 100644
--- a/ruoyi-ui/src/store/modules/user.js
+++ b/ruoyi-ui/src/store/modules/user.js
@@ -1,4 +1,4 @@
-import { login, logout, getInfo } from '@/api/login'
+import { login, logout, getInfo,getMemberId } from '@/api/login'
import * as cookie from '@/utils/auth'
const user = {
@@ -8,6 +8,7 @@ const user = {
schoolId: cookie.getschoolId(),
classid: '',
memberId: cookie.getmemberId() ,
+ username: cookie.getusername(),
trainingId: '',
roles: [],
permissions: []
@@ -37,6 +38,9 @@ const user = {
},
SET_TRAININGID: (state, trainingId) => {
state.trainingId = trainingId
+ },
+ SET_USERNAME: (state, username) => {
+ state.username = username
}
},
actions: {
@@ -51,11 +55,13 @@ const user = {
cookie.setname(res.data.name)
cookie.setschoolId(res.data.schoolId)
cookie.setroleId(res.data.roleId)
+ cookie.setusername(res.data.username)
const avatar = (user.avatar == '' || user.avatar == null) ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar
commit('SET_TOKEN', res.data.accessToken)
commit('SET_NAME', res.data.name)
commit('SET_AVATAR', res.data.classId)
commit('SET_SCHOOLID', res.data.schoolId)
+ commit('SET_USERNAME', res.data.username)
resolve()
}).catch(error => {
@@ -80,6 +86,21 @@ const user = {
})
})
},
+ // 获取memberId
+ GetMemberId({ commit}, state ) {
+ // debugger
+ const studentNumber=state
+
+ return new Promise((resolve, reject) => {
+ getMemberId(studentNumber).then(res => {
+ // const user = res.user
+ commit('SET_MEMBERID', res.data)
+ resolve(res)
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
// 退出系统
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
@@ -97,6 +118,8 @@ const user = {
cookie.removememberId()
// 删除roleId
cookie.removeroleId()
+ // 删除username
+ cookie.removeusername()
resolve()
}).catch(error => {
reject(error)
diff --git a/ruoyi-ui/src/utils/auth.js b/ruoyi-ui/src/utils/auth.js
index 9a335ad..5715951 100644
--- a/ruoyi-ui/src/utils/auth.js
+++ b/ruoyi-ui/src/utils/auth.js
@@ -4,6 +4,7 @@ const username = 'NAME'
const schoolId = 'SCHOOLID'
const memberId = 'MEMBERID'
const roleId='ROLEID'
+const username1 = 'USERNAME'
export function getToken() {
return Cookies.get(TokenKey)
}
@@ -53,3 +54,13 @@ export function setroleId(id) {
export function removeroleId() {
return Cookies.remove(roleId)
}
+export function getusername() {
+ return Cookies.get(username1)
+}
+export function setusername(name) {
+ return Cookies.set(username1, name)
+}
+// 删除username
+export function removeusername() {
+ return Cookies.remove(username1)
+}
\ No newline at end of file
diff --git a/ruoyi-ui/src/utils/index.js b/ruoyi-ui/src/utils/index.js
index 998fd68..85a2f2c 100644
--- a/ruoyi-ui/src/utils/index.js
+++ b/ruoyi-ui/src/utils/index.js
@@ -393,7 +393,7 @@ export function isNumberStr(str) {
export function useWebSocket(url) {
let ws = null;
let reconnectInterval = 5000; // 重连间隔时间,单位:毫秒
- let maxReconnectAttempts = 10; // 最大重连尝试次数
+ let maxReconnectAttempts = 20; // 最大重连尝试次数
let reconnectAttempts = 0; // 当前重连尝试次数
function createWebSocket() {
diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js
index 463659e..ed9e90a 100644
--- a/ruoyi-ui/src/utils/request.js
+++ b/ruoyi-ui/src/utils/request.js
@@ -14,8 +14,8 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
- // baseURL: 'http://118.31.7.2:8801',
- baseURL: 'http://192.168.2.14:8800',
+ baseURL: 'http://118.31.7.2:8801',
+ // baseURL: 'http://192.168.2.14:8801',
// baseURL:"http://192.168.2.17:8801",
// baseURL: process.env.VUE_APP_BASE_API,
// 超时
@@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
const message = '数据正在处理,请勿重复提交'
- Message({ message:message, type: 'error' })
+ // Message({ message:message, type: 'error' })
return Promise.reject(new Error(message))
} else {
cache.session.setJSON('sessionObj', requestObj)
diff --git a/ruoyi-ui/src/views/PracticeZone/index.vue b/ruoyi-ui/src/views/PracticeZone/index.vue
index eea34c7..985701e 100644
--- a/ruoyi-ui/src/views/PracticeZone/index.vue
+++ b/ruoyi-ui/src/views/PracticeZone/index.vue
@@ -57,7 +57,7 @@ export default {
: (this.nowName = tab.name)
},
progress() {
- this.$tab.openPage('进行中', `/student/trade/index?id=${999999999}`)
+ this.$tab.openPage('进行中', `/student/PracticeZone/index?id=${999999999}`)
}
}
}
diff --git a/ruoyi-ui/src/views/StudentTrainingReportBullet/components/member.vue b/ruoyi-ui/src/views/StudentTrainingReportBullet/components/member.vue
index 98f0703..464b188 100644
--- a/ruoyi-ui/src/views/StudentTrainingReportBullet/components/member.vue
+++ b/ruoyi-ui/src/views/StudentTrainingReportBullet/components/member.vue
@@ -182,6 +182,10 @@ export default {
}
)
},
+ // 清除表格
+ clear(){
+ this.studentlist = []
+ },
// 移除成员
// trade(row){
// if(this.practicalid == '') return
diff --git a/ruoyi-ui/src/views/StudentTrainingReportBullet/index.vue b/ruoyi-ui/src/views/StudentTrainingReportBullet/index.vue
index c6ca7a3..6b46853 100644
--- a/ruoyi-ui/src/views/StudentTrainingReportBullet/index.vue
+++ b/ruoyi-ui/src/views/StudentTrainingReportBullet/index.vue
@@ -272,7 +272,10 @@
message: "添加成功!",
});
this.getlist()
+
+ this.$refs.child.clear();
this.centerDialogVisible = false
+ this.$refs.ruleForm.resetFields()
}
})
})
diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue
index a2dcc95..491c265 100644
--- a/ruoyi-ui/src/views/index.vue
+++ b/ruoyi-ui/src/views/index.vue
@@ -100,7 +100,7 @@ export default {
classGrade: '',
index: 1,
name: '',
- size: 10,
+ size: 15,
startTime: null,
studentNumber: ''
},
@@ -146,13 +146,13 @@ export default {
trade(data) {
this.$store.commit('SET_MEMBERID', data.memberId)
setmemberId(data.memberId)
- this.$tab.openPage('交易记录', `/student/transactionRecords/index?id=${data.trainingId}`)
+ this.$tab.openPage('交易记录', `/student/transactionRecords?id=${data.trainingId}`)
},
lianxi() {
this.$tab.openPage('实训任务', '/student/training/List')
},
skip() {
- this.$tab.openPage('练习专区', `/student/PracticeZone/homepagege?id=${'999999999'}`)
+ this.$tab.openPage('练习专区', `/student/homepagege?id=${'999999999'}`)
},
chooseTraining(){
this.tasklist.forEach((item)=>{
@@ -179,4 +179,9 @@ export default {
img {
cursor: pointer;
}
+::v-deep .el-table .el-table__cell {
+ // background: #f5f5f5;
+ padding: 6px 0;
+
+}
diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue
index c15c19b..31ee8a9 100644
--- a/ruoyi-ui/src/views/login.vue
+++ b/ruoyi-ui/src/views/login.vue
@@ -116,6 +116,12 @@ export default {
},
},
created() {
+ if(this.$route.query.token){
+ // this.register = true
+ this.loginForm.password = this.$route.query.token
+
+ return this.handleLogin()
+ }
Cookies.remove("Admin-Token");
localStorage.removeItem("limitsRoutes");
// this.getCode();
@@ -134,7 +140,6 @@ export default {
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
-
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password:
@@ -167,9 +172,6 @@ export default {
this.$store
.dispatch("Login", loginForm)
.then(() => {
-
-
- console.log("loginForm", loginForm);
// this.getRouterList();
getRouters().then((res) => {
if (res.data?.length) {
@@ -178,7 +180,6 @@ export default {
this.$router.push({
path: this.redirect || "/student/index",
});
-
this.createsocket()
} else {
this.$router.push({ path: this.redirect || "/teacher/index" });
@@ -198,7 +199,7 @@ export default {
});
},
createsocket() {
- useWebSocket('ws://192.168.2.14:8800/webSocket/' + getname())
+ useWebSocket('ws://118.31.7.2:8801/webSocket/' + getname())
},
},
};
diff --git a/ruoyi-ui/src/views/quotation/index.vue b/ruoyi-ui/src/views/quotation/index.vue
index c67fb1d..4c031bc 100644
--- a/ruoyi-ui/src/views/quotation/index.vue
+++ b/ruoyi-ui/src/views/quotation/index.vue
@@ -1,43 +1,30 @@
+
+
+
-

-
新浪财经
-
查看 >>
-
-
-
-
-
-

-
东方财富
-
查看 >>
-
-
-
-
-
-

-
中国证监会
-
查看 >>
-
-
-
-
-
-

-
外汇模拟交易
-
查看 >>
-
+

+

+

+
+
+
\ No newline at end of file
diff --git a/ruoyi-ui/src/views/task/index.vue b/ruoyi-ui/src/views/task/index.vue
index a8eb7a5..38b5477 100644
--- a/ruoyi-ui/src/views/task/index.vue
+++ b/ruoyi-ui/src/views/task/index.vue
@@ -4,8 +4,8 @@
进入交易