fix: 调整删除cookie的时机以优化表单提交流程
在表单成功提交后立即删除cookie,避免未完成表单功能时cookie被错误删除
Showing
1 changed file
with
3 additions
and
3 deletions
| 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: 2025-02-25 11:48:35 | 4 | + * @LastEditTime: 2025-03-27 13:53:23 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -1004,6 +1004,8 @@ const onRemove = (value) => { // 处理组件删除事件回调, 数据结构是 | ... | @@ -1004,6 +1004,8 @@ const onRemove = (value) => { // 处理组件删除事件回调, 数据结构是 |
| 1004 | const submitStatus = ref(false); // 表单提交按钮状态 | 1004 | const submitStatus = ref(false); // 表单提交按钮状态 |
| 1005 | 1005 | ||
| 1006 | const successHandle = () => { // 表单成功提交后续操作 | 1006 | const successHandle = () => { // 表单成功提交后续操作 |
| 1007 | + // 删除存在cookie, 提交成功后删除 | ||
| 1008 | + Cookies.remove($route.query.code); | ||
| 1007 | //在 iframe 中调用父页面中定义的变量 - Doris需要自由控制 | 1009 | //在 iframe 中调用父页面中定义的变量 - Doris需要自由控制 |
| 1008 | let getChildVal = parent.parent.getChildVal; | 1010 | let getChildVal = parent.parent.getChildVal; |
| 1009 | if (getChildVal) { | 1011 | if (getChildVal) { |
| ... | @@ -1024,8 +1026,6 @@ const successHandle = () => { // 表单成功提交后续操作 | ... | @@ -1024,8 +1026,6 @@ const successHandle = () => { // 表单成功提交后续操作 |
| 1024 | }, | 1026 | }, |
| 1025 | }); | 1027 | }); |
| 1026 | } | 1028 | } |
| 1027 | - // 删除存在cookie, 未完成的表单功能 | ||
| 1028 | - Cookies.remove($route.query.code); | ||
| 1029 | } | 1029 | } |
| 1030 | 1030 | ||
| 1031 | const onSubmit = async (values) => { // 表单提交回调 | 1031 | const onSubmit = async (values) => { // 表单提交回调 | ... | ... |
-
Please register or login to post a comment