alvin_cn
是的,还没有加认证,我想先实现功能,之后需要了再加入认证
已经试过禁用csrf,但还是报404是为什么呢?
朋友 你这个怎么解决的啊? 我在做restful api时也遇到这个问题.
试过了,不可以,应该是我nginx配置有问题,但找不到正确的配置方式。我新建了一个api应用,未开启url美化的情况下样式加载失败,开启url美化报404;
错误文本如下:- Failed to load resource: the server responded with a status of 404 (Not Found),
http://my.yii.com/api/assets/3353d214/css/bootstrap.css(这个地址有问题,但是不知道在哪里改)
nginx配置如下:server { charset utf-8; client_max_body_size 128M; listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 server_name my.yii.com; root /var/www/html/advanced/; index index.php; access_log /var/www/html/advanced/log/access.log; error_log /var/www/html/advanced/log/error.log; location / { root /var/www/html/advanced/frontend/web; try_files $uri /frontend/web/index.php$is_args$args; # avoiding processing of calls to non-existing static files by Yii location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { access_log off; expires 360d; try_files $uri =404; } } location /admin { alias /var/www/html/advanced/backend/web; rewrite ^(/admin)/$ $1 permanent; try_files $uri /backend/web/index.php?$args; } # avoiding processing of calls to non-existing static files by Yii location ~ ^/admin/(.+\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar))$ { access_log off; expires 360d; rewrite ^/admin/(.+)$ /backend/web/$1 break; rewrite ^/admin/(.+)/(.+)$ /backend/web/$1/$2 break; try_files $uri =404; } location ~ \.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/run/php/php7.0-fpm.sock; try_files $uri =404; } location = /requirements.php { deny all; } location ~* /\. { deny all; } }
解决了吗?朋友,我同样的问题
文件中searchModel指的是什么或者说是哪个文件,在yii2中哪个位置?