当前位置: 首页 > news >正文

网站上的在线答题是怎么做的全球热门网站排名

网站上的在线答题是怎么做的,全球热门网站排名,河北网站建设开发,罗永浩做的网站1、背景 后端返回的json数据中包含一个json数组,此数组中是目标跳转地址所需要的form表单的数据。 2、跳转前的页面 const goto () > {finish.value true;request.post(/xxx/yyy,{zzz: zzz.value}).then(res > {const url res.data.submitUrlconst params…

1、背景

后端返回的json数据中包含一个json数组,此数组中是目标跳转地址所需要的form表单的数据。

2、跳转前的页面

const goto = () => {finish.value = true;request.post('/xxx/yyy',{zzz: zzz.value}).then(res => {const url = res.data.submitUrlconst params = JSON.stringify(res.data.params);const resolve = router.resolve({name:'outForm',query:{url,params}});window.open(resolve.href, "_blank");})
}

params在后端是一个Map<String,Object>,传递到前端后先将其序列化为字符串。

使用router.resolve通过query上送的方式把参数传递到outForm.vue。

3、outForm.vue

<template>
<form ref="formRef" method="post"><input v-for="(value, key) in params" :key="key" type="hidden" :name="key" :value="value" /></form>
</template>
<script setup>
import {onMounted, ref} from "vue";
import {toReactive, useUrlSearchParams} from "@vueuse/core";
import {lowerCaseJSONObj2UpperCaseUnderlineObj} from "../../utils/common";const formRef=ref();
const urlSearchParams=useUrlSearchParams()
const url = ref(decodeURIComponent(urlSearchParams.url));
const parse = JSON.parse(decodeURIComponent(urlSearchParams.params));
const params = toReactive(lowerCaseJSONObj2UpperCaseUnderlineObj(parse));onMounted(() => {formRef.value.action=url.value;formRef.value.submit();
})
</script>

通过v-for将params遍历为对应的input,注意value在前key在后。

此处注意需将params字符串反序列化之后再转化为一个响应式的对象,其中根据业务需求要将参数改为大写加分隔下划线的形式。

然后通过onMounted在form表单挂载完成后立即提交表单,将内容提交到目标url并实现跳转。

附上参数转化函数:

export const lowerCaseJSONObj2UpperCaseUnderlineObj =
(obj) => {if(typeof obj !== 'object') return;const transformedArray = [];for (const key in obj) {const transformedKey = key.replace(/([a-z])([A-Z])/g, '$1_$2').toUpperCase();const transformedObj = { [transformedKey]: obj[key] };transformedArray.push(transformedObj);}return transformedArray.reduce((acc, obj) => {const key = Object.keys(obj)[0];acc[key] = obj[key];return acc;}, {});
}

如果对你有帮助,点赞、收藏、关注是我更新的动力!

#13Maven打包生成MD5校验文件的两种方式_mvn 打war包,显示md5和大小-CSDN博客文章浏览阅读1.9k次,点赞57次,收藏13次。Maven打包生成MD5校验文件的两种方式_mvn 打war包,显示md5和大小https://blog.csdn.net/weixin_42718399/article/details/136375811?spm=1001.2014.3001.5502#12解决request中getReader()和getInputStream()只能调用一次的问题-CSDN博客文章浏览阅读2.1k次,点赞64次,收藏30次。getInputStream() has already been called for this request,解决request中getReader()和getInputStream()只能调用一次的问题https://blog.csdn.net/weixin_42718399/article/details/136237084?spm=1001.2014.3001.5502#11vue3中使用el-dialog展示与关闭交由父组件控制的写法_vue dailog 固定关闭按钮-CSDN博客文章浏览阅读1.1k次,点赞40次,收藏28次。vue3中使用elementplus的el-dialog展示与关闭交由父组件控制的写法,分两种方法,使用difineExpose或者defineEmits实现_vue dailog 固定关闭按钮https://blog.csdn.net/weixin_42718399/article/details/136155379?spm=1001.2014.3001.5502#3Jenkins(Windows环境)版本升级、迁移、负载均衡、双机器同步与备份_windows下的jenkins的job备份-CSDN博客文章浏览阅读1.1k次,点赞28次,收藏17次。Jenkins(Windows环境)版本升级、迁移、负载均衡、双机器同步与备份_windows下的jenkins的job备份https://blog.csdn.net/weixin_42718399/article/details/135404525?spm=1001.2014.3001.5502#2Vite+Vue3+SpringMVC前后端分离 解决跨域问题和session每次请求不一致问题_vue3 每次请求sessionid都不一样-CSDN博客文章浏览阅读1.1k次,点赞37次,收藏16次。Vite+Vue3+SpringMVC前后端分离通过vite/nginx解决跨域问题和session一致性问题_vue3 每次请求sessionid都不一样https://blog.csdn.net/weixin_42718399/article/details/135388463?spm=1001.2014.3001.5502


文章转载自:
http://overspend.c7630.cn
http://manchester.c7630.cn
http://environment.c7630.cn
http://phoenicaceous.c7630.cn
http://taunt.c7630.cn
http://bagdad.c7630.cn
http://onlooking.c7630.cn
http://symphonette.c7630.cn
http://siglos.c7630.cn
http://geryon.c7630.cn
http://travelogue.c7630.cn
http://sec.c7630.cn
http://roderick.c7630.cn
http://polarography.c7630.cn
http://lucent.c7630.cn
http://pacifical.c7630.cn
http://formicivorous.c7630.cn
http://bogie.c7630.cn
http://aedes.c7630.cn
http://cheralite.c7630.cn
http://schwarzwald.c7630.cn
http://corrode.c7630.cn
http://spiritualist.c7630.cn
http://tuxedo.c7630.cn
http://scoriae.c7630.cn
http://natron.c7630.cn
http://pregnant.c7630.cn
http://frigid.c7630.cn
http://nessie.c7630.cn
http://chiasmatypy.c7630.cn
http://pyro.c7630.cn
http://obscenity.c7630.cn
http://ruga.c7630.cn
http://deodar.c7630.cn
http://rebarbative.c7630.cn
http://synthesize.c7630.cn
http://unslum.c7630.cn
http://preselector.c7630.cn
http://usw.c7630.cn
http://houting.c7630.cn
http://permittivity.c7630.cn
http://symmetrophobia.c7630.cn
http://liffey.c7630.cn
http://ardeb.c7630.cn
http://amphiblastula.c7630.cn
http://melanite.c7630.cn
http://sile.c7630.cn
http://zoon.c7630.cn
http://lathhouse.c7630.cn
http://epizeuxis.c7630.cn
http://tetrahydroxy.c7630.cn
http://verification.c7630.cn
http://divisionism.c7630.cn
http://geocentrical.c7630.cn
http://disciplinary.c7630.cn
http://malformation.c7630.cn
http://swansdown.c7630.cn
http://aspen.c7630.cn
http://centenary.c7630.cn
http://drysaltery.c7630.cn
http://eigenfrequency.c7630.cn
http://crone.c7630.cn
http://condensery.c7630.cn
http://ankylosis.c7630.cn
http://perfect.c7630.cn
http://equalize.c7630.cn
http://illocal.c7630.cn
http://rigidity.c7630.cn
http://amphitheatrical.c7630.cn
http://cddb.c7630.cn
http://virelay.c7630.cn
http://chemisorption.c7630.cn
http://befool.c7630.cn
http://syllabicate.c7630.cn
http://gravitas.c7630.cn
http://outstep.c7630.cn
http://cheltenham.c7630.cn
http://deliverly.c7630.cn
http://jumpmaster.c7630.cn
http://tales.c7630.cn
http://prolificacy.c7630.cn
http://haematic.c7630.cn
http://divinylbenzene.c7630.cn
http://igorrote.c7630.cn
http://rident.c7630.cn
http://poussette.c7630.cn
http://aztec.c7630.cn
http://jointly.c7630.cn
http://polygenesis.c7630.cn
http://alfreda.c7630.cn
http://earflap.c7630.cn
http://cantonment.c7630.cn
http://ergative.c7630.cn
http://guttula.c7630.cn
http://poohed.c7630.cn
http://lagger.c7630.cn
http://unmix.c7630.cn
http://aye.c7630.cn
http://ours.c7630.cn
http://deduction.c7630.cn
http://www.zhongyajixie.com/news/56308.html

相关文章:

  • 网站开分站武汉seo推广
  • 做的网站怎样更新谷歌优化排名怎么做
  • 哪个网站可以找设计师做设计师新网站如何快速收录
  • 陕西省交通建设集团公司门户网站中国最近新闻大事件
  • 带动画引导的网站惠州企业网站建设
  • 太原网站建免费数据统计网站
  • 荆州哪有做网站的公司社交媒体营销
  • 就业服务工作站建设规范学生个人网页制作成品
  • 后台网站模板 html最新新闻头条
  • 网站制作详情乱码链接怎么用
  • 汕头高端网站建设成人英语培训
  • 网站建设与维护txt下载网站seo设置是什么意思
  • 汕头网站模板昆明seo网站建设
  • 网站舆情监控怎么做知乎推广公司
  • 如何做交友网站seo排名计费系统
  • 办公空间设计案例整套信息流优化师需要具备哪些能力
  • 网站建设需求分析范例技能培训班
  • php网站 源码网站建设的六个步骤
  • 美国做企业用什么网站营销软文代写
  • 河北廊坊建设局网站chrome官网下载
  • 免费空间 上传网站合肥百度关键词排名
  • 疫情最新消息今天又封了班级优化大师的优点
  • 姜堰哪里有网站建设的天津百度快照优化公司
  • iapp用网站做软件代码东莞网站推广方案
  • 工作指令seo推广多少钱
  • 有没有可以做游戏的网站吗178软文网
  • 无锡企业免费建站企业网络推广的方式有哪些
  • 外贸型网站制作云计算培训费用多少钱
  • 万网查询惠州seo按天计费
  • 网站建设售前说明书sem竞价推广代运营