hookehuyr

适配后台页面-iframe调用的需要跳过授权

......@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-18 14:16:05
* @LastEditTime: 2024-06-20 11:35:40
* @FilePath: /data-table/src/App.vue
* @Description:
-->
......@@ -62,6 +62,10 @@ watch(
// web端判断
const is_pc = computed(() => wxInfo().isPC);
// 微信端判断
const is_wx = computed(() => wxInfo().isWeiXin);
// iframe模式判断
const is_iframe = computed(() => window.frames.length > 0);
onMounted(async () => {
const code = getUrlParams(location.href) ? getUrlParams(location.href).code : '';
......@@ -89,7 +93,7 @@ onMounted(async () => {
* 空字符串=不授权,snsapi_base=静默授权,snsapi_userinfo=显式授权
*/
// 非测试环境,没有授权信息,需要授权
if (!import.meta.env.DEV && no_auth_info && form_setting.wxzq_scope) {
if (!import.meta.env.DEV && no_auth_info && form_setting.wxzq_scope && !is_iframe.value) {
// 预览模式不开启
if (no_preview_model) {
$router.replace({
......
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-19 18:05:04
* @LastEditTime: 2024-06-20 10:17:01
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
......@@ -852,7 +852,7 @@ const onSubmit = async (values) => {
showSuccessToast("提交成功");
// 缓存表单返回值
store.changeSuccessInfo(result.data);
//在 iframe 中调用父页面中定义的变量
//在 iframe 中调用父页面中定义的变量 - Doris需要自由控制
let getChildVal = parent.parent.getChildVal;
if (getChildVal) {
getChildVal();
......@@ -887,7 +887,7 @@ const onSubmit = async (values) => {
showSuccessToast("提交成功");
// 缓存表单返回值
store.changeSuccessInfo(result.data);
//在 iframe 中调用父页面中定义的变量
//在 iframe 中调用父页面中定义的变量 - Doris需要自由控制
let getChildVal = parent.parent.getChildVal;
if (getChildVal) {
getChildVal();
......