saloou

3886 经验值

老师帮我看看 我遇到的这个问题,是怎么回事?
执行到这里:

  $response = $this->http->post('http://yshwx.dev/oauth/token', [
            'form_params' => $data
        ]);

就会报错:

 POST http://yshwx.dev/api/login 500 (Internal Server Error)
{message: "Client error: `POST http://yshwx.dev/post/oauth/to…a http-equiv="X-UA-Compatible" co (truncated...)↵", exception: "GuzzleHttp\Exception\ClientException", file: "/Users/saloou/sites/yshwx/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php", line: 113, trace: Array(56)}
exception:"GuzzleHttp\Exception\ClientException"
file:"/Users/saloou/sites/yshwx/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php"
line:113
message:"Client error: `POST http://yshwx.dev/post/oauth/token` resulted in a `419 unknown status` response:↵<!DOCTYPE html>↵<html lang="en">↵    <head>↵        <meta charset="utf-8">↵        <meta http-equiv="X-UA-Compatible" co (truncated...)↵"

<template>

<div>
    <my-upload field="img"
               @crop-success="cropSuccess"
               @crop-upload-success="cropUploadSuccess"
               @crop-upload-fail="cropUploadFail"
               v-model="show"
               :width="300"
               :height="300"
               url="/upload"
               :params="params"
               :headers="headers"
               img-format="png"></my-upload>
    <img :src="imgDataUrl">
    <a class="btn" @click="toggleShow">修改头像</a>
</div>

</template>

<script>

import 'babel-polyfill';
import myUpload from 'vue-image-crop-upload/upload-2.vue';

    export default {
        props:['avatar'],
        data(){
           return{
               show:false,
               params: {
                   token: '123456798',
                   name: 'avatar'
               },
               headers: {
                   smail: '*_~'
               },
               imgDataUrl: this.avatar
           }
        },
        components: {
            'my-upload': myUpload
        },
        methods: {
            toggleShow() {
                this.show = !this.show;
            },
            cropSuccess(imgDataUrl, field){
                console.log('-------- crop success --------');
                this.imgDataUrl = imgDataUrl;
            },
            cropUploadSuccess(jsonData, field){
                console.log('-------- upload success --------');
                console.log(jsonData);
                console.log('field: ' + field);
            },
            cropUploadFail(status, field){
                console.log('-------- upload fail --------');
                console.log(status);
                console.log('field: ' + field);
            }
        }
    }

</script>

const elixir = require('laravel-elixir');

require('laravel-elixir-vue');

elixir(mix => {

mix.sass('app.scss')
   .webpack('app.js');
mix.version(['js/app.js','css/app.css'])

});

require('./bootstrap');
Vue.component('example', require('./components/Example.vue'));
Vue.component('question-follow-button', require('./components/QuestionFollowButton.vue'));
Vue.component('user-follow-button', require('./components/UserFollowButton.vue'));
Vue.component('user-vote-button', require('./components/UserVoteButton.vue'));
Vue.component('send-message', require('./components/SendMessage.vue'));
Vue.component('comments', require('./components/Comments.vue'));
Vue.component('user-avatar', require('./components/Avatar.vue'));
const app = new Vue({

el: '#app'

});

嗯嗯,按照你说的 确认过了,还是不行啊,我真迷糊啊!老师你 远程协助我一下吧,帮我看看吧

老师我想问问:
data() {

       return{
           show:false,

我都已经改成 false 了,也gulp了,为什么刷新后 默认还是显示 上传窗口啊!!!

老师 帮帮忙啊 我研究一天了还是没弄明白啊!这里到底应该怎样 写啊
this.newComment.body=response.data.body
this.comments.push(this.newComment)
this.body = ''
this.count++