Commit bbc51d4bc196841900b428b7ae1ddac7be1d73e2

Authored by 梁保满
1 parent 0e46bc25

组卷添加修改分数,打开新开页面跳转登录问题

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