|
@@ -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);
|
|
|
});
|
|
|
|