File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,18 @@ export default {
116
116
capsTooltip: false ,
117
117
loading: false ,
118
118
showDialog: false ,
119
- redirect: undefined
119
+ redirect: undefined ,
120
+ otherQuery: {}
120
121
}
121
122
},
122
123
watch: {
123
124
$route: {
124
125
handler : function (route ) {
125
- this .redirect = route .query && route .query .redirect
126
+ const query = route .query
127
+ if (query) {
128
+ this .redirect = query .redirect
129
+ this .otherQuery = this .getOtherQuery (query)
130
+ }
126
131
},
127
132
immediate: true
128
133
}
@@ -169,7 +174,7 @@ export default {
169
174
this .loading = true
170
175
this .$store .dispatch (' user/login' , this .loginForm )
171
176
.then (() => {
172
- this .$router .push ({ path: this .redirect || ' /' })
177
+ this .$router .push ({ path: this .redirect || ' /' , query : this . otherQuery })
173
178
this .loading = false
174
179
})
175
180
.catch (() => {
@@ -180,6 +185,14 @@ export default {
180
185
return false
181
186
}
182
187
})
188
+ },
189
+ getOtherQuery (query ) {
190
+ return Object .keys (query).reduce ((acc , cur ) => {
191
+ if (cur !== ' redirect' ) {
192
+ acc[cur] = query[cur]
193
+ }
194
+ return acc
195
+ }, {})
183
196
}
184
197
// afterQRScan() {
185
198
// if (e.key === 'x-admin-oauth-code') {
You can’t perform that action at this time.
0 commit comments