我的laravel 5.8项目有一个问题。
我想使用Guzzle的护照进行注册并获得通行证,但是当我发布新记录以获取通行证时,我却说错了
import mysql.connector
import csv
import os
import time
from datetime import datetime
#Make a connection with the workbench
mydb = mysql.connector.connect(
host= 'localhost',
user = 'root',
passwd = '*****',
database= 'db_one'
)
cursor = mydb.cursor()
select_post = "SELECT * FROM `table0`"
cursor.execute(select_post)
source = r'c:\data\JS\Desktop\Source'
names_mysql= [i[0] for i in cursor.fetchall()]
names_folder= os.listdir(source)
def table01():
#look for corresponding names in the names_folder.
for x in names_folder:
if x in names_mysql:
subdir_path = os.path.join(source, x)
for file in os.listdir(subdir_path):
a = os.path.join(subdir_path, file)
#Get creation time of the files.
mode_time = os.path.getctime(a)
rmode_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(mode_time))
#Place all absolute paths in a list.
all_paths= [os.path.join(subdir_path, file) for file in os.listdir(subdir_path)]
if all_paths!= []:
newest_paths= max(all_paths, key=os.path.getctime)
print(newest_paths)
#Read the content of files into a list.
for file in all_paths:
if file == newest_paths and os.path.getctime(newest_paths) < time.time() - 120:
with open(file, 'rt') as f:
reader = csv.reader(f, delimiter ='\t')
line_data0 = list()
col = next(reader)
#Add 2 columns to that list.
for line in reader:
line.insert(0, x)
line.insert(1, rmode_time)
if line != []:
line_data0.append(line)
print(line_data0)
cursor = mydb.cursor()
cursor.execute('TRUNCATE TABLE table1')
query1 = ("INSERT INTO table1 "
"(`Post`,`DateTime`,`Sys`,`PP`,`AA`, `KJ`, `Status`)"
"VALUES (%s, %s, %s,%s, %s, %s, %s)")
for p in line_data0:
cursor.execute(query1, p)
mydb.commit()
mydb.close()
table01()
这是我的代码:
$ http =新客户;
"`POST http://femlife.test/oauth/token` resulted in a `401 Unauthorized` response:
{"error":"invalid_credentials","error_description":"The user credentials were incorrect.","message":"The user credential (truncated...)"
请,我做错了什么?我看到一些建议,我必须将Server和Client实例分开,因为现在,我使用一个XAMPP实例。
答案 0 :(得分:0)
似乎在这一行:
'username' => $request->name,
您可能将用户名设置为错误的值。确保您的用户名字段名称正确。