checkpoint
This commit is contained in:
parent
32b55cf9e4
commit
6ba6245eb1
|
|
@ -99,8 +99,6 @@ export const FieldInput: FC<{
|
|||
);
|
||||
}
|
||||
|
||||
// console.log(prefix, suffix);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cx(
|
||||
|
|
|
|||
|
|
@ -217,7 +217,6 @@ export const FieldTypeInput: FC<{
|
|||
asSingle={true}
|
||||
useRange={false}
|
||||
onChange={(value) => {
|
||||
// console.log({ value });
|
||||
fm.data[field.name] = value?.startDate
|
||||
? new Date(value?.startDate)
|
||||
: null;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,6 @@ export const FieldUploadSingle: FC<{
|
|||
<div
|
||||
onClick={() => {
|
||||
if (input.ref) {
|
||||
console.log(input.ref);
|
||||
input.ref.click();
|
||||
}
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ export const Login: FC<LGProps> = (props) => {
|
|||
loadSession();
|
||||
if (w.user) {
|
||||
const home = props.url_home[w.user.role];
|
||||
console.log(home);
|
||||
if (home) {
|
||||
location.href = getBasename() + home;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
};
|
||||
}
|
||||
);
|
||||
Loading…
Reference in New Issue