this.$myHttp({ method: 'post', url: this.prefix + "/collection/sdModel/update", data: saveData }).then(res => { if (res.code == 200) { this.$myHttp({ method: 'get', url: this.prefix + "/collection/ddlTool/initModelViewData?modelId=" + this.modelId }).then(res => { this.$message.success('保存成功');}) } })
时间: 2024-02-10 20:33:48 浏览: 32
这段代码是在保存表单数据后,向后端发起另一个请求获取某个模型的视图数据。具体来说,该代码通过 $myHttp 方法向后端发送一个 post 请求,请求 url 为 this.prefix + "/collection/sdModel/update",请求参数为 saveData。如果请求成功,会执行该方法的 then 回调函数,其中会向后端发送一个 get 请求,请求 url 为 this.prefix + "/collection/ddlTool/initModelViewData?modelId=" + this.modelId,并在请求成功后弹出保存成功的提示框。
相关问题
忽略src下的http模块怎么写呢
如果要忽略 Node.js 中 `src` 目录下的 `http` 模块,可以在引用该模块的代码处使用 `require` 函数时,将其替换为另一个模块,例如:
```javascript
const myHttp = require('./my-http-module');
```
其中,`my-http-module` 是一个自定义的模块,它可以提供与 Node.js 中 `http` 模块相同的功能,或者根据实际需要提供自定义的功能。这样,在代码中就可以使用 `myHttp` 替代 `http`,从而忽略 `src` 目录下的 `http` 模块。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![xlsx](https://img-home.csdnimg.cn/images/20210720083732.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)