This commit is contained in:
Donald Zou 2025-06-03 03:11:26 +08:00
parent 832513a7fc
commit 519ccda5ed
6 changed files with 6 additions and 7 deletions

View File

@ -79,7 +79,6 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration],
@client.get(prefix)
def ClientIndex():
print(wireguardConfigurations.keys())
return render_template('client.html')
@client.get(f'{prefix}/api/validateAuthentication')

View File

@ -20,7 +20,7 @@ const signIn = async (e) => {
return;
}
loading.value = true;
await axios.post(requestURl("/client/api/signin"), formData).then(res => {
await axios.post(requestURl("/api/signin"), formData).then(res => {
let data = res.data;
if (!data.status){
store.newNotification(data.message, "danger")

View File

@ -25,7 +25,7 @@ const formFilled = computed(() => {
const store = clientStore()
const router = useRouter()
await axios.get(requestURl('/client/api/signin/totp'), {
await axios.get(requestURl('/api/signin/totp'), {
params: {
Token: props.totpToken
}
@ -53,7 +53,7 @@ const verify = async (e) => {
e.preventDefault()
if (formFilled){
loading.value = true
await axios.post(requestURl('/client/api/signin/totp'), {
await axios.post(requestURl('/api/signin/totp'), {
Token: props.totpToken,
UserProvidedTOTP: formData.TOTP
}).then(res => {

View File

@ -32,7 +32,7 @@ const router = createRouter({
router.beforeEach(async (to, from, next) => {
if (to.meta.auth){
await axios.get(requestURl('/client/api/validateAuthentication')).then(res => {
await axios.get(requestURl('/api/validateAuthentication')).then(res => {
next()
}).catch(() => {
const store = clientStore()

View File

@ -1,5 +1,5 @@
export const requestURl = (url) => {
return import.meta.env.MODE === 'development' ? url
return import.meta.env.MODE === 'development' ? '/client' + url
: `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`
}

View File

@ -22,7 +22,7 @@ const signUp = async (e) => {
}
if (validatePassword){
loading.value = true
await axios.post(requestURl('/client/api/signup'), formData).then((res) => {
await axios.post(requestURl('/api/signup'), formData).then((res) => {
let data = res.data
if (!data.status){
store.newNotification(data.message, "danger")