11wqe1 3 months ago
parent
commit
d192c9928a

+ 1 - 1
src/components/botPage.vue

@@ -112,7 +112,7 @@ import { mapGetters } from 'vuex';
                 }
             },
             roleUser(){
-                return this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&& this.userinfo2 !== '' ? this.userinfo2 : this.userinfo
+                return Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
             }
         },
         data() {

+ 3 - 2
src/components/sidebarL.vue

@@ -137,7 +137,7 @@ import { API_CONFIG } from "@/common/apiConfig";
                 }
             },
             roleUser(){
-                return this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&& this.userinfo2 !== "" ? this.userinfo2 : this.userinfo
+                return Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
             }
         },
         data() {
@@ -251,7 +251,6 @@ import { API_CONFIG } from "@/common/apiConfig";
             
             // 获取cocoFlow收藏与历史使用记录
             getData(){
-                this.cocoFlowList = []
                 let params = [
                     {
                         functionName: API_CONFIG.ajax_appStoreSave.functionName,
@@ -262,6 +261,8 @@ import { API_CONFIG } from "@/common/apiConfig";
                 this.$ajax
                     .post(API_CONFIG.baseUrl, params)
                     .then((res) => {
+                        this.cocoFlowList = []
+
                         this.cocoFlowList.push(res.data[0])
                         this.cocoFlowList.push(res.data[1])
                     })

+ 6 - 6
src/components/topPage.vue

@@ -14,7 +14,7 @@
             <img style="width: 96px;height: 96px;" src="../assets/img/root.png" alt="">
         </div>
 
-        <div style="width: 100%;height: 100%;object-fit: cover;border-radius: 10px;height: 300px;" 
+        <div style="width: 100%;height: 100%;object-fit: cover;border-radius: 10px;height: 300px;margin-bottom: 14px;" 
         v-if="fromL.admin.banner && fromL.admin.banner.length == 1"
         >
             <img style="width: 100%;height: 100%;object-fit: cover;border-radius: 10px;" 
@@ -75,11 +75,11 @@
                     <div class="footListCon" v-for="(item,index) in admincocoFlow" @click="openNewWindow(item)" :key="index+'2p'">
                         <div class="footListConimg">
                             <img v-if="!fromL.admin.cocoFlow.length" 
-                            style="margin-bottom: 12px;height: 30px;width: 30px;object-fit: contain;" 
+                            style="margin-bottom: 12px;height: 40px;width: 40px;object-fit: contain;" 
                             :src="appImgList[index]" alt="">
 
                             <img
-                            style="margin-bottom: 12px;height: 30px;width: 30px;object-fit: contain;"  
+                            style="margin-bottom: 12px;height: 40px;width: 40px;object-fit: contain;"  
                             v-else :src="JSON.parse(item.json).icon" alt="">
                         </div>
                            
@@ -218,7 +218,7 @@ import { API_CONFIG } from "@/common/apiConfig";
                 }
             },
             roleUser(){
-                return this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&& this.userinfo2 !== "" ? this.userinfo2 : this.userinfo
+                return Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
             }
         },
         data() {
@@ -574,7 +574,7 @@ import { API_CONFIG } from "@/common/apiConfig";
     display: grid;
     grid-template-columns: repeat(3, 1fr);
     gap: 20px; /* 网格间距 */
-    margin: 16px 0 30px;
+    margin: 26px 0 40px;
 }
 
 .TabListAll{
@@ -793,7 +793,7 @@ import { API_CONFIG } from "@/common/apiConfig";
     align-items: center;
     padding: 24px;
     box-sizing: border-box;
-    margin-bottom: 32px;
+    margin-bottom: 14px;
     border-radius: 10px;
     box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)
 }

+ 1 - 0
src/store/modules/user.js

@@ -155,6 +155,7 @@ const actions = {
     return new Promise((resolve) => {
       commit("SET_TOKEN", "");
       commit("SET_ROLES", []);
+      commit("SET_USERINFO2", {});
       removeToken();
       commit("RESET_STATE");
       resolve();

+ 6 - 3
src/views/HomeView.vue

@@ -89,8 +89,8 @@ export default {
       let yym = ''
       return function() {
         
-        
-        yym = this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1 && this.userinfo2 !== '' ? this.userinfo2 : this.userinfo
+        // this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1 && 
+        yym = Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
        
         let val = yym.accountNumber
 
@@ -110,7 +110,8 @@ export default {
       }
     },
     roleUser(){
-        return this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&& this.userinfo2 !== '' ? this.userinfo2 : this.userinfo
+      // this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&&
+        return  Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
     }
   },
   methods: {
@@ -294,6 +295,8 @@ export default {
 		},
   },
   mounted() {
+    console.log('重新获取数据');
+    
       this.getPer()
   },
 };

+ 1 - 1
src/views/homepageL.vue

@@ -18,7 +18,7 @@ import { API_CONFIG } from "@/common/apiConfig";
         computed: {
             ...mapGetters(['userinfo','userinfo2']),
             roleUser(){
-                return this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&& this.userinfo2 !== "" ? this.userinfo2 : this.userinfo
+                return Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
             }
         },
         components:{

+ 27 - 9
src/views/kanBan/components/AquickEntrance.vue

@@ -1,11 +1,11 @@
 <template>
     <div>
-        <div class="EntBlo">
+        <div class="EntBlo" v-loading="loading">
             <div style="text-align: center;margin-bottom: 60px;">
                 小学部
             </div>
             <div class="EntBloConList">
-                <div class="EntBloCon" @click="loginLiyuan(i.code)" v-for="(i,index) in CampusList" :key="index">
+                <div class="EntBloCon" @click="loginLiyuan(i)" v-for="(i,index) in CampusList" :key="index">
                     <img style="width: 26px;margin-bottom: 10px;" :src="JSON.parse(i.json).basics.logo" alt="">
                     <div>{{ i.detail }}</div>
                 </div>
@@ -37,15 +37,18 @@ import { addrrole } from "@/api/user";
         data(){
             return{
                 CampusList:[],
-                uCode :[]
+                uCode :{},
+                loading:false
             }
         },
         computed: {
             ...mapGetters(['userinfo','userinfo2']),
         },
         methods:{
-            async loginLiyuan(code){
-                this.uCode = code
+            async loginLiyuan(val){
+                this.loading = true
+                
+                this.uCode = val
                 try{
                     let email = ''
                     let userName = JSON.parse(JSON.stringify(this.userinfo.accountNumber))
@@ -56,7 +59,7 @@ import { addrrole } from "@/api/user";
                         console.log('111');
                     } else {
                         const parts = userName.split('@');
-                        email = parts[0] + `-${code}@${code}.com`;
+                        email = parts[0] + `-${val.code}@${val.code}.com`;
                     }
 
                     let params = [
@@ -65,18 +68,24 @@ import { addrrole } from "@/api/user";
                             uname: email
                         },
                     ];
+                    console.log('params',params);
+                    
                     
                     // 发起异步请求
                     const res = await this.$ajax.post(API_CONFIG.baseUrl, params);
                     // console.log('res.data[0]',res.data[0]);
                     if (res.data[0].length) {
                         await store.commit('user/SET_USERINFO2', res.data[0][0])
+                        this.loading = false
+
                         console.log('this.userinfo2',this.userinfo2);
-                        this.$router.push('homepageL');
+                        this.$router.push('/');
                     }else{
                         this.addRoleZh(email)
                     }
                 } catch (err) {
+                    this.loading = false
+
                     console.error("请求失败,错误信息:", err);
                 }
             },
@@ -86,8 +95,8 @@ import { addrrole } from "@/api/user";
                         username: email,
                         userpassword: 'Coco1234',
                         alias: this.userinfo.username,
-                        org: this.userinfo.org,
-                        oid: this.userinfo.organizeid,
+                        org: this.uCode.parentid,
+                        oid: this.uCode.id,
                         ph: '',
                         sid: '',
                         cid: "",
@@ -95,6 +104,9 @@ import { addrrole } from "@/api/user";
                         rol: 1
                     }
 
+                console.log('params',params);
+                
+
                 let res = await addrrole(params)
                 console.log(res);
                 if (res.data.success != 1) {
@@ -102,9 +114,11 @@ import { addrrole } from "@/api/user";
                 }else{
                     this.loginLiyuan(this.uCode)
                 }
+                this.loading = false
 
             },
             getData(){
+                this.loading = true
                 let params = [
                     {
                         functionName: API_CONFIG.select_liYuanCampus.functionName, // 调用存储过程的名称
@@ -118,9 +132,13 @@ import { addrrole } from "@/api/user";
                     .then((res) => {
                         let data = res.data[0]
                         this.CampusList = data
+                        this.loading = false
+
                         console.log('data', data)
                     })
                     .catch((err) => {
+                        this.loading = false
+
                         console.error("请求失败,错误信息:", err);
                     });
                 

+ 5 - 3
src/views/kanBan/index.vue

@@ -7,7 +7,7 @@
               <span style="color: #0663FE;font-weight: 600;">{{ userinfo.schoolName }}</span>
             </div>
             <div class="person">
-                <el-button v-if="isIndex2 == 2" type="text" @click="gotoli" style="margin-right: 20px">返回校区</el-button>
+                <el-button v-if="isIndex2 != ''" type="text" @click="gotoli" style="margin-right: 20px">返回校区</el-button>
               <div class="person_name">
                 <img
                  @click="openData()"
@@ -142,9 +142,11 @@ export default {
     },
     mounted() {
         const index = this.$route.query.index; // 123
+
         if (index == 2) {
-            this.isActive = 2
-            this.isIndex2 = 2
+            this.isActive = index
+        }else if (index == 1) {
+            this.isIndex2 = index
         }