小编Ser*_*ayi的帖子

Lumen Jwt 身份验证获取(参数 2 传递给 Tymon\JWTAuth\JWTGuard)错误

我正在创建一个带有 lumen truing 的 API 以使用 JWT 身份验证,我执行了 JWT 文档中的所有步骤,如下所示,但当我测试它时,出现错误:

用户模型

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Tymon\JWTAuth\Contracts\JWTSubject;

class User extends Model implements JWTSubject 
{
    protected $fillable = [
        'username',
        'password',
        'email',
        'fullname',
        'natId',
        'role',
    ];

    public function Predector()
    {
        return $this->hasMany('App\Models\Predect');
    }

    /**
     * Get the identifier that will be stored in the subject claim of the JWT.
     *
     * @return mixed
     */
    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    /**
     * Return a key value array, containing any custom …
Run Code Online (Sandbox Code Playgroud)

php jwt laravel lumen

5
推荐指数
1
解决办法
4491
查看次数

Flutter:使不同 Icon 大小的 IconButton 和 Row 中的 Text 元素居中对齐

Row在 Flutter 应用程序中有这个小部件,带有一些IconButtons

Row(
  mainAxisAlignment: MainAxisAlignment.spaceBetween,
  children: [
    IconButton(
      icon: Icon(Icons.skip_previous,
        color: Colors.amber, size: 35),
      onPressed: () {
        setState(() {
          pageIndex = 1;
        });
      }),
    IconButton(
      icon: Icon(Icons.arrow_left,
        color: Colors.amber, size: 45),
      onPressed: decIndex),
    Text('Page $pageIndex',
      textAlign: TextAlign.center,
      style: TextStyle(
        color: Colors.amber,
        fontSize: 20,
        fontWeight: FontWeight.bold)),
    IconButton(
      icon: Icon(Icons.arrow_right,
        color: Colors.amber, size: 45),
      onPressed: () {
        incIndex(pageNumbers);
      }),
    IconButton(
      icon: Icon(Icons.skip_next,
        color: Colors.amber, size: 35),
      onPressed: () {
        setState(() {
          pageIndex = pageNumbers;
        });
      }),
    IconButton( …
Run Code Online (Sandbox Code Playgroud)

styles row alignment flutter iconbutton

3
推荐指数
1
解决办法
581
查看次数

Laravel:如何从本地网络访问 Laravel 应用程序

我在本地主机服务器上有 laravel 应用程序,我想通过 wamp 服务器将其共享到本地网络,我查看了此处的帖子并执行了大部分操作,例如:

将 httpd-vhosts.conf 更改为:

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    Order Deny,Allow
    Allow from all
    </Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

在防火墙系统中为 TCP 创建新规则。将 C:\Windows\System32\drivers\etc\host 更改为:

#127.0.0.1 localhost
192.168.0.105 attendance
Run Code Online (Sandbox Code Playgroud)

将监听 192.168.0.105:80 添加到 httpd.conf

并且没有解决

networking share localhost laravel

2
推荐指数
1
解决办法
5831
查看次数

Flutter:在 null 上调用了方法“add”

我有一个应用程序尝试使用提供程序将产品添加到卡中,首先我有这个产品型号:

class Products {
  final String item;
  final int price;    
  Products({this.item, this.price});
}
Run Code Online (Sandbox Code Playgroud)

然后我有这个小部件来查看产品列表,它显示成功:

import './service/provider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';    
import 'models/products.dart';    
class ProductList extends StatelessWidget {
  @override
  List<Products> myProducList;
  Widget build(BuildContext context) {
    myProducList = [
      Products(item: 'Car', price: 20000),
      Products(item: 'PC', price: 500),
      Products(item: 'LapTop', price: 750),
      Products(item: 'House', price: 25000),
    ];
    return Scaffold(
      body: ListView.builder(
          shrinkWrap: true,
          itemCount: myProducList.length,
          itemBuilder: (context, index) {
            return Card(
              child: ListTile(
                title: Text(myProducList[index].item),
                subtitle: Text(myProducList[index].price.toString()),
                trailing: IconButton(
                  icon: Icon(Icons.add),
                  onPressed: () …
Run Code Online (Sandbox Code Playgroud)

provider model list flutter

1
推荐指数
1
解决办法
5306
查看次数

Vue Js:未找到此依赖项:* core-js/fn/promise

我有一个使用 promise 的 Vuejs 应用程序,但收到此错误: This dependency was not found: core-js/fn/promise in ./src/store/index.js To install it, you can run: npm install --save core-js/fn/promise 我的 package.json:

"dependencies": {
    "axios": "^0.21.1",
    "bootstrap": "^4.5.3",
    "core-js": "^3.6.5",
    "jquery": "^3.5.1",
    "popper.js": "^1.16.1",
    "vue": "^2.6.11",
    "vue-axios": "^3.2.2",
    "vue-router": "^3.2.0",
    "vuex": "^3.4.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/eslint-config-standard": "^5.1.2",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.0",
    "eslint-plugin-vue": "^6.2.2",
    "vue-template-compiler": "^2.6.11"
  },
Run Code Online (Sandbox Code Playgroud)

我运行命令 npm install …

promise vue.js

1
推荐指数
1
解决办法
1526
查看次数

标签 统计

flutter ×2

laravel ×2

alignment ×1

iconbutton ×1

jwt ×1

list ×1

localhost ×1

lumen ×1

model ×1

networking ×1

php ×1

promise ×1

provider ×1

row ×1

share ×1

styles ×1

vue.js ×1