|
@@ -50,7 +50,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { validUsername } from '@/utils/validate'
|
|
|
-import { postJson, getSort } from '@/api/page'
|
|
|
+import { postJson, postForm } from '@/api/page'
|
|
|
import { mapGetters, mapState, mapActions } from 'vuex'
|
|
|
|
|
|
export default {
|
|
@@ -109,12 +109,15 @@ export default {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
|
this.$store.dispatch('user/login', this.loginForm).then(() => {
|
|
|
+ // debugger
|
|
|
+ // postJson('/api/v1/sys/role/tree', { id: this.loginForm.username }).then(response => {
|
|
|
+ // debugger
|
|
|
+ // if (response.code === 200) {
|
|
|
+ // this.setRole(response.data.checked)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ localStorage.setItem('userName', this.loginForm.username)
|
|
|
this.$router.push({ path: this.redirect || '/' })
|
|
|
- postJson('/api/v1/sys/role/tree', { id: this.loginForm.username }).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.setRole(response.data.checked)
|
|
|
- }
|
|
|
- })
|
|
|
this.loading = false
|
|
|
}).catch(() => {
|
|
|
this.loading = false
|