THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

perf[Login]: support other query (#2013)

tags/4.2.0
花裤衩 GitHub 9 months ago
parent
commit
cd30d25459
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 3 deletions
  1. +16
    -3
      src/views/login/index.vue

+ 16
- 3
src/views/login/index.vue View File

@@ -108,13 +108,18 @@ export default {
capsTooltip: false,
loading: false,
showDialog: false,
redirect: undefined
redirect: undefined,
otherQuery: {}
}
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect
const query = route.query
if (query) {
this.redirect = query.redirect
this.otherQuery = this.getOtherQuery(query)
}
},
immediate: true
}
@@ -161,7 +166,7 @@ export default {
this.loading = true
this.$store.dispatch('user/login', this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || '/' })
this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
this.loading = false
})
.catch(() => {
@@ -172,6 +177,14 @@ export default {
return false
}
})
},
getOtherQuery(query) {
return Object.keys(query).reduce((acc, cur) => {
if (cur !== 'redirect') {
acc[cur] = query[cur]
}
return acc
}, {})
}
// afterQRScan() {
// if (e.key === 'x-admin-oauth-code') {


Loading…
Cancel
Save