style:上报配置化
Showing
3 changed files
with
9 additions
and
239 deletions
1 | /* | 1 | /* |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-04-12 11:15:57 | 4 | * @LastEditTime: 2023-05-11 16:19:21 |
5 | */ | 5 | */ |
6 | import Vue from 'vue' | 6 | import Vue from 'vue' |
7 | import router from "./router"; | 7 | import router from "./router"; |
... | @@ -20,7 +20,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -20,7 +20,7 @@ router.beforeEach(async (to, from, next) => { |
20 | let hasAddDict = store.state.dict.addDict; | 20 | let hasAddDict = store.state.dict.addDict; |
21 | let hasUser = store.state.user.hasUser; | 21 | let hasUser = store.state.user.hasUser; |
22 | let hasAddRoute = store.state.permission.addRoutes; | 22 | let hasAddRoute = store.state.permission.addRoutes; |
23 | if (to.path == "/sb" || to.path == "/jg" || to.path == "/sb1") { | 23 | if (to.path == "/sb") { |
24 | localStorage.removeItem("token"); | 24 | localStorage.removeItem("token"); |
25 | next(); | 25 | next(); |
26 | } else { | 26 | } else { |
... | @@ -49,21 +49,21 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -49,21 +49,21 @@ router.beforeEach(async (to, from, next) => { |
49 | { path: "*", redirect: "/404", hidden: true }, | 49 | { path: "*", redirect: "/404", hidden: true }, |
50 | ]); | 50 | ]); |
51 | const routeTo = Cookies.get("routerTo"); | 51 | const routeTo = Cookies.get("routerTo"); |
52 | if (routeTo && routeTo !== "/" && routeTo !== "/sb" && routeTo !== "/jg") { | 52 | if (routeTo && routeTo !== "/" && routeTo !== "/sb") { |
53 | next({ ...to, replace: true }); | 53 | next({ ...to, replace: true }); |
54 | } else { | 54 | } else { |
55 | next(); | 55 | next() |
56 | } | 56 | } |
57 | |||
58 | } | 57 | } |
59 | } else { | 58 | } else { |
60 | next(`/${Vue.prototype.BASE_API.LOGIN}`); | 59 | next('/sb') |
61 | } | 60 | } |
62 | } | 61 | } |
63 | NProgress.done(); | 62 | NProgress.done() |
64 | }); | 63 | }); |
65 | router.afterEach((to) => { | 64 | router.afterEach((to) => { |
66 | // 解决刷新页面报404问题 | 65 | // 解决刷新页面报404问题 |
67 | Cookies.set("routerTo", to.fullPath); | 66 | Cookies.set("routerTo", to.fullPath); |
68 | NProgress.done(); | 67 | NProgress.done(); |
69 | }); | 68 | }) |
69 | ... | ... |
... | @@ -20,11 +20,6 @@ export const constantRoutes = [ | ... | @@ -20,11 +20,6 @@ export const constantRoutes = [ |
20 | }, | 20 | }, |
21 | //登录 | 21 | //登录 |
22 | { | 22 | { |
23 | path: "/jg", | ||
24 | name: "loginjg", | ||
25 | component: () => import("@/views/loginjg/index.vue"), | ||
26 | }, | ||
27 | { | ||
28 | path: "/sb", | 23 | path: "/sb", |
29 | name: "loginsb", | 24 | name: "loginsb", |
30 | component: () => import("@/views/loginsb/index.vue"), | 25 | component: () => import("@/views/loginsb/index.vue"), |
... | @@ -32,7 +27,7 @@ export const constantRoutes = [ | ... | @@ -32,7 +27,7 @@ export const constantRoutes = [ |
32 | { | 27 | { |
33 | path: '/', | 28 | path: '/', |
34 | redirect: to => { | 29 | redirect: to => { |
35 | return { path: `/${Vue.prototype.BASE_API.LOGIN}` } | 30 | return { path: '/sb' } |
36 | }, | 31 | }, |
37 | }, | 32 | }, |
38 | // 监管首页 | 33 | // 监管首页 | ... | ... |
src/views/loginjg/index.vue
deleted
100644 → 0
1 | <template> | ||
2 | <div class="bg"> | ||
3 | <div class="login-logo"></div> | ||
4 | <div class="login-inner-bg login"> | ||
5 | <h2>{{ BASE_API.TITLE }}</h2> | ||
6 | <div class="user_style"> | ||
7 | <h3>欢迎登录</h3> | ||
8 | <el-form :model="user" :rules="rules" ref="user" id="loginform" class="demo-ruleForm"> | ||
9 | <el-form-item prop="account"> | ||
10 | <el-input class="username" v-model="user.account" placeholder="请输入用户名"></el-input> | ||
11 | </el-form-item> | ||
12 | <el-form-item prop="password"> | ||
13 | <el-input type="password" class="password" @keyup.enter.native="login('user')" v-model="user.password" | ||
14 | placeholder="请输入密码"></el-input> | ||
15 | </el-form-item> | ||
16 | <el-form-item class="login-btn"> | ||
17 | <el-button type="primary" style="width: 100%" @click="login('user')">登录</el-button> | ||
18 | </el-form-item> | ||
19 | </el-form> | ||
20 | </div> | ||
21 | </div> | ||
22 | </div> | ||
23 | </template> | ||
24 | <script> | ||
25 | import { loginIn } from "@/api/login.js"; | ||
26 | export default { | ||
27 | name: "jgLogin", | ||
28 | data () { | ||
29 | return { | ||
30 | user: { | ||
31 | account: "", | ||
32 | password: "", | ||
33 | checkStatus: false, | ||
34 | }, | ||
35 | rules: { | ||
36 | account: [{ required: true, message: "请填写帐号", trigger: "blur" }], | ||
37 | password: [{ required: true, message: "请填写密码", trigger: "blur" }], | ||
38 | } | ||
39 | } | ||
40 | }, | ||
41 | methods: { | ||
42 | //记住用户名 | ||
43 | checkUserName: function (flag) { | ||
44 | this.user.checkStatus = flag; | ||
45 | if (this.user.checkStatus) { | ||
46 | localStorage.setItem("accountId", this.user.account); | ||
47 | let name = localStorage.getItem("accountId"); | ||
48 | if (name === "") { | ||
49 | return; | ||
50 | } else { | ||
51 | this.user.account = name; | ||
52 | } | ||
53 | } else { | ||
54 | this.user.account = localStorage.getItem("accountId"); | ||
55 | } | ||
56 | }, | ||
57 | login (user) { | ||
58 | var self = this | ||
59 | this.$refs[user].validate(async (valid) => { | ||
60 | if (valid) { | ||
61 | let res = await loginIn(self.user.account, self.user.password) | ||
62 | if (res.status == 1) { | ||
63 | localStorage.setItem("token", `Bearer ${res.content}`); | ||
64 | //登录成功后需判断有无重定向,没有重定向则跳转首页 | ||
65 | this.$router.replace(this.$route.query.redirect || "/home"); | ||
66 | } else { | ||
67 | this.$message.error(res.message); | ||
68 | } | ||
69 | } | ||
70 | }) | ||
71 | } | ||
72 | } | ||
73 | } | ||
74 | </script> | ||
75 | <style scoped lang="scss"> | ||
76 | .username, | ||
77 | .password { | ||
78 | position: relative; | ||
79 | |||
80 | &:before { | ||
81 | content: ""; | ||
82 | display: block; | ||
83 | width: 16px; | ||
84 | height: 16px; | ||
85 | position: absolute; | ||
86 | left: 10px; | ||
87 | top: 7px; | ||
88 | background-size: 100% 100%; | ||
89 | } | ||
90 | |||
91 | /deep/ .el-input__inner { | ||
92 | text-indent: 24px; | ||
93 | border: 1px solid rgba(11, 161, 248, 0.4); | ||
94 | background-color: rgba(6, 135, 205, 0.3) !important; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | .username::before { | ||
99 | background-image: url(../../image/username.png); | ||
100 | } | ||
101 | |||
102 | .password::before { | ||
103 | background-image: url(../../image/password.png); | ||
104 | } | ||
105 | |||
106 | .bg { | ||
107 | width: 100%; | ||
108 | height: 100%; | ||
109 | min-width: 1440px; | ||
110 | min-height: 560px; | ||
111 | background: url(../../image/loginBoxBg.png) no-repeat; | ||
112 | background-size: 100% 100%; | ||
113 | overflow: hidden; | ||
114 | position: relative; | ||
115 | |||
116 | .login-logo { | ||
117 | background: url(../../image/loginLogo.png) no-repeat; | ||
118 | background-size: 100% 100%; | ||
119 | width: 580px; | ||
120 | height: 540px; | ||
121 | position: absolute; | ||
122 | top: 25%; | ||
123 | left: 19%; | ||
124 | } | ||
125 | } | ||
126 | |||
127 | .login-inner-bg { | ||
128 | background: url(../../image/loginBg.png) no-repeat; | ||
129 | width: 20.6%; | ||
130 | height: 43%; | ||
131 | min-width: 360px; | ||
132 | min-height: 380px; | ||
133 | top: 30%; | ||
134 | right: 18%; | ||
135 | position: absolute; | ||
136 | background-size: 100% 100%; | ||
137 | box-sizing: border-box; | ||
138 | padding: 56px; | ||
139 | |||
140 | h2 { | ||
141 | width: 100%; | ||
142 | font-size: 36px; | ||
143 | font-weight: 700; | ||
144 | color: #fff; | ||
145 | text-align: center; | ||
146 | white-space: nowrap; | ||
147 | position: absolute; | ||
148 | right: 0; | ||
149 | top: -70px; | ||
150 | background-image: linear-gradient(180deg, | ||
151 | rgba(99, 163, 255, 1) 0, | ||
152 | rgba(99, 163, 255, 1) 0, | ||
153 | rgba(182, 220, 255, 1) 49.731445%, | ||
154 | rgba(114, 190, 255, 1) 100%, | ||
155 | rgba(114, 190, 255, 1) 100%); | ||
156 | overflow-wrap: break-word; | ||
157 | color: rgba(255, 255, 255, 1); | ||
158 | font-size: 36px; | ||
159 | font-family: AlimamaShuHeiTi-Bold; | ||
160 | -webkit-background-clip: text; | ||
161 | -webkit-text-fill-color: transparent; | ||
162 | } | ||
163 | } | ||
164 | |||
165 | .login { | ||
166 | .user_style { | ||
167 | h3 { | ||
168 | color: #fff; | ||
169 | font-size: 22px; | ||
170 | font-weight: normal; | ||
171 | text-align: center; | ||
172 | margin: 16px auto 34px; | ||
173 | font-weight: 400; | ||
174 | } | ||
175 | } | ||
176 | |||
177 | .btn { | ||
178 | width: 100%; | ||
179 | height: 6vh; | ||
180 | background-color: #00c2de; | ||
181 | border-radius: 5px; | ||
182 | font-size: 1.4vw; | ||
183 | color: #ffffff; | ||
184 | } | ||
185 | |||
186 | .btn:hover { | ||
187 | cursor: pointer; | ||
188 | background-color: #2d8cf0; | ||
189 | } | ||
190 | } | ||
191 | |||
192 | .login #loginform { | ||
193 | .el-form-item { | ||
194 | margin-bottom: 24px !important; | ||
195 | } | ||
196 | |||
197 | .login-btn { | ||
198 | margin-top: 40px !important; | ||
199 | } | ||
200 | |||
201 | .el-button { | ||
202 | font-size: 18px; | ||
203 | background: #0d8cc0 !important; | ||
204 | color: #ffffff !important; | ||
205 | cursor: pointer !important; | ||
206 | } | ||
207 | |||
208 | .el-input__inner { | ||
209 | width: 100% !important; | ||
210 | } | ||
211 | |||
212 | .el-checkbox__label { | ||
213 | color: #fff; | ||
214 | } | ||
215 | } | ||
216 | |||
217 | .inputUser .ivu-input { | ||
218 | padding: 6px 24px !important; | ||
219 | border: 1px solid #9f9f9f !important; | ||
220 | } | ||
221 | |||
222 | tr.hover-row>td.el-table__cell { | ||
223 | background-color: transparent !important; | ||
224 | } | ||
225 | </style> |
-
Please register or sign in to post a comment