当前位置:网站首页>About foreign key references, cross domain headers, and ref usage
About foreign key references, cross domain headers, and ref usage
2022-07-19 01:24:00 【Wbig】
Solve the problem and report an error
1. problem

1.1 solve
Referencing foreign keys “” It's double “__”, Not just ""
2. Cross domain header problem
:8080/#/home/user:1 Access to XMLHttpRequest at ‘http://127.0.0.1:8000/v1/users/users’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource
2.1 solve
Whether the front-end route is written incorrectly , Forget to add "/“ And cause cross domain errors
front end vuex The route in , hinder ”/" , Remember to add !!!
Or look at the setting.py Is there a header and method that allows cross domain configuration under the file
CORS_ALLOW_METHODS = ("*") # Configure the allowed request methods
CORS_ALLOW_HEADERS = ("*") # Configure the allowed request headers
Sometimes , direct writing "*", If it doesn't work , Reading the newspaper is wrong in the request header or the request method , Add this method under the corresponding
CORS_ALLOW_METHODS = ("*","POST") # Configure the allowed request methods
CORS_ALLOW_HEADERS = ("*","Access-Control-Allow-Origin") # Configure the allowed request headers
3. ref Usage of
1、ref Add to common elements , use this.ref.name What you get is dom Elements
2、ref Add to the subcomponent , use this.ref.name Get the component instance , You can use all the methods of the component .
3、 How to use it v-for and ref Get a set of arrays or dom node ( Help select nodes )
边栏推荐
猜你喜欢
随机推荐
Oracle automatic storage management (ASM)
maker-论文资料查找培训-笔记
数学基础02——数列极限
Day10-前后连调
从[第五空间 2021]EasyCleanup认识php_session
Day06 ORM field and operation
flutter 项目 ScrollController attached to multiple scroll views,Failed assertion: line 109 pos 12 报错处理
RSA之共模攻击与共享素数
Hutool official graphics
单元测试(二)--Junit
物联网开发基础
鼠标右键菜单添加快速打开选项遇见的错误:
2021-3-22-有向图整理
Eye of depth III - (4, 5)] mathematics: matrix eigenvalues and eigenvectors 2
Day12 Association serialization processing
PCRE绕过正则
Day06-ORM字段及操作
P6-day01-general attempt (P4 review)
Oracle 数据库启用归档日志模式和归档日志删除和生成频率
Oracle database enables archive log mode and archive log deletion and generation frequency









