Fecmall

第 2 位会员

会员
个人信息
  • 加入于 2017-05-31 17:38:45
  • 城市 Qingdao
  • GitHub https://github.com/fecshop
  • 最后登录时间 5天前
  • 签名 净化自己,潜心编码
个人简介
Terry,Fecmall开源产品作者,12年电商经验一线程序员开发者,擅长规划产品,架构设计。
个人成就
  • 发表文章次数 744
  • 发布回复次数 5760
  • 个人主页浏览次数 683
关于本地Windows环境测试安装Fecyo无反应5年前

chrome打开debug窗口,可以看到下载的ajax执行,可以看到报错信息,你这个猜测php超时导致的

1.php设置超时时间,你网上找一下资料

2.nginx超时也要设置一下

3.参考资料:http://www.fecmall.com/topic/2103

关于本地Windows环境测试安装Fecyo无反应5年前

因为下载需要时间,网速限制,30秒时间不够

你需要设置一下php超时时间

fecyo 和 fectb的区别5年前

@OneSmile #2楼 目前fecyo已经独立出来,不依赖fectb

php7安装imagick扩展5年前

不要安装 3.4.4, 使用报错:Function Imagick::setimageopacity() is deprecated

详细: http://www.fecmall.com/topic/2441

Redis 购物车出错:Not Supported5年前

先收藏一下,三月中旬处理,最近有点忙

通过API 添加产品,返回错误5年前

@xinyc1126 #4楼 三月中旬有时间,先记录一下

Redis 购物车出错:Not Supported5年前

后面找时间处理一下,你先关掉redis cart吧

产品批量上传页面出现 500 错误5年前

嗯,这个报错的原因是,Manager.php 没有父类,因此不能使用parent::init()函数

因此需要去掉这个。

通过API 添加产品,返回错误5年前

@xinyc1126 [#2楼](#comment2)

appapi这个入口,当时升级fecmall-2版本,没有去测试,您自己debug一下看看吧,为什么没有使用mysqldb services

目前有点忙,等忙完了,我把appapi入口整理核实一遍

通过API 添加产品,返回错误5年前

看你的报错,产品部分使用了 mongodb services

后台 产品services请使用默认的mysqldb services,而不是用mongodb services

网站配置 --> 基础配置 --> services数据库配置

https://github.com/fecshop/yii2_fecshop/blob/master/services/Product.php#L81

vue 无法获得access-token5年前

1.access_token是登陆后才会有的,这个是用来标记登陆状态, 登陆用户操作会返回access_token,

2.登陆用户,生成access_token,写入response header 返回

https://github.com/fecshop/yii2_fecshop/blob/master/services/Customer.php#L795

$this->setHeaderAccessToken($identity->access_token);

https://github.com/fecshop/yii2_fecshop/blob/master/services/Customer.php#L878

 protected function actionSetHeaderAccessToken($accessToken)
    {
        if ($accessToken) {
            Yii::$app->response->getHeaders()->set('access-token', $accessToken);
            return true;
        }
    }

在用户登陆后就会返回access_token,从header获取

3.access_token的验证

https://github.com/fecshop/yii2_fecshop/blob/master/app/appserver/modules/AppserverTokenController.php#L57

$behaviors['authenticator'] = [  
            'class' => CompositeAuth::className(),  
            'authMethods' => [  
                # 下面是三种验证access_token方式  
                //HttpBasicAuth::className(),  
                //HttpBearerAuth::className(),  
                # 这是GET参数验证的方式  
                # http://10.10.10.252:600/user/index/index?access-token=xxxxxxxxxxxxxxxxxxxx  
                QueryParamAuth::className(),  
            ],  
          
        ];  

https://github.com/fecshop/yii2_fecshop/blob/master/yii/filters/auth/QueryParamAuth.php#L27

 public function authenticate($user, $request, $response)
    {   
        $identity = Yii::$service->customer->loginByAccessToken(get_class($this));
        if($identity){
            return $identity;
        }else{
            $cors = Yii::$service->helper->appserver->getYiiAuthCors();
            if (is_array($cors)) {
                foreach ($cors as $c) {
                    header($c);
                }
            }
            $code = Yii::$service->helper->appserver->account_no_login_or_login_token_timeout;
            $result = [ 'code' => $code,'message' => 'token is time out'];
            Yii::$app->response->data = $result;
            Yii::$app->response->send();
            Yii::$app->end();
        }
    }

https://github.com/fecshop/yii2_fecshop/blob/master/services/Customer.php#L808

/**
     * Logs in a user by the given access token.
     * Token is passed through headers. So you can get it from the key 'access-token'.
     * @param $type
     * @return IdentityInterface|null the identity associated with the given access token. Null is returned if
     * the access token is invalid.
     * @see [[\yii\web\User::loginByAccessToken()]]
     */
    protected function actionLoginByAccessToken($type = null)
    {
        $header = Yii::$app->request->getHeaders();
        if (isset($header['access-token']) && $header['access-token']) {
            $accessToken = $header['access-token'];
        } else {
            return null;
        }

        /** @var \fecshop\models\mysqldb\Customer|null $identity */
        $identity = Yii::$app->user->loginByAccessToken($accessToken, $type);
        if ($identity !== null) {
            $access_token_created_at = $identity->access_token_created_at;
            $timeout = Yii::$service->session->timeout;
            // 如果时间没有过期,则返回 identity
            if ($access_token_created_at + $timeout > time()) {
                // 如果时间没有过期,但是快要过期了,在过$updateTimeLimit段时间就要过期,那么更新access_token_created_at。
                $updateTimeLimit = Yii::$service->session->updateTimeLimit;
                if ($access_token_created_at + $timeout <= (time() + $updateTimeLimit)) {
                    $identity->access_token_created_at = time();
                    $identity->save();
                }
                return $identity;
            } else {
                $this->logoutByAccessToken();
                return null;
            }
        }
        return null;
    }
Fecmall 二次开发的命名问题5年前

1.有问题再帖子:http://www.fecmall.com/topic/1889 留言

2.提案阶段会告知采用的技术框架是基于的Fecmall的二次开发,这个是需要的

批量上传分类和产品没有反应5年前

最近有一个朋友上传excel报错,远程调试了一下,是文件权限导致的

解决方案,详细参看帖子:http://www.fecmall.com/topic/2432

PC微信扫码登录页面异常5年前

1.安装问题已经回复:http://www.fecmall.com/topic/2429

2.微信扫码登陆,需要后台配置微信公众号信息,以及微信公众号(服务号)进行配置 ,严格按照文档配置,少了任意步骤都会出问题。

fecmall手机号登陆插件点击安装无反应5年前

有一个小问题,已经处理,您重新安装试试

需要写一个火车头产品发布模块5年前

@xinyc1126 #8楼 不熟悉火车头

要做的话,直接在fecmall中集成,不借助任何其他的工具。

Your Site Analytics