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
2024-06-20 17:28:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0774f5864ad8fbfa4408107cc0fec57229fc2213
0774f586
1 parent
e3b98d0b
根据后台登录情况判断是否跳转授权页
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
src/App.vue
src/App.vue
View file @
0774f58
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-20 1
6:29:20
* @LastEditTime: 2024-06-20 1
7:21:09
* @FilePath: /data-table/src/App.vue
* @Description:
-->
...
...
@@ -70,6 +70,7 @@ const is_iframe = computed(() => window.frames.length > 0);
onMounted(async () => {
const code = getUrlParams(location.href) ? getUrlParams(location.href).code : '';
const model = getUrlParams(location.href) ? getUrlParams(location.href).model : '';
const data_id = getUrlParams(location.href) ? getUrlParams(location.href).data_id : '';
const raw_url = encodeURIComponent(location.pathname + location.hash);
// 数据收集设置
const { data } = await getFormSettingAPI({ form_code: code });
...
...
@@ -91,10 +92,18 @@ onMounted(async () => {
/**
* 微信公众号授权模式
* 空字符串=不授权,snsapi_base=静默授权,snsapi_userinfo=显式授权
* is_back_user
=true 说明后台用户登录了,可以忽略
微信增强
* is_back_user
1. 后台用户已登录, 新增表单(无data_id), 为了记录 openid 如果有微信增强设置,则启用微信增强 2. 后台用户未登录, 启用
微信增强
*/
const record_openid = false; // 是否记录open_id
if (!form_setting.is_back_user) { // 用户未登录
record_openid = true;
} else { // 用户已登录
if (!data_id) { // 新增表单
record_openid = true
}
}
// 非测试环境,没有授权信息,需要授权
if (!import.meta.env.DEV && no_auth_info && form_setting.wxzq_scope &&
!is_iframe.value && !form_setting.is_back_user
) {
if (!import.meta.env.DEV && no_auth_info && form_setting.wxzq_scope &&
record_openid
) {
// 预览模式不开启
if (no_preview_model) {
$router.replace({
...
...
Please
register
or
login
to post a comment