前端APIのURL参数化対応およびバックエンドのBugFix
This commit is contained in:
@@ -28,7 +28,7 @@ export const useAuthStore = defineStore({
|
||||
params.append('username', username);
|
||||
params.append('password', password);
|
||||
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);
|
||||
this.token =result.data.access_token;
|
||||
localStorage.setItem('token', result.data.access_token);
|
||||
@@ -44,7 +44,7 @@ export const useAuthStore = defineStore({
|
||||
}
|
||||
},
|
||||
async getCurrentDomain():Promise<IDomainInfo>{
|
||||
const activedomain = await api.get(`http://127.0.0.1:8000/api/activedomain`);
|
||||
const activedomain = await api.get(`api/activedomain`);
|
||||
return {
|
||||
id:activedomain.data.id,
|
||||
domainName:activedomain.data.name,
|
||||
@@ -52,7 +52,7 @@ export const useAuthStore = defineStore({
|
||||
}
|
||||
},
|
||||
async getUserDomains():Promise<IDomainInfo[]>{
|
||||
const resp = await api.get(`http://127.0.0.1:8000/api/domain`);
|
||||
const resp = await api.get(`api/domain`);
|
||||
const domains =resp.data as any[];
|
||||
return domains.map(data=>{
|
||||
return {
|
||||
@@ -72,7 +72,7 @@ export const useAuthStore = defineStore({
|
||||
if(domain.id===this.currentDomain.id){
|
||||
return;
|
||||
}
|
||||
await api.put(`http://127.0.0.1:8000/api/activedomain/${domain.id}`);
|
||||
await api.put(`api/activedomain/${domain.id}`);
|
||||
this.currentDomain=domain;
|
||||
localStorage.setItem('currentDomain',JSON.stringify(this.currentDomain));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user