hookehuyr

测试微信授权功能

...@@ -4,8 +4,9 @@ VITE_BASE = / ...@@ -4,8 +4,9 @@ VITE_BASE = /
4 # 测试open-id 4 # 测试open-id
5 # VITE_OPENID = api-test-openid 5 # VITE_OPENID = api-test-openid
6 # VITE_OPENID = o8BRf1gLDWieH3Y3JvbrI_4IjaME 6 # VITE_OPENID = o8BRf1gLDWieH3Y3JvbrI_4IjaME
7 -VITE_OPENID = oJLZq5t9PIKLW9tm1oSUNAuPwssA 7 +# VITE_OPENID = oJLZq5t9PIKLW9tm1oSUNAuPwssA
8 # VITE_OPENID = oJLZq5uT_6GwIh2tQWh1F9IoHZ3U 8 # VITE_OPENID = oJLZq5uT_6GwIh2tQWh1F9IoHZ3U
9 +VITE_OPENID =
9 10
10 # B端账号 11 # B端账号
11 VITE_ID = 13761653761 12 VITE_ID = 13761653761
......
...@@ -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: 2022-12-06 17:40:43 5 + * @LastEditTime: 2022-12-07 10:20:52
6 * @FilePath: /data-table/src/App.vue 6 * @FilePath: /data-table/src/App.vue
7 * @Description: 7 * @Description:
8 --> 8 -->
...@@ -89,21 +89,32 @@ onMounted(async () => { ...@@ -89,21 +89,32 @@ onMounted(async () => {
89 } 89 }
90 // 缓存表单设置 90 // 缓存表单设置
91 store.changeFormSetting(form_setting); 91 store.changeFormSetting(form_setting);
92 - // 判断跳转页面 92 + // 需要网页授权-必须要域名相同,需要上传到线上测试
93 - if (form_setting.sjsj_enable && form_setting.sjsj_enable === 0) { 93 + if (!import.meta.env.DEV && form_setting.wxzq_enable && !form_setting.x_field_weixin_openid) {
94 - // 表单已结束 94 + $router.replace({
95 - $router.push("/stop?status=disable"); 95 + path: '/auth',
96 - } 96 + query: {
97 - // 开启后有开始和结束时间,不在时间范围的显示表单还未开始或者已经结束 97 + href: location.hash,
98 - if (form_setting.sjsj_is_time_range && form_setting.sjsj_is_time_range === 1) { 98 + code
99 - // 未开始 99 + }
100 - if (form_setting.server_time < form_setting.sjsj_begin_time) { 100 + });
101 - $router.push("/stop?status=apply"); 101 + } else {
102 - } 102 + // 判断跳转页面
103 - // 已结束 103 + if (form_setting.sjsj_enable && !form_setting.sjsj_enable) {
104 - if (form_setting.server_time > form_setting.sjsj_end_time) { 104 + // 表单已结束
105 - $router.push("/stop?status=finish"); 105 + $router.push("/stop?status=disable");
106 } 106 }
107 + // 开启后有开始和结束时间,不在时间范围的显示表单还未开始或者已经结束
108 + // if (form_setting.sjsj_is_time_range && form_setting.sjsj_is_time_range) {
109 + // // 未开始
110 + // if (form_setting.server_time < form_setting.sjsj_begin_time) {
111 + // $router.push("/stop?status=apply");
112 + // }
113 + // // 已结束
114 + // if (form_setting.server_time > form_setting.sjsj_end_time) {
115 + // $router.push("/stop?status=finish");
116 + // }
117 + // }
107 } 118 }
108 }); 119 });
109 </script> 120 </script>
......
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: 2022-12-06 11:31:14 4 + * @LastEditTime: 2022-12-06 20:58:37
5 * @FilePath: /data-table/src/route.js 5 * @FilePath: /data-table/src/route.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -21,6 +21,12 @@ export default [{ ...@@ -21,6 +21,12 @@ export default [{
21 path: '/stop', 21 path: '/stop',
22 component: () => import('@/views/stop.vue'), 22 component: () => import('@/views/stop.vue'),
23 meta: { 23 meta: {
24 - title: '表单', 24 + title: '表单状态',
25 + }
26 +}, {
27 + path: '/auth',
28 + component: () => import('@/views/auth.vue'),
29 + meta: {
30 + title: '授权页面',
25 } 31 }
26 }]; 32 }];
......
1 +<!--
2 + * @Date: 2022-08-29 13:55:31
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-12-06 20:56:54
5 + * @FilePath: /data-table/src/views/auth.vue
6 + * @Description: 授权模块
7 +-->
1 <template> 8 <template>
2 <div /> 9 <div />
3 </template> 10 </template>
...@@ -17,9 +24,9 @@ onMounted(() => { ...@@ -17,9 +24,9 @@ onMounted(() => {
17 */ 24 */
18 let raw_url = encodeURIComponent(location.origin + location.pathname + $route.query.href); // 未授权的地址 25 let raw_url = encodeURIComponent(location.origin + location.pathname + $route.query.href); // 未授权的地址
19 // TAG: 开发环境测试数据 26 // TAG: 开发环境测试数据
20 - const short_url = `/srv/?f=voice&a=openid_${$route.query.prefixAPI}&res=${raw_url}`; 27 + const short_url = `/srv/?f=custom_form&a=openid&res=${raw_url}&form_code=${$route.query.code}`;
21 location.href = import.meta.env.DEV 28 location.href = import.meta.env.DEV
22 - ? `${short_url}&input_openid=${import.meta.env.VITE_OPENID}` 29 + ? `${short_url}&openid=${import.meta.env.VITE_OPENID}`
23 : `${short_url}`; 30 : `${short_url}`;
24 }) 31 })
25 </script> 32 </script>
......