|
@@ -1,10 +1,11 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- 正在前往DRP绩效
|
|
|
+ 正在前往DRP绩效...
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import {getWxworkUser_ehrpm,getDrpUser} from "@/api/business/ehr/wxworklogin";
|
|
|
+ import {setToken} from '@/utils/auth'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -12,34 +13,24 @@
|
|
|
},
|
|
|
methods: {
|
|
|
},
|
|
|
- async onLoad() {
|
|
|
- console.log(111);
|
|
|
+ async created() {
|
|
|
let query = this.$route.query;
|
|
|
console.log("query",query);
|
|
|
- // //获取链接
|
|
|
- // let href = location.href;
|
|
|
- // //获取查询参数
|
|
|
- // let params = this.urlSearchParse(href);
|
|
|
- // let code = params.code;
|
|
|
- // // 获取企业微信用户信息
|
|
|
- // await this.getWWIF(code);
|
|
|
- // //获取手机号码
|
|
|
- // const phonenumber = this.wxWorkUserInfo.mobile
|
|
|
- // //根据手机号获取token
|
|
|
- // await wxworkLogin(phonenumber).then((response) => {
|
|
|
- // if (response.code == 200) {
|
|
|
- // this.$store.dispatch('wxworkLogin111', response.token);
|
|
|
- // //获取drp用户信息
|
|
|
- // this.$store.dispatch('GetInfo').then(res => {
|
|
|
- // console.log('用户【' + this.wxWorkUserInfo.userid + '】登录成功');
|
|
|
- // this.$store.dispatch('GenerateRoutes').then(res => {
|
|
|
- // this.$tab.reLaunch('/pages/work/ehr/pm/performance/index')
|
|
|
- // })
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // this.$modal.msgError("登录失败");
|
|
|
- // }
|
|
|
- // });
|
|
|
+ let res = await getWxworkUser_ehrpm(query.code);
|
|
|
+ console.log("res",res);
|
|
|
+ if(res.code == '200'){
|
|
|
+ let staffCode = res.data.userid;
|
|
|
+ let dres = await getDrpUser(staffCode);
|
|
|
+ if (dres.code === 200) {
|
|
|
+ let token = dres.token
|
|
|
+ setToken(token)
|
|
|
+ this.$store.commit('SET_TOKEN', token)
|
|
|
+ this.$store.dispatch("GetInfo").then(() => {})
|
|
|
+ this.$store.dispatch("GenerateRoutes").then(
|
|
|
+ this.$router.push({ path: '/business/ehr/pm/myPm' }).catch(()=>{})
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|