|
|
|
@ -1,20 +1,22 @@
|
|
|
|
|
import { Flex, Result, Spin } from 'antd'
|
|
|
|
|
import { isNotEmpty } from '@/utils/commons'
|
|
|
|
|
// import * as dd from 'dingtalk-jsapi'
|
|
|
|
|
import * as dd from 'dingtalk-jsapi'
|
|
|
|
|
|
|
|
|
|
function Login() {
|
|
|
|
|
|
|
|
|
|
const urlSearch = new URLSearchParams(location.search)
|
|
|
|
|
const originUrl = urlSearch.get('origin_url')
|
|
|
|
|
|
|
|
|
|
// dd.ready(function() {
|
|
|
|
|
// console.info('dd.ready()')
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
if (isNotEmpty(originUrl)) {
|
|
|
|
|
window.location = 'https://login.dingtalk.com/oauth2/auth?redirect_uri=https%3A%2F%2Fsales.mycht.cn%2Fp%2Fdingding%2Fcallback%3Forigin_url%3D' + originUrl + '&response_type=code&client_id=dingwgdx6emlxr3fcrg8&scope=openid&state=global-saels&prompt=consent'
|
|
|
|
|
if (dd.env.platform === 'notInDingTalk') {
|
|
|
|
|
if (isNotEmpty(originUrl)) {
|
|
|
|
|
window.location = 'https://login.dingtalk.com/oauth2/auth?redirect_uri=https%3A%2F%2Fsales.mycht.cn%2Fp%2Fdingding%2Fcallback%3Forigin_url%3D' + originUrl + '&response_type=code&client_id=dingwgdx6emlxr3fcrg8&scope=openid&state=global-saels&prompt=consent'
|
|
|
|
|
} else {
|
|
|
|
|
window.location = 'https://login.dingtalk.com/oauth2/auth?redirect_uri=https%3A%2F%2Fsales.mycht.cn%2Fp%2Fdingding%2Fcallback%3Forigin_url%3D&response_type=code&client_id=dingwgdx6emlxr3fcrg8&scope=openid&state=global-saels&prompt=consent'
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
window.location = 'https://login.dingtalk.com/oauth2/auth?redirect_uri=https%3A%2F%2Fsales.mycht.cn%2Fp%2Fdingding%2Fcallback%3Forigin_url%3D&response_type=code&client_id=dingwgdx6emlxr3fcrg8&scope=openid&state=global-saels&prompt=consent'
|
|
|
|
|
dd.ready(function() {
|
|
|
|
|
console.info('dd.ready()')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|