Commit bbc51d4bc196841900b428b7ae1ddac7be1d73e2
1 parent
0e46bc25
组卷添加修改分数,打开新开页面跳转登录问题
Showing
9 changed files
with
38 additions
and
16 deletions
src/api/axios.js
@@ -42,7 +42,7 @@ service.interceptors.response.use( | @@ -42,7 +42,7 @@ service.interceptors.response.use( | ||
42 | // Cookies.set("access_token", response.data.info, { expires: 1 / 12 }) | 42 | // Cookies.set("access_token", response.data.info, { expires: 1 / 12 }) |
43 | // console.log(response.status) | 43 | // console.log(response.status) |
44 | if (res.status == 999) { | 44 | if (res.status == 999) { |
45 | - if (!location.href.includes("localhost")) { | 45 | + // if (!location.href.includes("localhost")) { |
46 | if (res.data) { | 46 | if (res.data) { |
47 | window.location.href = res.data; | 47 | window.location.href = res.data; |
48 | } else { | 48 | } else { |
@@ -55,7 +55,7 @@ service.interceptors.response.use( | @@ -55,7 +55,7 @@ service.interceptors.response.use( | ||
55 | }); | 55 | }); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | - } | 58 | + // } |
59 | } else { | 59 | } else { |
60 | // Cookies.set("access_token", response.data.info, { expires: 1 / 12 }) | 60 | // Cookies.set("access_token", response.data.info, { expires: 1 / 12 }) |
61 | } | 61 | } |
src/router/index.js
@@ -282,9 +282,9 @@ let addrouters = [ //测试用,后续后端获取 | @@ -282,9 +282,9 @@ let addrouters = [ //测试用,后续后端获取 | ||
282 | iconCls: "fa fa-dashboard", // 图标样式class | 282 | iconCls: "fa fa-dashboard", // 图标样式class |
283 | name: "", | 283 | name: "", |
284 | component: Device, | 284 | component: Device, |
285 | - meta: { | ||
286 | - keepAlive: true, | ||
287 | - }, | 285 | + // meta: { |
286 | + // keepAlive: true, | ||
287 | + // }, | ||
288 | children: [] | 288 | children: [] |
289 | }, | 289 | }, |
290 | { | 290 | { |
src/store/index.js
@@ -15,14 +15,14 @@ const store = new Vuex.Store({ | @@ -15,14 +15,14 @@ const store = new Vuex.Store({ | ||
15 | state: { | 15 | state: { |
16 | token: "", | 16 | token: "", |
17 | csCode: localStorage.getItem("csCode") || "", | 17 | csCode: localStorage.getItem("csCode") || "", |
18 | - info: sessionStorage.getItem("info") | ||
19 | - ? JSON.parse(sessionStorage.getItem("info")) | 18 | + info: localStorage.getItem("info") |
19 | + ? JSON.parse(localStorage.getItem("info")) | ||
20 | : "", // 每次刷新都要通过token请求个人信息来筛选动态路由 | 20 | : "", // 每次刷新都要通过token请求个人信息来筛选动态路由 |
21 | routers: [], //左侧菜单 | 21 | routers: [], //左侧菜单 |
22 | addRouters: | 22 | addRouters: |
23 | - sessionStorage.getItem("addRouters") && | ||
24 | - sessionStorage.getItem("addRouters") != "undefined" | ||
25 | - ? JSON.parse(sessionStorage.getItem("addRouters")) | 23 | + localStorage.getItem("addRouters") && |
24 | + localStorage.getItem("addRouters") != "undefined" | ||
25 | + ? JSON.parse(localStorage.getItem("addRouters")) | ||
26 | : [], //动态路由 | 26 | : [], //动态路由 |
27 | tokenSources: new Map(), //正在请求接口(切换取消请求) | 27 | tokenSources: new Map(), //正在请求接口(切换取消请求) |
28 | }, | 28 | }, |
@@ -36,7 +36,7 @@ const store = new Vuex.Store({ | @@ -36,7 +36,7 @@ const store = new Vuex.Store({ | ||
36 | }, | 36 | }, |
37 | setInfo(state, data) { | 37 | setInfo(state, data) { |
38 | state.info = { ...data }; | 38 | state.info = { ...data }; |
39 | - sessionStorage.setItem("info", JSON.stringify(data)); | 39 | + localStorage.setItem("info", JSON.stringify(data)); |
40 | }, | 40 | }, |
41 | setRouters: (state, routers) => { | 41 | setRouters: (state, routers) => { |
42 | let aRouters = addrouters.filter((item) => { | 42 | let aRouters = addrouters.filter((item) => { |
@@ -46,7 +46,7 @@ const store = new Vuex.Store({ | @@ -46,7 +46,7 @@ const store = new Vuex.Store({ | ||
46 | 46 | ||
47 | state.addRouters = aRouters; // 保存动态路由用来addRouter | 47 | state.addRouters = aRouters; // 保存动态路由用来addRouter |
48 | state.routers = defaultRouter.concat(aRouters); // 所有有权限的路由表,用来生成菜单列表 | 48 | state.routers = defaultRouter.concat(aRouters); // 所有有权限的路由表,用来生成菜单列表 |
49 | - sessionStorage.setItem("addRouters", JSON.stringify(routers)); | 49 | + localStorage.setItem("addRouters", JSON.stringify(routers)); |
50 | }, | 50 | }, |
51 | setTokenSources(state, data) { | 51 | setTokenSources(state, data) { |
52 | if (data instanceof Array) { | 52 | if (data instanceof Array) { |
src/store/modules/layout/index.js
@@ -11,6 +11,12 @@ export default { | @@ -11,6 +11,12 @@ export default { | ||
11 | }] | 11 | }] |
12 | }, | 12 | }, |
13 | mutations: { | 13 | mutations: { |
14 | + resetTabnavBox(state){ | ||
15 | + state.tabnavBox = [{ | ||
16 | + title: "home", | ||
17 | + path: "/index" | ||
18 | + }] | ||
19 | + }, | ||
14 | addTab(state, arg) { | 20 | addTab(state, arg) { |
15 | state.isActive = arg.path | 21 | state.isActive = arg.path |
16 | if (state.tabnavBox[0] && state.tabnavBox[0].title !== "home") { | 22 | if (state.tabnavBox[0] && state.tabnavBox[0].title !== "home") { |
src/views/ask/index.vue
@@ -375,7 +375,7 @@ | @@ -375,7 +375,7 @@ | ||
375 | align="center" | 375 | align="center" |
376 | ></el-table-column> | 376 | ></el-table-column> |
377 | </el-table> | 377 | </el-table> |
378 | - <el-table v-else :data="tableData" border style="width: 100%"> | 378 | + <el-table v-else :max-height="tableMaxHeight" :data="tableData" border style="width: 100%"> |
379 | <el-table-column | 379 | <el-table-column |
380 | prop="studentCode" | 380 | prop="studentCode" |
381 | label="学号" | 381 | label="学号" |
src/views/examinationPaper/edit.vue
@@ -58,7 +58,16 @@ | @@ -58,7 +58,16 @@ | ||
58 | {{ setSubPro(subQuestions.questionType) }} | 58 | {{ setSubPro(subQuestions.questionType) }} |
59 | </div> | 59 | </div> |
60 | <div class="qs-score"> | 60 | <div class="qs-score"> |
61 | - {{ subQuestions.score }} | 61 | + <el-input-number |
62 | + class="number-ipt" | ||
63 | + size="medium" | ||
64 | + :min="1" | ||
65 | + :max="200" | ||
66 | + :precision="2" | ||
67 | + :step="1" | ||
68 | + v-model="subQuestions.score" | ||
69 | + label="单题分值" | ||
70 | + ></el-input-number> | ||
62 | </div> | 71 | </div> |
63 | <div class="qs-partScore"> | 72 | <div class="qs-partScore"> |
64 | <p v-if="subQuestions.questionType != 3">--</p> | 73 | <p v-if="subQuestions.questionType != 3">--</p> |
src/views/layout/aside/aside.vue
@@ -41,6 +41,7 @@ | @@ -41,6 +41,7 @@ | ||
41 | v-else | 41 | v-else |
42 | :key="item.path" | 42 | :key="item.path" |
43 | :class="path.includes(item.path) ? 'is-active' : ''" | 43 | :class="path.includes(item.path) ? 'is-active' : ''" |
44 | + @click="isKeep(item.path)" | ||
44 | > | 45 | > |
45 | <i :class="item.iconCls ? item.iconCls : [fa, fa - file]" /> | 46 | <i :class="item.iconCls ? item.iconCls : [fa, fa - file]" /> |
46 | <span slot="title">{{ item.name }}</span> | 47 | <span slot="title">{{ item.name }}</span> |
src/views/layout/header/header.vue
@@ -60,7 +60,6 @@ | @@ -60,7 +60,6 @@ | ||
60 | </template> | 60 | </template> |
61 | 61 | ||
62 | <script> | 62 | <script> |
63 | -import Cookies from "js-cookie"; | ||
64 | import langSelect from "../../../components/lang/langSelect"; | 63 | import langSelect from "../../../components/lang/langSelect"; |
65 | import tabNav from "./tabNav"; | 64 | import tabNav from "./tabNav"; |
66 | 65 | ||
@@ -128,11 +127,15 @@ export default { | @@ -128,11 +127,15 @@ export default { | ||
128 | this.$store.dispatch("permissions", command); | 127 | this.$store.dispatch("permissions", command); |
129 | }, | 128 | }, |
130 | async logOut() { | 129 | async logOut() { |
131 | - const { data,status } = await this.$request.logout(); | 130 | + const { data, status } = await this.$request.logout(); |
132 | if (status == 0) { | 131 | if (status == 0) { |
133 | if (data) { | 132 | if (data) { |
134 | window.location.href = data; | 133 | window.location.href = data; |
135 | } else { | 134 | } else { |
135 | + this.$store.commit("setToken", ""); | ||
136 | + this.$store.commit("setInfo", {}); | ||
137 | + this.$store.commit("setRouters", []); | ||
138 | + this.$store.commit("resetTabnavBox"); | ||
136 | this.$router.push({ | 139 | this.$router.push({ |
137 | path: "/login", | 140 | path: "/login", |
138 | }); | 141 | }); |
src/views/layout/layout.vue
@@ -9,6 +9,9 @@ | @@ -9,6 +9,9 @@ | ||
9 | <keep-alive key="keepAlive"> | 9 | <keep-alive key="keepAlive"> |
10 | <router-view v-if="$route.meta.keepAlive" ></router-view> | 10 | <router-view v-if="$route.meta.keepAlive" ></router-view> |
11 | </keep-alive> | 11 | </keep-alive> |
12 | + </transition> | ||
13 | + <transition name="main" mode="out-in"> | ||
14 | + <router-view v-if="!$route.meta.keepAlive" key="not-keepAlive"></router-view> | ||
12 | </transition> --> | 15 | </transition> --> |
13 | <transition name="main" mode="out-in"> | 16 | <transition name="main" mode="out-in"> |
14 | <router-view key="not-keepAlive"></router-view> | 17 | <router-view key="not-keepAlive"></router-view> |