hookehuyr

新增预览模式

......@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-03-01 15:45:20
* @LastEditTime: 2023-03-03 11:12:26
* @FilePath: /data-table/src/App.vue
* @Description:
-->
......@@ -60,7 +60,8 @@ watch(
// web端判断
const is_pc = computed(() => wxInfo().isPC);
// 预览模式不需要授权
const model = $route.query.model;
onMounted(async () => {
const code = getUrlParams(location.href) ? getUrlParams(location.href).code : '';
const raw_url = encodeURIComponent(location.pathname + location.hash);
......@@ -74,6 +75,7 @@ onMounted(async () => {
store.changeFormSetting(form_setting);
// 需要网页授权-必须要域名相同,需要上传到线上测试
if (!import.meta.env.DEV && form_setting.wxzq_enable && !form_setting.x_field_weixin_openid) {
if (model === 'preview') return false;
$router.replace({
path: '/auth',
query: {
......
......@@ -502,7 +502,7 @@ const onSubmit = async (values) => {
if (model === 'edit') {
console.warn(postData.value);
}
if (model === 'edit') return false;
if (model === 'edit' || model === 'preview') return false;
// 通过验证
const result = await addFormDataAPI({
form_code: $route.query.code,
......