diff --git a/comps/form/field/FieldInput.tsx b/comps/form/field/FieldInput.tsx
index ff851e5..e27236d 100755
--- a/comps/form/field/FieldInput.tsx
+++ b/comps/form/field/FieldInput.tsx
@@ -99,8 +99,6 @@ export const FieldInput: FC<{
);
}
- // console.log(prefix, suffix);
-
return (
{
- // console.log({ value });
fm.data[field.name] = value?.startDate
? new Date(value?.startDate)
: null;
diff --git a/comps/form/field/type/TypeUploadSingle.tsx b/comps/form/field/type/TypeUploadSingle.tsx
index 1035813..14eec2c 100755
--- a/comps/form/field/type/TypeUploadSingle.tsx
+++ b/comps/form/field/type/TypeUploadSingle.tsx
@@ -162,7 +162,6 @@ export const FieldUploadSingle: FC<{
{
if (input.ref) {
- console.log(input.ref);
input.ref.click();
}
}}
diff --git a/preset/login/Login.tsx b/preset/login/Login.tsx
index ace5ab2..b5be847 100755
--- a/preset/login/Login.tsx
+++ b/preset/login/Login.tsx
@@ -19,7 +19,6 @@ export const Login: FC = (props) => {
loadSession();
if (w.user) {
const home = props.url_home[w.user.role];
- console.log(home);
if (home) {
location.href = getBasename() + home;
return;
diff --git a/session/client-session.ts b/session/client-session.ts
index ed05fae..5286780 100755
--- a/session/client-session.ts
+++ b/session/client-session.ts
@@ -73,8 +73,7 @@ Login is prevented, please logout first before re-login!`
if (this.current) {
resolve(this.current);
} else {
- if (auth) {
- } else {
+ if (!auth) {
reject("Current session not found");
}
}
diff --git a/session/store/schema.ts b/session/store/schema.ts
new file mode 100755
index 0000000..352062b
--- /dev/null
+++ b/session/store/schema.ts
@@ -0,0 +1,49 @@
+import { createId } from "@paralleldrive/cuid2";
+import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
+
+export const session = sqliteTable(
+ "session",
+ {
+ sid: text("sid")
+ .notNull()
+ .primaryKey()
+ .$defaultFn(() => createId()),
+ uid: text("uid").notNull(),
+ created_at: integer("created_at", { mode: "timestamp_ms" }).default(
+ new Date()
+ ),
+ active: integer("active", { mode: "boolean" }),
+ data: text("data", { mode: "json" }).notNull(),
+ wsid: text("wsid", { mode: "json" }).default([]),
+ expired_at: integer("expired_at", { mode: "timestamp_ms" }),
+ },
+ (table) => {
+ return {
+ expired_at_idx: index("expired_at_idx").on(table.expired_at),
+ };
+ }
+);
+
+export const track = sqliteTable(
+ "track",
+ {
+ id: text("id")
+ .notNull()
+ .primaryKey()
+ .$defaultFn(() => createId()),
+ created_at: integer("created_at", { mode: "timestamp_ms" }).default(
+ new Date()
+ ),
+ session_id: text("session_id"),
+ url: text("url").notNull(),
+ referer: text("referer"),
+ user_ip: text("user_ip"),
+ data: text("data", { mode: "json" }),
+ tstamp: integer("tstamp", { mode: "timestamp_ms" }).default(new Date()),
+ },
+ (table) => {
+ return {
+ session_id: index("session_id").on(table.session_id),
+ };
+ }
+);