Coder Social home page Coder Social logo

liyingxuan / steemit-api-cms Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 4.59 MB

高仿Steemit,使用Larave5.5 + Vue2重写中心化部分。此为后端cms和api。

PHP 55.82% PLpgSQL 16.52% HTML 27.49% Vue 0.17%
laravel laravel55 steem steemit php php7 steem-php

steemit-api-cms's Introduction

Steem-CMS-API

高仿Steemit,使用Laravel + Vue重写。
这是CMS和API部分。

配套的前端代码:
steemit-vuejs2

1. Language and framework

PHP >=7.0.0
Laravel v5.5.*
laravel-admin v1.5.x-dev
Bootstrap v3.3.7

2. Install and run

Deploy the server environment

Reboot server.

Go in project path :

$ cd [project path]

$ composer install
$ npm install

$ cp .env.example .env
$ php artisan key:generate 
# 将生成的key保存到.env中

$ php artisan passport:install
# 将生成的两个CLIENT_Secret保存到.env中

After the database can be connected properly, import the database structure and data.
确保数据库能连接正常之后,导入数据库结构和数据:

./database/sql/steemit.sql

3. 注意事项

有随机无法使用token proxy的问题

./steemit-api-cms/app/Http/Proxy/TokenProxy.php 中需要配置了env中的:
MY_API_HTTP_HEAD=http://steemit.dev/ 才能正确使用,而且有可能不能为localhost。
随机有bug,可以本地建一个虚拟主机,例如:steemit.dev。

前端获取的token无法验证; Bearer token无法验证
/**
 * 设置JWT用户认证所需的http Authorization头信息:
 */
axios.interceptors.request.use(function (config) {
  if(jwtToken.getToken()) {
    // Bearer后需要一个空格!!!
    config.headers['Authorization'] = 'Bearer' + ' ' + jwtToken.getToken()
  }
  return config
}, function (error) {
  return Promise.reject(error)
})

steemit-api-cms's People

Contributors

liyingxuan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.