小编mjp*_*r11的帖子

如何使用python win32gui启用制表符和箭头键

我在主窗口中创建了几个按钮(窗口),但是Tab键和箭头键不起作用.我的研究表明,对于C++,在消息泵中使用IsDialogMessage创建了TranslateMessage/DispatchMessage的旁路,如下所示,以允许此功能:

while(GetMessage(&Msg, NULL, 0, 0))
{
    if(!IsDialogMessage(g_hToolbar, &Msg))
    {
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }
}
Run Code Online (Sandbox Code Playgroud)

但是,我正在使用python和win32gui模块来创建CreateWindows,我无法弄清楚如何绕过正常的消息捕获以允许自然处理键盘.我的代码与此类似:

from win32gui import *
from win32con import *

window_class = WNDCLASS()
hinst = window_class.hInstance = GetModuleHandle(None)
window_class.lpszClassName = 'ClassName'
window_class.style = CS_VREDRAW | CS_HREDRAW
window_class.hCursor = LoadCursor(0, IDC_ARROW)
window_class.hbrBackground = COLOR_WINDOW
window_class.lpfnWndProc = {}
classAtom = RegisterClass(window_class)

hwnd = CreateWindow(classAtom, "", WS_VISIBLE | WS_OVERLAPPED | WS_CAPTION
                    | WS_SYSMENU | WS_MINIMIZEBOX | WS_EX_TOPMOST | WS_CLIPSIBLINGS,
                    0, 0, 140, 100, 0,  0, GetModuleHandle(None), None)
btn1_hwnd = CreateWindow("Button", "btn …
Run Code Online (Sandbox Code Playgroud)

python pywin32 win32gui

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

无法使用 Vuetify 和 Laravel 读取未定义的属性“t”

尝试使用开箱即用的 Vuetify 组件时出现此错误。也许只是我缺乏了解如何在 Laravel 中实现 Vuetify 组件。

Laravel v5.8.35、Vue v2.6.10、Vuetify v2.0.18。

错误:

[Vue 警告]:渲染错误:“TypeError:无法读取未定义的属性‘t’”

在发现

---> <VSelect> <Test> 在resources/js/components/Test.vue <Root>

应用程序.js

require('./bootstrap');
window.Vue = require('vue');

Vue.component('example-component', require('./components/ExampleComponent.vue').default);

import Vuetify from 'vuetify';
Vue.use(Vuetify);
Vue.component('test', require('./components/Test.vue').default);

const app = new Vue({
    el: '#app',
});
Run Code Online (Sandbox Code Playgroud)

布局/vue.blade.php

<!DOCTYPE html>
<html>
<head>
<title>Vue Examples</title>
<meta name="csrf-token" content="{{ csrf_token() }}">
</head>
<body>
    <div id="app">
        @yield("content")
    </div>
    <script src="{{ asset('/js/app.js') }}"></script>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

测试刀片.php

@extends('layouts.vue')

@section('content')
    <test></test>
@endsection
Run Code Online (Sandbox Code Playgroud)

组件/Test.vue

<template>
  <v-container fluid>
    <v-row align="center">
      <v-col class="d-flex" cols="12" …
Run Code Online (Sandbox Code Playgroud)

laravel vue.js vuetify.js

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

Laravel 和 Passport 获取 SQLSTATE[42S22]:未找到列:1054 未知列 'api_token'

我看过很多关于这个错误的帖子,但没有一个解决方案对我有用。

我正在使用 Passport 运行 Laravel,它在我的开发服务器上运行良好。正如预期的那样,当尝试检查用户是否在我的开发服务器上通过身份验证时,它返回捕获(在 axios 调用中):

开发服务器

"message":"Unauthenticated."
Run Code Online (Sandbox Code Playgroud)

但是,在我的生产服务器上运行相同的代码时,它返回捕获:

生产服务器:

"message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'api_token'
in 'where clause' (SQL: select * from `users` where `api_token` = ...
Run Code Online (Sandbox Code Playgroud)

我已经运行了 Passport 迁移,并且在 config/auth.php 中将 ['guards']['api']['driver'] 设置为 Passport,并更新了显然为其他人解决了问题的配置缓存。

看起来身份验证需要使用护照迁移中的 oauth 表,但查询似乎正在查看用户表。

编辑

我能够确定我的开发服务器使用RequestGuard该类来查找用户,而我的生产服务器使用TokenGuard该类来查找用户。

authentication laravel passport.js axios

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

为什么我的 Laravel 失败作业没有显示在 failed_jobs 表中?

我按照文档创建了一个作业,并在我的handle()中强制失败:

throw new \Exception("Error Processing the job", 1);
Run Code Online (Sandbox Code Playgroud)

结果是预期的失败作业,但失败的作业没有显示在 failed_job 表中。处理时,它会显示在作业表中。

[2020-12-15 07:37:18][6] Processing: App\Jobs\IntroEmailJob
[2020-12-15 07:37:18][6] Failed:     App\Jobs\IntroEmailJob
Run Code Online (Sandbox Code Playgroud)

拉拉维尔 8.0

编辑:在日志中找到这个:

General error: 1364 Field 'uuid' doesn't have a default value
Run Code Online (Sandbox Code Playgroud)

我按照文档的解释创建了 failed_jobs 表:

php artisan queue:failed-table

php artisan migrate
Run Code Online (Sandbox Code Playgroud)

laravel

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