Discover: fetch discover api && set element(nodes, edges) done

This commit is contained in:
chiayin
2023-02-22 16:10:40 +08:00
parent 8228f9791c
commit 78e18663aa
11 changed files with 361 additions and 74 deletions

View File

@@ -22,7 +22,7 @@ export default defineStore('loginStore', {
* fetch Login For Access Token api
*/
async signIn() {
const api = 'api/oauth/token';
const api = '/api/oauth/token';
const config = {
headers: {
// http post 預設的 url 編碼,非 json 格式
@@ -38,7 +38,7 @@ export default defineStore('loginStore', {
const token = response.data.access_token;
document.cookie = `luciaToken=${token}`;
this.$router.push('/files')
this.$router.push('/files');
}
} catch(error) {
this.isInvalid = true;
@@ -61,7 +61,7 @@ export default defineStore('loginStore', {
* get user detail for 'my-account' api
*/
async getUserData() {
const api = 'api/my-account';
const api = '/api/my-account';
try {
const response = await axios.get(api);
@@ -74,7 +74,7 @@ export default defineStore('loginStore', {
* check login for 'my-account' api
*/
async checkLogin() {
const api = 'api/my-account';
const api = '/api/my-account';
try {
const response = await axios.get(api);