|
@@ -4,6 +4,7 @@ import { RouterLink, RouterView, useRoute } from 'vue-router'
|
|
|
import Header from './views/header.vue';
|
|
|
import axios from 'axios';
|
|
|
import qs from 'qs';
|
|
|
+import { ElMessageBox } from 'element-plus'
|
|
|
import { userInfoStore, userCurrentRole } from './stores/counter'
|
|
|
|
|
|
const route = useRoute()
|
|
@@ -55,49 +56,66 @@ const userInfo = (data) => {
|
|
|
// visitor - 访客
|
|
|
// parentagency - 家长代办
|
|
|
|
|
|
- let userIdentity = 2
|
|
|
+ let userIdentity = 1
|
|
|
CurrentRole.currentRole == data.currentRole
|
|
|
if (data.currentRole == "areaAdministrator" || data.currentRole == "userAdministrator" || data.currentRole == "securityAuditor" || data.currentRole == "schoolAdministrator" || data.currentRole == "schoolSecurityAuditor" || data.currentRole == "teacher") {
|
|
|
- userIdentity = 1
|
|
|
- }
|
|
|
- let userGrand = ""
|
|
|
- if (data.childList && data.childList.length > 0) {
|
|
|
- userGrand = data.childList[0].gradeName + data.childList[0].className
|
|
|
- }
|
|
|
- let params = {
|
|
|
- openid: data.userId,
|
|
|
- edu: true
|
|
|
- }
|
|
|
- axios.defaults.headers = { 'content-type': 'application/x-www-form-urlencoded' }
|
|
|
- axios.defaults.withCredentials = true;
|
|
|
- axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(res => {
|
|
|
- // console.log(res, '222222222222')
|
|
|
-
|
|
|
- if (res.data && res.data[0][0].active == 1) {
|
|
|
- let obj = res.data[0][0]
|
|
|
- obj.userName = name
|
|
|
- store.user = obj
|
|
|
- } else {
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/batchRegistrationSzdjg", [data.userName, data.telephoneNumber + '@szdjg.com', '16ace517-b5c7-4168-a9bb-a9e0035df840', data.schoolName, data.telephoneNumber, userGrand, userIdentity, data.userId], function (r) {
|
|
|
- axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(d => {
|
|
|
- let obj = d.data[0][0]
|
|
|
- obj.userName = name
|
|
|
- store.user = obj
|
|
|
-
|
|
|
- })
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ userIdentity = 0
|
|
|
+ let userGrand = ""
|
|
|
+ if (data.childList && data.childList.length > 0) {
|
|
|
+ userGrand = data.childList[0].gradeName + data.childList[0].className
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ openid: data.userId,
|
|
|
+ edu: true
|
|
|
}
|
|
|
- }).catch(e => {
|
|
|
- top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/batchRegistrationSzdjg", [data.userName, data.telephoneNumber + '@szdjg.com', '16ace517-b5c7-4168-a9bb-a9e0035df840', data.schoolName, data.telephoneNumber, userGrand, userIdentity, data.userId], function (r) {
|
|
|
- // console.log('rrrrr', r)
|
|
|
- axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(d => {
|
|
|
- let obj = d.data[0][0]
|
|
|
+ axios.defaults.headers = { 'content-type': 'application/x-www-form-urlencoded' }
|
|
|
+ axios.defaults.withCredentials = true;
|
|
|
+ axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(res => {
|
|
|
+ // console.log(res, '222222222222')
|
|
|
+
|
|
|
+ if (res.data && res.data[0][0].active == 1) {
|
|
|
+ let obj = res.data[0][0]
|
|
|
obj.userName = name
|
|
|
store.user = obj
|
|
|
+ } else {
|
|
|
+ if (data.telephoneNumber) {
|
|
|
+ top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/batchRegistrationSzdjg", [data.userName, data.telephoneNumber + '@szdjg.com', '16ace517-b5c7-4168-a9bb-a9e0035df840', data.schoolName, data.telephoneNumber, userGrand, userIdentity, data.userId], function (r) {
|
|
|
+ // console.log('rrrrr', r)
|
|
|
+ axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(d => {
|
|
|
+ let obj = d.data[0][0]
|
|
|
+ obj.userName = name
|
|
|
+ store.user = obj
|
|
|
+
|
|
|
+ })
|
|
|
+ }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ } else {
|
|
|
+ ElMessageBox.alert('没有绑定手机号,请先去绑定手机号', "提示", {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(e => {
|
|
|
+ if (data.telephoneNumber) {
|
|
|
+ top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/batchRegistrationSzdjg", [data.userName, data.telephoneNumber + '@szdjg.com', '16ace517-b5c7-4168-a9bb-a9e0035df840', data.schoolName, data.telephoneNumber, userGrand, userIdentity, data.userId], function (r) {
|
|
|
+ // console.log('rrrrr', r)
|
|
|
+ axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(d => {
|
|
|
+ let obj = d.data[0][0]
|
|
|
+ obj.userName = name
|
|
|
+ store.user = obj
|
|
|
+
|
|
|
+ })
|
|
|
+ }, [], { "type": "POST", "withCredentials": true });
|
|
|
+ } else {
|
|
|
+ ElMessageBox.alert('没有绑定手机号,请先去绑定手机号', "提示", {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ store.user = data
|
|
|
+ }
|
|
|
|
|
|
- })
|
|
|
- }, [], { "type": "POST", "withCredentials": true });
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
const getUrlParam = (urlStr, urlKey) => {
|