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) @client.get(prefix)
def ClientIndex(): def ClientIndex():
print(wireguardConfigurations.keys())
return render_template('client.html') return render_template('client.html')
@client.get(f'{prefix}/api/validateAuthentication') @client.get(f'{prefix}/api/validateAuthentication')

View File

@ -20,7 +20,7 @@ const signIn = async (e) => {
return; return;
} }
loading.value = true; 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; let data = res.data;
if (!data.status){ if (!data.status){
store.newNotification(data.message, "danger") store.newNotification(data.message, "danger")

View File

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

View File

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

View File

@ -1,5 +1,5 @@
export const requestURl = (url) => { 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, '/')}` : `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}`
} }

View File

@ -22,7 +22,7 @@ const signUp = async (e) => {
} }
if (validatePassword){ if (validatePassword){
loading.value = true 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 let data = res.data
if (!data.status){ if (!data.status){
store.newNotification(data.message, "danger") store.newNotification(data.message, "danger")