{{ t("settings.greet")
}}{{ user || userData.userAccount || t("settings.defaultname") }}
diff --git a/components/app/windows/tty.vue b/components/app/windows/tty.vue
index 8767b53..88fdd3a 100644
--- a/components/app/windows/tty.vue
+++ b/components/app/windows/tty.vue
@@ -26,7 +26,7 @@ const printData = (content: any, userinput?: boolean, error?: boolean) => {
const displayHelp = () => {
const helpContent =
- "Here are the commands for the Terminal \n\n execute [app]: This command opens an application in the [app] slot. \n article [id]: This command will open a LINE Today article in a window. \n about: This displays the about text window \n clear/clean: Wipe the terminal log. \n help: This help text system :D \n\n For more info, please view the documentation: https://news.yuanhau.com/docs";
+ "Here are the commands for the Terminal \n\n execute [app]: This command opens an application in the [app] slot. \n article [id]: This command will open a LINE Today article in a window. \n about: This displays the about text window \n clear/clean: Wipe the terminal log. \n help: This help text system :D";
printData(helpContent);
};
@@ -94,7 +94,7 @@ const cleanTTY = () => {
const openArticle = (inputContent: string) => {
const match = inputContent.match(/^article\s+[a-zA-Z0-9]{7}$/);
if (match) {
- const articleId = match[1].trim();
+ const articleId = match[0].trim();
emit("openArticles", articleId);
printData(`Opening article ${articleId}...`);
} else {
diff --git a/components/blurPageBeforeLogin.vue b/components/blurPageBeforeLogin.vue
index ceaa20d..eee4f8c 100644
--- a/components/blurPageBeforeLogin.vue
+++ b/components/blurPageBeforeLogin.vue
@@ -7,6 +7,16 @@ const error = ref(false);
const errorMsg = ref("");
const emit = defineEmits(["windowopener", "error", "loadValue"]);
+/**
+ * return {
+ userAccount: fetchViaSQL[0].username,
+ firstName: fetchViaSQL[0].firstName,
+ requested_action: "CONTINUE",
+ current_spot: "KEEP_LOGIN",
+ email: fetchViaSQL[0].email,
+ avatarURL: fetchViaSQL[0].avatarurl,
+ };
+ */
try {
// 喔 我沒有加 await :( 難怪有問題
const { data, error: sendError } = await useFetch(
@@ -18,10 +28,12 @@ try {
if (data.requested_action === "LOGOUT_USER") {
logoutUser();
}
- if (false) {
- allowed.value = true;
- } else {
- allowed.value = false;
+ if (data.requested_action === "CONTINUE") {
+ if (data.userAccount && data.userAccount.length !== 0) {
+ allowed.value = true;
+ } else {
+ allowed.value = false;
+ }
}
} catch (e) {
error.value = true;
@@ -35,7 +47,6 @@ try {
>
{{ t("error") }}
-
{{ errorMsg ? errorMsg : "" }} {{ t("systemerror") }}
diff --git a/pages/desktop.vue b/pages/desktop.vue
index b4a3839..dcc127d 100644
--- a/pages/desktop.vue
+++ b/pages/desktop.vue
@@ -60,6 +60,7 @@ import NewsViewWindow from "~/components/app/windows/newsView.vue";
import SettingsWindow from "~/components/app/windows/settings.vue";
import PrivacyPolicyWindow from "~/components/app/windows/privacypolicy.vue";
import TOSWindow from "~/components/app/windows/tos.vue";
+import onBoardingWindow from "~/components/app/windows/onBoarding.vue";
// Import Icons
import {
@@ -203,6 +204,13 @@ const associAppWindow = [
component: TOSWindow,
translatable: false,
},
+ {
+ name: "onboard",
+ id: "14",
+ title: "OnBoarding",
+ component: onBoardingWindow,
+ translatable: false,
+ },
];
// OnBoarding
diff --git a/server/api/user/submitGroqKey.ts b/server/api/user/submitGroqKey.ts
index c46f2c6..8bd0ef5 100644
--- a/server/api/user/submitGroqKey.ts
+++ b/server/api/user/submitGroqKey.ts
@@ -2,7 +2,7 @@ import sql from "~/server/components/postgres";
import getUserTokenMinusSQLInjection from "~/server/components/getUserToken";
export default defineEventHandler(async (event) => {
// Check user data.
- const user = getUserTokenMinusSQLInjection(event);
+ const user = await getUserTokenMinusSQLInjection(event);
if (user.error.length !== 0) {
return {
error: user.error,