pc端安装好了没问题,手机端图片显示不出来?手机端切换语言出现403

问题咨询 · tree · 于 6年前 发布 · 2906 次阅读

![](https://i.loli.net/2017/09/14/59ba225c2f946.png)

共收到 12 条回复
tree#16年前 0 个赞

Fecmall#26年前 0 个赞

1.语言切换需要进行相应的配置,譬如你切换成了fr语言,地址为:

http://fecshop.apphtml5.fancyecommerce.com/es/

你需要到@app/web/ 路径下面,查看是否存在es,目前只有fr cn两个语言目录,参看文件: https://github.com/fecshop/yii2_fecshop_app_advanced/tree/master/apphtml5/web

如果你要添加其他的语言,可以复制fr文件夹成一个新的,然后更改下名字,譬如es。

然后去 store.php 中配置一下store即可。

2.图片不显示的处理:

你清空一下这个文件路径 appimage/common/media/catalog/product/cache/ 下的所有文件。然后重新访问试试

Fecmall#36年前 0 个赞

对于第一点,看您配置好了,而且是cn,您需要添加一下nginx配置,稍等我给你找找

Fecmall#46年前 0 个赞

需要在nginx里面添加配置:

location /cn/ {
        index index.php;
        if (!-e $request_filename){
                rewrite . /cn/index.php last;
        }
    }

完整配置如下:


server {
    listen     80  ;
    server_name fecshop.apphtml5.fancyecommerce.com fecshop.apphtml5.es.fancyecommerce.com;
    root  /www/web/develop/fecshop/apphtml5/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        include fcgi.conf;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
    }
	location /fr/ {
        index index.php;
        if (!-e $request_filename){
                rewrite . /fr/index.php last;
        }
    }
    location /es/ {
        index index.php;
        if (!-e $request_filename){
                rewrite . /es/index.php last;
        }
    }

    location /cn/ {
        index index.php;
        if (!-e $request_filename){
                rewrite . /cn/index.php last;
        }
    }

    location /de/ {
        index index.php;
        if (!-e $request_filename){
                rewrite . /de/index.php last;
        }
    }

    location ~ .*\.(js|css)?$ {
        expires      12h;
    }
    location /api {
        rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
    }


}
tree#56年前 0 个赞

嗯,这个文件路径 appimage/common/media/catalog/product/cache/ 下的所有文件我都清空了,pc端的图片显示没问题,手机端的显示不出来,图片存放的公共路径应该就是appimage这个文件吧

tree#66年前 0 个赞

nginx的手机端我也配置了,但切换语言出现403,pc端的切换语言没任何问题

tree#76年前 0 个赞

缓存是清了的,手机端的图片还是显示不了,浏览器的缓存也清理了,pc端的图片都能正常显示

Fecmall#86年前 0 个赞

@tree #7楼

1.图片 你清空下浏览器缓存

2.你去看看你是否有这个文件夹嘛,解决问题能力这么差,这个和fecshop没有关系,你nginx配置有问题, 或者@app/web/cn/index.php 不存在,访问不到入口文件,就是自己配置的问题。

Fecmall#96年前 0 个赞

403就是找不到文件,这个就是nginx配置,以及配置下找不到文件的报错,这个自己诊断。

别人只能提示,具体自己去解决

Fecmall#106年前 0 个赞

@tree #7楼 手机端的图片是懒加载模式,你是不是改动东西造成没有执行懒加载?

<img width="100%" src="//img.fancyecommerce.com/media/catalog/product/cache/bd935443df1c50537d4edaab4af5d446/296/0/2/01/20160722142719_52348.jpg" class="lazy" data-src="//img.fancyecommerce.com/media/catalog/product/cache/bd935443df1c50537d4edaab4af5d446/296/0/2/01/20160722142719_52348.jpg">

图片的实际地址是:data-src,里面存储的地址

tree#116年前 0 个赞

好的,谢谢,切换语言问题已经解决,图片问题自己去看看,第一次接触fecshop

Fecmall#126年前 0 个赞

好的,先尝试自己解决,自己解决了,可以在这里发 技术分享 帖子

解决不了,就在这里发帖提问

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics