25 lines
875 B
TypeScript
25 lines
875 B
TypeScript
|
import {defineStore} from 'pinia'
|
||
|
// import axios from "axios";
|
||
|
|
||
|
export const useConfigStore = defineStore('app', {
|
||
|
state: () => ({
|
||
|
appName: "资料库",
|
||
|
description: "Leaf Library",
|
||
|
accountServer: "https://httpbin.awa.im",
|
||
|
}),
|
||
|
actions: {
|
||
|
getAppName(): string {
|
||
|
return this.appName !== null ? this.appName : "Leaf Library"
|
||
|
},
|
||
|
getRefreshUrl(): string {
|
||
|
return this.accountServer + "/public/auth_request/refresh"
|
||
|
},
|
||
|
getLoginUrl(): string {
|
||
|
let url = new URL(this.accountServer + "/public/auth_request")
|
||
|
url.searchParams.append("description", this.description)
|
||
|
// url.searchParams.append("callback_uri", window.location.href)
|
||
|
url.searchParams.append("attributes[app]", "todo")
|
||
|
return url.toString()
|
||
|
}
|
||
|
},
|
||
|
})
|