style:登录修改
Showing
2 changed files
with
76 additions
and
87 deletions
... | @@ -17,92 +17,92 @@ | ... | @@ -17,92 +17,92 @@ |
17 | </div> | 17 | </div> |
18 | </template> | 18 | </template> |
19 | <script> | 19 | <script> |
20 | import { mapGetters } from 'vuex' | 20 | import { mapGetters } from 'vuex' |
21 | import Breadcrumb from './Breadcrumb' | 21 | import Breadcrumb from './Breadcrumb' |
22 | import { logout } from "@/api/login.js"; | 22 | import { logout } from "@/api/login.js"; |
23 | export default { | 23 | export default { |
24 | components: { | 24 | components: { |
25 | Breadcrumb | 25 | Breadcrumb |
26 | }, | ||
27 | computed: { | ||
28 | ...mapGetters(["userInfo"]), | ||
29 | userName () { | ||
30 | return this.userInfo ? this.userInfo.name : "" | ||
31 | } | ||
32 | }, | ||
33 | methods: { | ||
34 | handleDataView () { | ||
35 | const { href } = this.$router.resolve('/dataView'); | ||
36 | window.open(href, '_blank'); | ||
37 | }, | 26 | }, |
38 | themeChange (val) { | 27 | computed: { |
39 | this.$store.dispatch('app/updateTheme', val) | 28 | ...mapGetters(["userInfo"]), |
29 | userName () { | ||
30 | return this.userInfo ? this.userInfo.name : "" | ||
31 | } | ||
40 | }, | 32 | }, |
41 | onCancel () { | 33 | methods: { |
42 | logout() | 34 | handleDataView () { |
43 | .then((res) => { | 35 | const { href } = this.$router.resolve('/dataView'); |
44 | sessionStorage.removeItem("token"); | 36 | window.open(href, '_blank'); |
45 | this.$store.dispatch("user/resetState"); | 37 | }, |
46 | this.$store.dispatch("permission/resetRoutes"); | 38 | themeChange (val) { |
47 | this.$router.replace({ | 39 | this.$store.dispatch('app/updateTheme', val) |
48 | path: "/sb" | 40 | }, |
41 | onCancel () { | ||
42 | logout() | ||
43 | .then((res) => { | ||
44 | sessionStorage.removeItem("token"); | ||
45 | this.$store.dispatch("user/resetState"); | ||
46 | this.$store.dispatch("permission/resetRoutes"); | ||
47 | this.$router.replace({ | ||
48 | path: "/login" | ||
49 | }) | ||
50 | }) | ||
51 | .catch((error) => { | ||
52 | // console.dir(error); | ||
49 | }) | 53 | }) |
50 | }) | 54 | } |
51 | .catch((error) => { | ||
52 | // console.dir(error); | ||
53 | }) | ||
54 | } | 55 | } |
55 | } | 56 | } |
56 | } | ||
57 | </script> | 57 | </script> |
58 | <style lang="scss" scoped> | 58 | <style lang="scss" scoped> |
59 | @import "~@/styles/_handle.scss"; | 59 | @import "~@/styles/_handle.scss"; |
60 | 60 | ||
61 | .navbar-con { | 61 | .navbar-con { |
62 | position: relative; | 62 | position: relative; |
63 | 63 | ||
64 | .logo { | 64 | .logo { |
65 | color: #fff; | 65 | color: #fff; |
66 | font-size: 26px; | 66 | font-size: 26px; |
67 | font-weight: 700; | 67 | font-weight: 700; |
68 | display: flex; | 68 | display: flex; |
69 | margin-left: 15px; | 69 | margin-left: 15px; |
70 | 70 | ||
71 | img { | 71 | img { |
72 | width: 47px; | 72 | width: 47px; |
73 | height: 47px; | 73 | height: 47px; |
74 | } | 74 | } |
75 | 75 | ||
76 | h4 { | 76 | h4 { |
77 | margin-left: 20px; | 77 | margin-left: 20px; |
78 | height: 50px; | 78 | height: 50px; |
79 | line-height: 50px; | 79 | line-height: 50px; |
80 | } | ||
80 | } | 81 | } |
81 | } | 82 | } |
82 | } | ||
83 | 83 | ||
84 | .navbar { | 84 | .navbar { |
85 | height: $headerHeight; | 85 | height: $headerHeight; |
86 | overflow: hidden; | 86 | overflow: hidden; |
87 | position: relative; | 87 | position: relative; |
88 | @include background("navbg"); | 88 | @include background("navbg"); |
89 | 89 | ||
90 | display: flex; | 90 | display: flex; |
91 | align-items: center; | 91 | align-items: center; |
92 | padding-right: 20px; | 92 | padding-right: 20px; |
93 | justify-content: space-between; | 93 | justify-content: space-between; |
94 | 94 | ||
95 | .header-logo { | 95 | .header-logo { |
96 | width: 300px; | 96 | width: 300px; |
97 | } | 97 | } |
98 | 98 | ||
99 | .right-menu-item { | 99 | .right-menu-item { |
100 | &.hover-effect { | 100 | &.hover-effect { |
101 | cursor: pointer; | 101 | cursor: pointer; |
102 | transition: background 0.3s; | 102 | transition: background 0.3s; |
103 | display: flex; | 103 | display: flex; |
104 | align-items: center; | 104 | align-items: center; |
105 | } | ||
105 | } | 106 | } |
106 | } | 107 | } |
107 | } | ||
108 | </style> | 108 | </style> | ... | ... |
1 | /* | 1 | /* |
2 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 | 2 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-04-27 17:09:51 | 4 | * @LastEditTime: 2023-05-25 14:52:20 |
5 | */ | 5 | */ |
6 | import Vue from 'vue' | 6 | import Vue from 'vue' |
7 | import axios from "axios"; | 7 | import axios from "axios"; |
... | @@ -69,23 +69,12 @@ function handleErrorData (status) { | ... | @@ -69,23 +69,12 @@ function handleErrorData (status) { |
69 | window.tokenValid = false; | 69 | window.tokenValid = false; |
70 | Message.error("由于长时间未操作,请重新登录!"); | 70 | Message.error("由于长时间未操作,请重新登录!"); |
71 | localStorage.removeItem("token"); | 71 | localStorage.removeItem("token"); |
72 | let code = Vue.prototype.BASE_API.CODE | 72 | router.replace({ |
73 | if (code == 'BDCSBPT') { | 73 | path: "/login", |
74 | router.replace({ | 74 | query: { |
75 | path: "/sb", | 75 | redirect: router.history.current.fullPath, |
76 | query: { | 76 | } |
77 | redirect: router.history.current.fullPath, | 77 | }) |
78 | }, | ||
79 | }); | ||
80 | } else { | ||
81 | router.replace({ | ||
82 | path: "/jg", | ||
83 | query: { | ||
84 | redirect: router.history.current.fullPath, | ||
85 | }, | ||
86 | }); | ||
87 | } | ||
88 | |||
89 | } | 78 | } |
90 | break; | 79 | break; |
91 | case 404: | 80 | case 404: | ... | ... |
-
Please register or sign in to post a comment