hookehuyr

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

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