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
2022-12-07 10:21:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d6ab38ba90fd901b82292e106d9485fb5a1d40bd
d6ab38ba
1 parent
a9649f56
测试微信授权功能
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
16 deletions
.env.development
src/App.vue
src/route.js
src/views/auth.vue
.env.development
View file @
d6ab38b
...
...
@@ -4,8 +4,9 @@ VITE_BASE = /
# 测试open-id
# VITE_OPENID = api-test-openid
# VITE_OPENID = o8BRf1gLDWieH3Y3JvbrI_4IjaME
VITE_OPENID = oJLZq5t9PIKLW9tm1oSUNAuPwssA
#
VITE_OPENID = oJLZq5t9PIKLW9tm1oSUNAuPwssA
# VITE_OPENID = oJLZq5uT_6GwIh2tQWh1F9IoHZ3U
VITE_OPENID =
# B端账号
VITE_ID = 13761653761
...
...
src/App.vue
View file @
d6ab38b
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-0
6 17:40:43
* @LastEditTime: 2022-12-0
7 10:20:52
* @FilePath: /data-table/src/App.vue
* @Description:
-->
...
...
@@ -89,21 +89,32 @@ onMounted(async () => {
}
// 缓存表单设置
store.changeFormSetting(form_setting);
// 需要网页授权-必须要域名相同,需要上传到线上测试
if (!import.meta.env.DEV && form_setting.wxzq_enable && !form_setting.x_field_weixin_openid) {
$router.replace({
path: '/auth',
query: {
href: location.hash,
code
}
});
} else {
// 判断跳转页面
if (form_setting.sjsj_enable && form_setting.sjsj_enable === 0
) {
if (form_setting.sjsj_enable && !form_setting.sjsj_enable
) {
// 表单已结束
$router.push("/stop?status=disable");
}
// 开启后有开始和结束时间,不在时间范围的显示表单还未开始或者已经结束
if (form_setting.sjsj_is_time_range && form_setting.sjsj_is_time_range === 1) {
// 未开始
if (form_setting.server_time < form_setting.sjsj_begin_time) {
$router.push("/stop?status=apply");
}
// 已结束
if (form_setting.server_time > form_setting.sjsj_end_time) {
$router.push("/stop?status=finish");
}
// if (form_setting.sjsj_is_time_range && form_setting.sjsj_is_time_range) {
// // 未开始
// if (form_setting.server_time < form_setting.sjsj_begin_time) {
// $router.push("/stop?status=apply");
// }
// // 已结束
// if (form_setting.server_time > form_setting.sjsj_end_time) {
// $router.push("/stop?status=finish");
// }
// }
}
});
</script>
...
...
src/route.js
View file @
d6ab38b
/*
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-06
11:31:14
* @LastEditTime: 2022-12-06
20:58:37
* @FilePath: /data-table/src/route.js
* @Description: 文件描述
*/
...
...
@@ -21,6 +21,12 @@ export default [{
path
:
'/stop'
,
component
:
()
=>
import
(
'@/views/stop.vue'
),
meta
:
{
title
:
'表单'
,
title
:
'表单状态'
,
}
},
{
path
:
'/auth'
,
component
:
()
=>
import
(
'@/views/auth.vue'
),
meta
:
{
title
:
'授权页面'
,
}
}];
...
...
src/views/auth.vue
View file @
d6ab38b
<!--
* @Date: 2022-08-29 13:55:31
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-06 20:56:54
* @FilePath: /data-table/src/views/auth.vue
* @Description: 授权模块
-->
<template>
<div />
</template>
...
...
@@ -17,9 +24,9 @@ onMounted(() => {
*/
let raw_url = encodeURIComponent(location.origin + location.pathname + $route.query.href); // 未授权的地址
// TAG: 开发环境测试数据
const short_url = `/srv/?f=
voice&a=openid_${$route.query.prefixAPI}&res=${raw_url
}`;
const short_url = `/srv/?f=
custom_form&a=openid&res=${raw_url}&form_code=${$route.query.code
}`;
location.href = import.meta.env.DEV
? `${short_url}&
input_
openid=${import.meta.env.VITE_OPENID}`
? `${short_url}&openid=${import.meta.env.VITE_OPENID}`
: `${short_url}`;
})
</script>
...
...
Please
register
or
login
to post a comment