Coder Social home page Coder Social logo

jcc / blog Goto Github PK

View Code? Open in Web Editor NEW
2.9K 150.0 691.0 6.86 MB

:star2: PJ Blog is an open source blog built with Laravel and Vue.js.

Home Page: https://www.pigjian.com

License: MIT License

PHP 54.80% JavaScript 6.52% Vue 24.52% Shell 0.02% Blade 14.01% Dockerfile 0.13%
laravel vuejs vue pj-blog blog open-source beautiful

blog's Issues

public/.htaccess 问题

安装后,点击“login”,出现 404 页面内。

修改原来的 .htaccess 如下:

# Redirect Trailing Slashes If Not A Folder...
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php/$1 [L]

点击 login 都是 404,只有在 url 后面添加 index.php,才可以看到页面。不过,样式与 JavaScript 文件都包含不进来了。我觉得你的这个项目并没有什么作用。

Undefined index: avatar_url... with facebook socialite

I modified the code on AuthController so can add more socialite providers buy changing public function redirectToProvider()
{
return Socialite::driver($github)->redirect();
}
to
public function redirectToProvider($provider)
{
return Socialite::driver($provider)->redirect();
}

here is a full code

public function redirectToProvider($provider)
{
return Socialite::driver($provider)->redirect();
}

/**
 * Obtain the user information from GitHub.
 *
 * @return Response
 */
public function handleProviderCallback($provider)
{
    $User = Socialite::driver($provider)->user();
    $user = $this->user->getByProviderId($User->id);

    if (auth()->check()) {
        $currentUser = auth()->user();

        if ($currentUser->provider_id) {
            return redirect()->back();
        } else {
            if ($user) {
                return redirect()->back();
            } else {
                $this->bindProvider($currentUser, $User);

                return redirect()->back();
            }
        }
    } else {
        if ($user) {
            auth()->loginUsingId($user->id);
            return redirect()->to('article');
        } else {
            $this->registerUser($User);
            return redirect()->to('auth/register');
        }
    }
}

/**
 * Bind the github account.
 *
 * @param $currentUser
 * @param $registerData
 * @return mixed
 */
public function bindProvider($currentUser, $registerData)
{
    $currentUser->provider_id = $registerData->user['id'];
    $currentUser->name = $registerData->nickname;
    $currentUser->url = $registerData->user['url'];

    return $currentUser->save();
}

/**
 * Save the register data in session.
 *
 * @param $registerData
 */
public function registerUser($registerData)
{
    $data['avatar'] = $registerData->user['avatar_url'];
    $data['provider_id'] = $registerData->user['id'];
    $data['url'] = $registerData->user['url'];
    $data['name'] = $registerData->nickname;
    $data['nickname'] = $registerData->user['name'];
    $data['email'] = $registerData->user['email'];

    session()->put('oauthData', $data);
}

/**
 * Display the github oauth for register page.
 *
 * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\View\View
 */
public function create()
{
    if (! session()->has('oauthData')) {
        return redirect()->to('login');
    }

    $oauthData = array_merge(session('oauthData'), request()->old());

    return view('auth.register', compact('oauthData'));
}

/**
 * Store a new user.
 *
 * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
 */
public function store()
{
    if (! session()->has('oauthData')) {
        return redirect('login');
    }

    $this->validator(request()->all())->validate();

    $oauthData = session('oauthData');

    $data = array_merge($oauthData, request()->all());

    $data['password'] = bcrypt($data['password']);

    $data['status'] = true;

    auth()->guard()->login(User::create($data));

    session()->forget('oauthData');

    return redirect()->to('article');
}

But I get this

socialite

isSubmiting for Discussion

Discussion submission needs isSubmiting variable
If server lag you can submit 3-4 times same discussion.

新建article不成功,报301

Uploading Screen Shot 2017-04-13 at 12.31.11 PM.png…

post请求报301,然后重定向到get了,不知道什么原因,一直创建不了新的文章。

Uploading Screen Shot 2017-04-13 at 12.30.55 PM.png…
麻烦大牛了,谢谢!

Adding new article not working?

I try to add a new article but nothing happen the database is empty and the list of article also showing nothing.. U guess something related to the post method in the Form Article

` onSubmit() {
if (!this.tags || !this.selected) {
toastr.error('Category and Tag must select one or more.')
return;
}

        let tagIDs = []
        let url = 'article/' + (this.article.id || '')
        let method = (this.mode == 'update') ? 'patch' : 'post'

        for(var i = 0 ; i < this.tags.length ; i++) {
            tagIDs[i] = this.tags[i].id
        }

        this.article.published_at = this.startTime.time
        this.article.content = this.simplemde.value()
        this.article.category_id = this.selected.id
        this.article.tags = JSON.stringify(tagIDs)

        this.$http[method](url, this.article)
                .then((response) => {
                    toastr.success('You ' + this.mode + 'd the article success!')

                    this.$router.push('/dashboard/articles')
                }).catch(({response}) => {
                    stack_error(response.data)
                })
    },

`

thanks

I use windows 10 + local Xampp server.

Article content

Article 表的content里面夹杂了html和markdown,如果再建一个字段分别存放这两个内容的话,可以用solr来做full text search。

.ajaxForm is not a function

in user profile when i try to upload an avatar i get this javascript error

Uncaught TypeError: $(...).ajaxForm is not a function

Change language and color

Hi,

Can You tell me where I can change language of control panel items like Articles, Tags etc.?
I also don't know where to change color of view elements like navbar?

Thanks

dir name error

test/Unit dir name is error. you spell Unit start with \n

Image

Need your help... am I missing something on AvatarUpload.js? because when I click on okay button nothing really happens. When i set crop = false then try to upload avatar it just send the avatar into the storage and not the database. I used your latest release v1.1.6

screenshot from 2017-03-03 00-19-30
screenshot from 2017-03-03 01-02-22

Dashboard

I don't know if it's me or but after making the recent changes you did, my admin dashboard just don't show up. Everything else does show but the admin panel, all i see is a blank white page..

Like System on the comment vue

Hello to you I wanna thank you for your blog its awesome.
I wanna add the Like system to the comment and to the articles

so I add this the the template section in the Comment.vue
<a href="javascript:;" @click="like(index)"><i class="ion-ios-heart"></i></a>

I have this in the Javascritp section in Comment.vue
like(index) { this.comments[index].like = !this.comments[index].like this.comments[index].like ? this.comments[index].like_num++ : this.comments[index].like_num-- }

the question how can I make it works? do I have to add a field in the database comment table : like_num?

thanks for the help.

Upload Image to articles bug

hi jian, my problem is when I try to upload an image to the article cover, the image upload for all articles, and it not show the extension of the image file, this is a video to explain to you the issue

thanks again.

Editing profile error

Hi,

when I try to edit profile, I get this error:

ErrorException in helpers.php line 412:
File js/jcrop.js not defined in asset manifest. (View: /home/ubuntu/workspace/resources/views/user/profile.blade.php)
in helpers.php line 412
at CompilerEngine->handleViewException(object(InvalidArgumentException), 1) in PhpEngine.php line 44
at PhpEngine->evaluatePath('/home/ubuntu/workspace/storage/framework/views/7eac6ec6ee2880a80eeb3f7ce028ddf3c482e05f.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'user' => object(User))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/ubuntu/workspace/resources/views/user/profile.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'user' => object(User))) in View.php line 137
...
...
...

Can You help me?

Thanks in advance

Upload Avatar Fail (Image source not readable)

When I try to upload my avatar(.jpg), I get
Failed to load resource: the server responded with a status of 404 (Not Found)

After Click "确 定" button, I check the F12 on chrome, 500 error,
Uncaught (in promise) Error: Request failed with status code 500 (Image source not readable)
avatar1
avatar2

Avatar upload

I can't upload, change avatar. It does select the avatar but there are no changes from the default avatar into a new selected one.

Avatar Upload

Hello, I've pulled the latest version that uses the AvatarUpload.vue but still i have the avatar upload issue, but it does upload the images into the public path uploads/avatar it's just it doesn't change from default avatar into a new uploaded avatar... I uploaded a screen shot of the issue so you can see because i get this... http://127.0.0.1:8000/user/profile/1 with a response status code 302, it seems like it does Post but doesn't return anything.

  1. How do I change timezones, every time I create an article it's like 1 and a half hour ahead my timezone?

imageupload

Please help, Thank you.

Discussion Comment if the status is false

Hi, thank you for this awesome blog.
my issue is when I make the discussion status off, I still can comment and I get a alert that the comment is disabled...

https://www.youtube.com/watch?v=EYimD-PBN9c

my fix for that is to check if the status is = 0 then I show just the comment without the textaria, and if = 1 I show normal comment for all guest and user..

my code :

@if($discussion->status == 0)
<comment commentable-type="discussions"
commentable-id="{{ $discussion->id }}"
null-text="dfasdf"></comment>
@else
@if(Auth::guest())
<comment commentable-type="discussions"
commentable-id="{{ $discussion->id }}"
null-text=""></comment>
@else
<comment username="{{ Auth::user()->name }}"
user-avatar="{{ Auth::user()->avatar }}"
commentable-type="discussions"
commentable-id="{{ $discussion->id }}"
null-text=""
can-comment></comment>
@endif
@endif

Vote system needs a helper HasVotedType

Right now, you can only know if user has voted by is_voted, in the comment.vue

Need also something like is_voted_type to know what kind of vote was that, Down or Up.

"/discussion" route error exception

When I logged in as admin, hit the "/discussion" route, this error occur. My OS is Linux Mint, I tried to change folder permission(/storage) but still got the same error.

discussion

BTW, you can reply me in Chinese, because I just installed this OS I haven't figure how to type Chinese in Linux, thanks you for provide this awesome project!

SEO ?

Maybe a good practice to think about some issues with SEO

Here is HTMLImprovements report from google webmasters tools search console
about the blog
2017-04-24 15-40-46

Maybe we could use the articles Meta description as page metadescription
and article tags as title tags

Also Search Engines "like" when every page have 1 <h1>

Can't get list of my follower's

Currently i can check only people i'm Following from my profile. There should be a link where i can check people those are following me.

#eg:
vijay koogu vijaykoogu on bloglovin followers

留言bug

Uploading image.png…

FatalThrowableError in ReceivedComment.php line 54:
Call to undefined method Illuminate\Notifications\Messages\MailMessage::to()

The parameter app_id is required

It's not an issues with your app but I wanna know what could be the possible issue with this error because i do have app_id on my .env file and on my services.php file.

screenshot from 2017-03-09 15-06-47

No database selected issues.

if I run php artisan blog:install, I got some massages following.

php artisan key:generate
Application key [base64:cDeboONQP5eHhkErNlhyVfqCzHyWL/9SltOcJFSnZbQ=] set successfully.



php artisan migrate --seed

[Illuminate\Database\QueryException]
SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected (SQL: create table migrations (id int unsign
ed not null auto_increment primary key, migration varchar(255) not null, batch int not null) default character set utf8 collate utf8_unicode_ci)

[PDOException]
SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected



php artisan passport:install
Encryption keys generated successfully.

[Illuminate\Database\QueryException]
SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected (SQL: insert into oauth_clients (user_id, n ame, secret, redirect, personal_access_client, password_client, revoked, updated_at, created_at) values (, PJ Blog Personal Access Client, QfMFsu6SGodoThaVinX8rTLS7K7nQbZNVqM94q9B, http://localhost, 1, 0, 0, 201
7-01-08 16:41:50, 2017-01-08 16:41:50))

[PDOException]
SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected


And .env file like this:

APP_ENV=local
APP_KEY=base64:cDeboONQP5eHhkErNlhyVfqCzHyWL/9SltOcJFSnZbQ=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

editing the discussion item return an error

hi hope you doing well,

I try to edit a discussion and I get this error :

Argument 1 passed to App\Repositories\DiscussionRepository::update() must be an instance of App\Repositories\int, string given, called in C:\xampp\htdocs\blog\app\Http\Controllers\DiscussionController.php on line 121 and defined

both side from dashboard and also from the homepage...

the discussionRepository code :

    /**
     * Update a record by id.
     * 
     * @param  int $id
     * @param  array $data
     * @return boolean
     */
    public function update($id, $data)
    {
        $this->model = $this->checkAuthScope();

        $discussion = $this->model->findOrFail($id);

        if (is_array($data['tags'])) {
            $this->syncTag($discussion, $data['tags']);
        } else {
            $this->syncTag($discussion, json_decode($data['tags']));
        }

        return $discussion->update($data);
    }

creating article issue

I have an issue with creating an article update, every time I try to create an article it doesn't get created or posted and i get this using the latest code updates.

article

Article Page Image

Plus is there another way to select a page image without actually typing an image path like 'images/image.jpg' maybe to use a button to select a path of a page image from a device/computer storage just in case of an end user?

page image

I am sorry if I am bothering you Sir, this a a great project that you have.

don't work

本地安装测试没有问题;
部署后出现问题

Live video stream

Hello,

How would you create a live video stream, would you use a facebook live api or what, like if i wanna create an article with a live video stream just like on facebook?

Notification page Error when the discuss's status is off

Hi again, I have an error when I put a comment to discussion after the discussion became disabled my notification page show an error....

my steps:

  1. add new discussion
  2. add a new comment to this discussion
  3. read the notifications (mark as read).
  4. log to the dashboard
  5. make the new discussion's Status off
  6. refresh the notification page

https://www.youtube.com/watch?v=f4W_owBKHd4

How we can remove all notifications after read them all? so they will not showing after read them.

thanks

Dashboard not work

我在部署成功后使用admin登陆进入,入到dashboard界面显示是空白的页面, 我运行的dev环境;使用的是chrome 浏览器,控制台上显示的错误信息如下:
image

访问路径404

我按照你地的文档安装部署成功搭建起来,但是只能访问到默认的主页,点击其他的路径全部是404。求解~

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.