v3.7.2 版本代码合并

This commit is contained in:
JEECG
2024-12-09 15:10:46 +08:00
parent 64b29f47e0
commit b0c4194602
118 changed files with 12729 additions and 1596 deletions

View File

@ -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.xSpringCloudAnt Design&VueMybatis-plusShiroJWT支持微服务强大的代码生成器让前后端代码一键生成实现低代码开发 JeecgBoot引领新低代码开发模式 OnlineCoding-> 代码生成器-> 手工MERGE 帮助Java项目解决70%的重复工作让开发更多关注业务既能快速提高效率节省研发成本同时又不失灵活性一系列低代码能力Online表单Online报表Online图表表单设计流程设计报表设计大屏设计 等等...
<a :href="GITHUB_URL" target="_blank">{{ name }}</a>
是一款基于BPM的低代码平台前后端分离架构 SpringBoot 2.xSpringCloudAnt Design&VueMybatis-plusShiroJWT支持微服务强大的代码生成器让前后端代码一键生成实现低代码开发 JeecgBoot引领新低代码开发模式 OnlineCoding-> 代码生成器-> 手工MERGE 帮助Java项目解决70%的重复工作让开发更多关注业务既能快速提高效率节省研发成本同时又不失灵活性一系列低代码能力Online表单Online报表Online图表表单设计流程设计报表设计大屏设计 等等...
</span>
</div>
</template>

View File

@ -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>

View File

@ -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登录用户不用点击登录------------