改进
This commit is contained in:
parent
cebd91ca0e
commit
f45ceb1370
@ -75,10 +75,10 @@ public function update(Request $request): RedirectResponse
|
|||||||
public function newToken(Request $request): RedirectResponse
|
public function newToken(Request $request): RedirectResponse
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'token_name' => 'required|string|max:255',
|
'token' => 'required|string|max:255',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$token = $request->user()->createToken($request->input('token_name'));
|
$token = $request->user()->createToken($request->input('token'));
|
||||||
|
|
||||||
return back()->with('token', $token->plainTextToken);
|
return back()->with('token', $token->plainTextToken);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class="text-decoration-underline">服务条款</a></p>
|
|||||||
<label>用户名</label>
|
<label>用户名</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary">
|
<button type="submit" class="btn btn-primary visually-hidden">
|
||||||
更新
|
更新
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@ -56,12 +56,15 @@ class="text-decoration-underline">服务条款</a></p>
|
|||||||
|
|
||||||
<form action="{{ route('token.new') }}" name="newToken" method="POST">
|
<form action="{{ route('token.new') }}" name="newToken" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="input-group mb-3">
|
<div class="form-floating mb-2">
|
||||||
<input type="text" class="form-control" id="token_name" name="token_name" placeholder="这个 Token 要用来做什么"
|
<input type="text" class="form-control" placeholder="Token 名称"
|
||||||
aria-label="Example text with button addon"
|
aria-label="密钥名称" name="name" required maxlength="25">
|
||||||
aria-describedby="button-addon1">
|
<label>Token 名称</label>
|
||||||
<button class="btn btn-outline-primary" type="submit" id="button-addon1">生成</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary visually-hidden">
|
||||||
|
创建
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h3 class="mt-3">撤销密钥</h3>
|
<h3 class="mt-3">撤销密钥</h3>
|
||||||
|
Loading…
Reference in New Issue
Block a user