methods:{ /** * 添加访问量 */ add_hits(obj) { obj["hits"] = obj["hits"] + 1; var hits = obj["hits"]; this.$post('~/api/dish_information/set?dish_information_id=' + obj["dish_information_id"], { hits }, (res) => { if(res.result){ console.log("添加访问量状态:" ,res.result); var body = { source_table: "dish_information", source_field: "dish_information_id", source_id: this.obj.dish_information_id, user_id: this.$store.state.user.user_id, }; this.$post("~/api/hits/add?", body, (res) => { console.log(res); }); } else if(res.error){ console.error(res.error); } }); },
时间: 2023-12-06 08:42:40 浏览: 33
这是一个 Vue.js 的方法,用于向服务器发送 POST 请求来更新访问量和记录用户访问记录。具体来说,它接受一个包含菜品信息的对象 obj,然后将该对象的 hits 属性加 1。随后,它向服务器端发送一个 POST 请求,更新该菜品在数据库中的访问量。如果更新成功,它会再次向服务器端发送一个 POST 请求,记录用户的访问记录。最后,它会打印出服务器端返回的结果。
相关问题
Type gmake: *** [exinlibs/ADS_RCV.obj] Error 2
引用[1]: 这个编译错误是由于在编译过程中出现了问题导致的。具体来说,错误信息"gmake: *** [exinlibs/ADS_RCV.obj] Error 2"表示在编译exinlibs/ADS_RCV.obj这个文件时发生了错误。这可能是由于代码中的语法错误、缺少依赖文件或者编译器配置问题等原因导致的。
要解决这个问题,你可以尝试以下几个步骤:
1. 检查代码中是否存在语法错误或者其他编译错误。请仔细检查代码并确保没有任何错误。
2. 检查是否缺少必要的依赖文件。请确保所有需要的文件都已正确引入,并且路径设置正确。
3. 检查编译器的配置是否正确。请确保编译器的版本与CCS版本兼容,并且编译器的配置正确。
如果以上步骤都没有解决问题,你可以尝试以下额外的措施:
1. 清理并重新生成项目。有时候编译错误可能是由于编译过程中的一些临时文件或者缓存文件导致的。尝试清理项目并重新生成。
2. 更新CCS版本。如果你的CCS版本较旧,可能会存在一些已知的问题。尝试更新到最新版本并重新编译。
希望以上建议能够帮助你解决编译错误。如果问题仍然存在,请提供更多的详细信息,以便我们能够更好地帮助你解决问题。
gmake: *** [source/F2806x_PieVect.obj] Error 1
This error message is indicating that the make command (gmake) encountered an error while trying to compile the file "F2806x_PieVect.obj" in the "source" directory. The exact cause of the error may vary, but common reasons include syntax errors in the source code, missing or incorrect dependencies, or issues with the compiler or build environment. To resolve this error, you may need to review the source code and make sure it is correct, ensure that all necessary dependencies are installed and configured correctly, or seek assistance from a developer or support team.
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)