前端APIのURL参数化対応およびバックエンドのBugFix

This commit is contained in:
2023-11-08 15:44:42 +09:00
parent 5951fcc108
commit 0f154832a5
14 changed files with 58 additions and 42 deletions

View File

@@ -2,13 +2,14 @@ import { api } from 'boot/axios';
export class Auth
{
async login(user:string,pwd:string):Promise<boolean>
{
const params = new URLSearchParams();
params.append('username', user);
params.append('password', pwd);
try{
const result = await api.post(`http://127.0.0.1:8000/api/token`,params);
const result = await api.post(`api/token`,params);
console.info(result);
localStorage.setItem('Token', result.data.access_token);
return true;