Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2023-05-22 18:07:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cfeb7a1a6287fb484abef30e6fce47dff3cc8e7a
cfeb7a1a
1 parent
3cccdd77
✨ feat: iframe时判断授权,从URL上面获取openid值
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
src/App.vue
src/views/index.vue
src/App.vue
View file @
cfeb7a1
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-0
3-28 14:04:03
* @LastEditTime: 2023-0
5-22 18:03:29
* @FilePath: /data-table/src/App.vue
* @Description:
-->
...
...
@@ -76,7 +76,12 @@ onMounted(async () => {
// 缓存表单设置
store.changeFormSetting(form_setting);
// 没有授权判断
const no_auth_info = form_setting.wxzq_enable && !form_setting.x_field_weixin_openid;
let no_auth_info = form_setting.wxzq_enable && !form_setting.x_field_weixin_openid;
// iframe传值openid
const iframe_openid = getUrlParams(location.href) ? getUrlParams(location.href).openid : '';
if (iframe_openid) { // 如果获取到iframe传值openid 不再校验授权
no_auth_info = false;
}
const no_preview_model = model !== 'preview';
// 需要网页授权-必须要域名相同,需要上传到线上测试
/**
...
...
src/views/index.vue
View file @
cfeb7a1
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-05-
16 21:51:49
* @LastEditTime: 2023-05-
22 17:55:53
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -518,10 +518,13 @@ const onSubmit = async (values) => {
if (model === 'edit' || model === 'preview') return false;
// 提交按钮禁用
submitStatus.value = true;
// iframe传值openid
const iframe_openid = getUrlParams(location.href) ? getUrlParams(location.href).openid : '';
// 通过验证
const result = await addFormDataAPI({
form_code: $route.query.code,
data: postData.value,
openid: iframe_openid
});
if (result.code) {
// 提交按钮禁用状态
...
...
Please
register
or
login
to post a comment