File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -108,13 +108,18 @@ export default {
108
108
capsTooltip: false ,
109
109
loading: false ,
110
110
showDialog: false ,
111
- redirect: undefined
111
+ redirect: undefined ,
112
+ otherQuery: {}
112
113
}
113
114
},
114
115
watch: {
115
116
$route: {
116
117
handler : function (route ) {
117
- this .redirect = route .query && route .query .redirect
118
+ const query = route .query
119
+ if (query) {
120
+ this .redirect = query .redirect
121
+ this .otherQuery = this .getOtherQuery (query)
122
+ }
118
123
},
119
124
immediate: true
120
125
}
@@ -161,7 +166,7 @@ export default {
161
166
this .loading = true
162
167
this .$store .dispatch (' user/login' , this .loginForm )
163
168
.then (() => {
164
- this .$router .push ({ path: this .redirect || ' /' })
169
+ this .$router .push ({ path: this .redirect || ' /' , query : this . otherQuery })
165
170
this .loading = false
166
171
})
167
172
.catch (() => {
@@ -172,6 +177,14 @@ export default {
172
177
return false
173
178
}
174
179
})
180
+ },
181
+ getOtherQuery (query ) {
182
+ return Object .keys (query).reduce ((acc , cur ) => {
183
+ if (cur !== ' redirect' ) {
184
+ acc[cur] = query[cur]
185
+ }
186
+ return acc
187
+ }, {})
175
188
}
176
189
// afterQRScan() {
177
190
// if (e.key === 'x-admin-oauth-code') {
You can’t perform that action at this time.
0 commit comments