From 66cea4479288064e1e50ee8c0c1d5b38526c67bb Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期五, 26 十二月 2025 17:10:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/components/page/Login.vue | 40 +++++++++++++++++++++++++++++-----------
1 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue
index 2ecaa84..ac8807a 100644
--- a/src/components/page/Login.vue
+++ b/src/components/page/Login.vue
@@ -23,9 +23,11 @@
</template>
<script>
+ import {mapMutations,mapState} from 'vuex';
export default {
data: function(){
return {
+ // 鏉冮檺鑿滃崟
ruleForm: {
loginName: '',
password: '',
@@ -43,25 +45,41 @@
created(){
//this.$router.push({'path': '/home'});
},
+ computed:{
+ ...mapState(['resultAsyncRoutes'])
+ },
methods: {
+ ...mapMutations([
+ 'SET_ROLELISt',
+ 'SET_ROLES'
+ ]),
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var url = this.$systemconfig.basePath + '/ffzf/user/login';
this.$byutil.postData(this,url,this.ruleForm,res=>{
+ if (res.code == 0) {
let data = res.data;
- if (data) {
- localStorage.userId = data.id
- localStorage.name = data.name
- localStorage.type = data.type
- this.$router.push({'path': '/home'});
- // if (this._isMobile()) {
- // this.$router.push({'path': '/index4'});
- // } else {
- // this.$router.push({'path': '/index'});
- // }
- }
+ if (data) {
+ localStorage.userId = data.id;
+ localStorage.name = data.name;
+ localStorage.type = data.type;
+ // localStorage.userRouters = JSON.stringify(this.items) ;
+ this.SET_ROLES(data.type)
+ this.SET_ROLELISt(); // 绛涢�夊乏渚ц彍鍗曟爮
+ this.$router.push({'path': this.resultAsyncRoutes[0].children[0].indexUrl || '/home'});
+ // 鑷姩璺宠浆褰撳墠鏉冮檺璺敱鐨勭涓�涓〉闈� 锛屽鏋滄壘涓嶅埌灏卞幓璺砲ome
+ // if (this._isMobile()) {
+ // this.$router.push({'path': '/index4'});
+ // } else {
+ // this.$router.push({'path': '/index'});
+ // }
+ }
+ }else {
+ this.$message.error(res.msg);
+ }
+
})
} else {
return false;
--
Gitblit v1.9.1