|
@@ -15,8 +15,9 @@ const isShow = ref(true)
|
|
|
const setTimeState = ref(null)
|
|
|
|
|
|
onMounted(() => {
|
|
|
- // 通过 grant_code 获取登录信息
|
|
|
+ // 通过 code 获取登录信息
|
|
|
let isGrantCode = getUrlParam(window.parent.location.href, 'grant_code')
|
|
|
+ let ticket = getUrlParam(window.parent.location.href, 'ticket')
|
|
|
axios.defaults.headers = { 'content-type': 'application/json;charset=utf-8' }
|
|
|
if (isGrantCode) {
|
|
|
let params = {
|
|
@@ -42,6 +43,15 @@ onMounted(() => {
|
|
|
linkLogin()
|
|
|
}
|
|
|
})
|
|
|
+ }else if(ticket){
|
|
|
+ axios.post('https://pbl.cocorobo.cn/api/bat/getToken', { ticket: ticket })
|
|
|
+ .then(r => {
|
|
|
+ if (r.status === 200 && r.data.data && r.data.data.result) {
|
|
|
+ console.log(r.data.data.result)
|
|
|
+ name.value = r.data.data.result.name
|
|
|
+ userInfo2(r.data.data.result)
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
linkLogin()
|
|
|
}
|
|
@@ -109,6 +119,33 @@ const userInfo = (data) => {
|
|
|
|
|
|
}
|
|
|
|
|
|
+// 同步登录信息
|
|
|
+const userInfo2 = (data) => {
|
|
|
+
|
|
|
+ let userIdentity = 1
|
|
|
+ isShow.value = true
|
|
|
+ CurrentRole.currentRole == data.user_role.join(",")
|
|
|
+ userIdentity = 1
|
|
|
+ let userGrand = ""
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ openid: data.user_id,
|
|
|
+ edu: true
|
|
|
+ }
|
|
|
+ axios.defaults.headers = { 'content-type': 'application/x-www-form-urlencoded' }
|
|
|
+ axios.defaults.withCredentials = true;
|
|
|
+ let diqu = `${data.last_top_org_name}&${data.init_v_platform_code}`
|
|
|
+ top.U.A.Request("https://pbl.cocorobo.cn/api/pbl/batchRegistrationSzdjg3", [data.name, data.user_id + '@szdjg.com', '16ace517-b5c7-4168-a9bb-a9e0035df840', data.last_top_org_name || "", data.phone, userGrand, userIdentity, data.user_id, diqu, data.usession_id], function (r) {
|
|
|
+ // console.log('rrrrr', r)
|
|
|
+ axios.post(`https://beta.api.cocorobo.cn/api/user`, qs.stringify(params)).then(d => {
|
|
|
+ // store.user = top.US.userInfo
|
|
|
+ setStateUserinfo()
|
|
|
+ })
|
|
|
+ }, [], { "type": "POST", "withCredentials": true });
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
const setStateUserinfo = () => {
|
|
|
// setTimeState
|
|
|
setTimeState.value = setInterval(() => {
|