| | |
| | | <script setup name="Oss" lang="ts"> |
| | | import { useRoute } from 'vue-router'; |
| | | import { dingdingLogin } from '@/api/system/user'; |
| | | import { setToken } from '@/utils/auth'; |
| | | import { setToken,setPlat } from '@/utils/auth'; |
| | | |
| | | import { ElMessage } from 'element-plus'; |
| | | import { any } from 'vue-types'; |
| | |
| | | setToken(JSON.stringify(data)); |
| | | window.location.href = '/index'; |
| | | } else { |
| | | ElMessage({ message: '登录失败', type: 'error' }); |
| | | ElMessage({ message: '无权访问', type: 'error' }); |
| | | setTimeout(() => { |
| | | window.location.href = '/login'; |
| | | }, 3000); |
| | |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | setPlat('dingding'); |
| | | const router = useRoute(); |
| | | let code = router.query.code; |
| | | let code = router.query.code ; |
| | | let authCode = router.query.authCode; |
| | | if (code) { |
| | | getUserDate(authCode, code); |
| | | } else { |
| | | var mode = 'openid corpid'; |
| | | window.location.href = |
| | | 'https://login.dingtalk.com/oauth2/auth?redirect_uri=http://127.0.0.1:81/login&response_type=code&client_id=dingl5dxahaj3uzfug66&scope=' + |
| | | 'https://login.dingtalk.com/oauth2/auth?redirect_uri=http://171.221.173.53:8801/login&response_type=code&client_id=dingl5dxahaj3uzfug66&scope=' + |
| | | encodeURIComponent(mode) + |
| | | '&state=dddd&prompt=consent'; |
| | | // // STEP3:在需要的时候,调用 window.DTFrameLogin 方法构造登录二维码,并处理登录成功或失败的回调。 |
| | |
| | | // width: 300px; |
| | | // height: 300px; |
| | | } |
| | | </style> |
| | | </style> |