| | |
| | | if (/wxwork/i.test(navigator.userAgent)) { |
| | | this.env.thirdApp = true |
| | | this.env.wxWork = true |
| | | //this.env.thirdType='wechat_enterprise' |
| | | this.env.thirdType = 'wechat_enterprise' |
| | | } |
| | | // 判断当时是否是钉钉环境 |
| | | if (/dingtalk/i.test(navigator.userAgent)) { |
| | |
| | | doThirdLogin(token) { |
| | | this.ThirdLogin({token: token, thirdType: this.env.thirdType}).then(res => { |
| | | if (res.data.success) { |
| | | uni.showToast({ |
| | | title: '登录', |
| | | icon: 'none', |
| | | duration: 3000, |
| | | content: res |
| | | }); |
| | | this.loginSuccess() |
| | | |
| | | } else { |
| | | this.requestFailed(res) |
| | | } |
| | |
| | | this.$Router.replaceAll({name: 'index'}) |
| | | }, |
| | | requestFailed(err) { |
| | | this.$message.warning("登录失败") |
| | | uni.showToast({ |
| | | title: '登录', |
| | | icon: 'none', |
| | | duration: 3000, |
| | | content: err |
| | | }); |
| | | }, |
| | | goRedirectUrl() { |
| | | let obj = getUrlParams(this.redirectUrl); |
| | |
| | | /** 后台构造oauth2登录地址 */ |
| | | sysOAuth2Login(source) { |
| | | let domainURL = configService.apiUrl; |
| | | let url = `${domainURL}/sys/thirdLogin/oauth2/${source}/login`; |
| | | let url = `http://houjie.xalxzn.com:8866/jeecg-boot/sys/thirdLogin/oauth2/${source}/login`; |
| | | let state = window.location.origin + window.location.search |
| | | url += `?state=${encodeURIComponent(state)}`; |
| | | console.log('sysOAuth2Login====》', url) |