mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-01-04 04:45:28 +08:00
v3.7.2 版本代码合并
This commit is contained in:
@ -3,11 +3,8 @@
|
||||
<template #headerContent>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="flex-1">
|
||||
<a :href="GITHUB_URL" target="_blank">
|
||||
<!-- {{ name }}-->
|
||||
JeecgBoot
|
||||
</a>
|
||||
是一款基于BPM的低代码开发平台!前后端分离架构 SpringBoot 2.x,SpringCloud,Ant Design&Vue,Mybatis-plus,Shiro,JWT,支持微服务。强大的代码生成器让前后端代码一键生成,实现低代码开发! JeecgBoot引领新低代码开发模式 OnlineCoding-> 代码生成器-> 手工MERGE, 帮助Java项目解决70%的重复工作,让开发更多关注业务,既能快速提高效率,节省研发成本,同时又不失灵活性!一系列低代码能力:Online表单、Online报表、Online图表、表单设计、流程设计、报表设计、大屏设计 等等...。
|
||||
<a :href="GITHUB_URL" target="_blank">{{ name }}</a>
|
||||
是一款基于BPM的低代码平台!前后端分离架构 SpringBoot 2.x,SpringCloud,Ant Design&Vue,Mybatis-plus,Shiro,JWT,支持微服务。强大的代码生成器让前后端代码一键生成,实现低代码开发! JeecgBoot引领新低代码开发模式 OnlineCoding-> 代码生成器-> 手工MERGE, 帮助Java项目解决70%的重复工作,让开发更多关注业务,既能快速提高效率,节省研发成本,同时又不失灵活性!一系列低代码能力:Online表单、Online报表、Online图表、表单设计、流程设计、报表设计、大屏设计 等等...。
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -4,14 +4,17 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { isOAuth2AppEnv, sysOAuth2Login } from '/@/views/sys/login/useLogin';
|
||||
import {isOAuth2AppEnv, sysOAuth2Callback, sysOAuth2Login} from '/@/views/sys/login/useLogin';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { PageEnum } from '/@/enums/pageEnum';
|
||||
import { router } from '/@/router';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import {getTenantId} from "/@/utils/auth";
|
||||
import { getAuthCache, getTenantId, getToken } from "/@/utils/auth";
|
||||
import { OAUTH2_THIRD_LOGIN_TENANT_ID } from "@/enums/cacheEnum";
|
||||
import { defHttp } from "@/utils/http/axios";
|
||||
import { requestAuthCode } from "dingtalk-jsapi";
|
||||
|
||||
const isOAuth = ref<boolean>(isOAuth2AppEnv());
|
||||
const env = ref<any>({ thirdApp: false, wxWork: false, dingtalk: false });
|
||||
@ -55,7 +58,8 @@
|
||||
} else if (env.value.wxWork) {
|
||||
sysOAuth2Login('wechat_enterprise');
|
||||
} else if (env.value.dingtalk) {
|
||||
sysOAuth2Login('dingtalk');
|
||||
//新版钉钉登录
|
||||
dingdingLogin();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -84,4 +88,43 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 钉钉登录
|
||||
*/
|
||||
function dingdingLogin() {
|
||||
//先获取钉钉的企业id,如果没有配置 还是走原来的逻辑,走原来的逻辑 需要判断存不存在token,存在token直接去首页
|
||||
let tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID) || 0;
|
||||
let url = `/sys/thirdLogin/get/corpId/clientId?tenantId=${tenantId}`;
|
||||
//update-begin---author:wangshuai---date:2024-12-09---for:不要使用getAction online里面的,要用defHttp---
|
||||
defHttp.get({ url:url },{ isTransformResponse: false }).then((res) => {
|
||||
//update-end---author:wangshuai---date:2024-12-09---for:不要使用getAction online里面的,要用defHttp---
|
||||
if (res.success) {
|
||||
if(res.result && res.result.corpId && res.result.clientId){
|
||||
requestAuthCode({ corpId: res.result.corpId, clientId: res.result.clientId }).then((res) => {
|
||||
let { code } = res;
|
||||
sysOAuth2Callback(code);
|
||||
});
|
||||
}else{
|
||||
toOldAuthLogin();
|
||||
}
|
||||
} else {
|
||||
toOldAuthLogin();
|
||||
}
|
||||
}).catch((err) => {
|
||||
toOldAuthLogin();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旧版钉钉登录
|
||||
*/
|
||||
function toOldAuthLogin() {
|
||||
let token = getToken();
|
||||
if (token) {
|
||||
router.replace({ path: PageEnum.BASE_HOME });
|
||||
} else {
|
||||
sysOAuth2Login('dingtalk');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -174,6 +174,13 @@ export function isOAuth2AppEnv() {
|
||||
return /wxwork|dingtalk/i.test(navigator.userAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是钉钉环境
|
||||
*/
|
||||
export function isOAuth2DingAppEnv() {
|
||||
return /dingtalk/i.test(navigator.userAgent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台构造oauth2登录地址
|
||||
* @param source
|
||||
@ -191,3 +198,19 @@ export function sysOAuth2Login(source) {
|
||||
window.location.href = url;
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20220629 for:[issues/I5BG1I]vue3不支持auth2登录------------
|
||||
|
||||
//update-begin---author:wangshuai ---date:20241108 for:[QQYUN-9421]vue3新版auth登录,用户不用点击登录------------
|
||||
/**
|
||||
* 后台callBack
|
||||
* @param code
|
||||
*/
|
||||
export function sysOAuth2Callback(code:string) {
|
||||
let url = `${window._CONFIG['domianURL']}/sys/thirdLogin/oauth2/dingding/login`;
|
||||
url += `?state=${encodeURIComponent(window.location.origin)}&authCode=${code}`;
|
||||
let tenantId = getAuthCache(OAUTH2_THIRD_LOGIN_TENANT_ID);
|
||||
if(tenantId){
|
||||
url += `&tenantId=${tenantId}`;
|
||||
}
|
||||
window.location.href = url;
|
||||
}
|
||||
//update-end---author:wangshuai ---date:20241108 for:[QQYUN-9421]vue3新版auth登录,用户不用点击登录------------
|
||||
|
||||
Reference in New Issue
Block a user