课程代码
This commit is contained in:
253
datastructure/2025301205+施光甲+实验一.cpp
Normal file
253
datastructure/2025301205+施光甲+实验一.cpp
Normal file
@@ -0,0 +1,253 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct LNode
|
||||
{
|
||||
int data; //数据域
|
||||
struct LNode *next; //指针域
|
||||
}LNode,*LinkList; // LinkList为指向LNode类型的指针类型
|
||||
|
||||
// 初始化四个链表L、M、N、H
|
||||
void chushihua(LinkList &L, LinkList &M, LinkList &N, LinkList &H)
|
||||
{
|
||||
//todo list 1: 为四个链表分配头节点并初始化
|
||||
L = (LinkList)malloc(sizeof(LNode));
|
||||
L->next = NULL;
|
||||
M = (LinkList)malloc(sizeof(LNode));
|
||||
M->next = NULL;
|
||||
N = (LinkList)malloc(sizeof(LNode));
|
||||
N->next = NULL;
|
||||
H = (LinkList)malloc(sizeof(LNode));
|
||||
H->next = NULL;
|
||||
printf("链表初始化成功!\n");
|
||||
}
|
||||
|
||||
// 判断链表L是否为空表
|
||||
void Emp(LinkList &L)
|
||||
{
|
||||
if (L->next == NULL) //todo list 2: 判断头节点的next是否为空
|
||||
printf("链表为空表。\n");
|
||||
else
|
||||
printf("链表为非空表。\n");
|
||||
}
|
||||
|
||||
// 求表长,返回L中数据元素个数
|
||||
void Length(LinkList L){
|
||||
LNode *p; //申请临时变量p
|
||||
p = L->next; //p指向第一个结点(首元结点)
|
||||
int length = 0;
|
||||
//todo list 3: 遍历单链表,统计结点数
|
||||
while (p != NULL) {
|
||||
length++;
|
||||
p = p->next;
|
||||
}
|
||||
printf("链表长度为:%d\n", length);
|
||||
}
|
||||
|
||||
// 1、建立递增有序链表:向链表L中插入n个整数,插入时保持链表的有序性(从小到大)。
|
||||
void charu_1(LinkList &L, int n)
|
||||
{
|
||||
LNode *q,*p;
|
||||
int i; // 循环变量声明
|
||||
for (i = 1; i <= n; i++)
|
||||
{
|
||||
p = L; //在每次循环开始时,将p指向链表的头节点L
|
||||
q = (LinkList)malloc(sizeof(LNode)); //为新的节点分配内存,并将q指向这块内存
|
||||
printf("请输入第%d个整数的值:", i);
|
||||
scanf("%d", &q->data); //将输入的值存储在q指向的节点的data字段中
|
||||
q->next = NULL; //将新节点的next指针设置为NULL,表示新节点当前不指向任何节点。
|
||||
|
||||
if (p->next == NULL) //如果p的下一个节点是NULL(即链表为空或p指向链表的最后一个节点)
|
||||
//todo list 4: 直接插入新节点
|
||||
L->next = q;
|
||||
else //如果链表不为空或p不是指向链表的最后一个节点,则进入这个else块(查找新节点的插入位置)
|
||||
{
|
||||
while (p->next != NULL && p->next->data < q->data)
|
||||
{
|
||||
//todo list 5: p指针不断往后移动
|
||||
p = p->next;
|
||||
if (p->next == NULL)
|
||||
break;
|
||||
}
|
||||
//todo list 6: 插入*q结点
|
||||
q->next = p->next;
|
||||
p->next = q;
|
||||
}
|
||||
}
|
||||
printf("数据插入完成!\n");
|
||||
}
|
||||
|
||||
// 显示链表L的所有元素
|
||||
void xianshi(LinkList &L)
|
||||
{
|
||||
LNode *p; //申请临时变量p //LinkList p;
|
||||
p = L;
|
||||
while (p->next != NULL)
|
||||
{
|
||||
printf("%4d", p->next->data);
|
||||
p = p->next;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
// 2、分解:将链表L中的元素分为奇数和偶数两个链表M和N,并分别显示它们。
|
||||
void fenbiao(LinkList &L, LinkList &M, LinkList &N)
|
||||
{
|
||||
LNode *j,*o,*p;
|
||||
p = L->next; //todo list 7: p指针指向第一个数据节点
|
||||
|
||||
// 初始化M和N链表
|
||||
M->next = NULL;
|
||||
N->next = NULL;
|
||||
|
||||
LNode *m_tail = M; // M链表的尾指针
|
||||
LNode *n_tail = N; // N链表的尾指针
|
||||
|
||||
while (p != NULL)
|
||||
{
|
||||
if (p->data % 2 == 0) //找出偶数元素,用尾插法将这些偶数元素建立成一个【偶数链表】
|
||||
{
|
||||
o = (LinkList)malloc(sizeof(LNode));
|
||||
//todo list 8: 使用尾插法插入偶数节点
|
||||
o->data = p->data;
|
||||
o->next = NULL;
|
||||
n_tail->next = o;
|
||||
n_tail = o;
|
||||
}
|
||||
else //找出奇数元素,用尾插法将这些奇数元素建立成一个【奇数链表】
|
||||
{
|
||||
j = (LinkList)malloc(sizeof(LNode));
|
||||
//todo list 9: 使用尾插法插入奇数节点
|
||||
j->data = p->data;
|
||||
j->next = NULL;
|
||||
m_tail->next = j;
|
||||
m_tail = j;
|
||||
}
|
||||
//todo list 10: p指针往后移动
|
||||
p = p->next;
|
||||
}
|
||||
printf("奇数链表为:");
|
||||
xianshi(M);
|
||||
printf("偶数链表为:");
|
||||
xianshi(N);
|
||||
}
|
||||
|
||||
// 3、合并一个递减链表:将奇数链表J和偶数链表O合并为一个新的链表H,合并时保持元素的有序性。
|
||||
void hebiao(LinkList &J, LinkList &O, LinkList &H)
|
||||
{
|
||||
// 先将两个链表转换为数组,然后排序,最后用头插法创建递减链表
|
||||
int data[100]; // 假设最多100个元素
|
||||
int count = 0;
|
||||
LNode *p;
|
||||
int i, j; // 循环变量声明
|
||||
LNode *t;
|
||||
|
||||
// 收集奇数链表的数据
|
||||
p = J->next;
|
||||
while (p != NULL) {
|
||||
data[count++] = p->data;
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
// 收集偶数链表的数据
|
||||
p = O->next;
|
||||
while (p != NULL) {
|
||||
data[count++] = p->data;
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
// 对数据进行升序排序(从小到大)- 这样头插后会变成降序
|
||||
for (i = 0; i < count - 1; i++) {
|
||||
for (j = i + 1; j < count; j++) {
|
||||
if (data[i] > data[j]) { // 如果前一个元素大于后一个元素,交换它们
|
||||
int temp = data[i];
|
||||
data[i] = data[j];
|
||||
data[j] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 使用头插法创建递减链表
|
||||
H->next = NULL;
|
||||
for (i = 0; i < count; i++) {
|
||||
t = (LinkList)malloc(sizeof(LNode));
|
||||
t->data = data[i];
|
||||
t->next = H->next;
|
||||
H->next = t;
|
||||
}
|
||||
|
||||
printf("合并后的递减链表为:");
|
||||
xianshi(H); //显示合表H
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
//生成新结点作为头结点,用头指针分别指向各头结点
|
||||
LinkList head = (LinkList)malloc(sizeof(LNode));
|
||||
LinkList ji = (LinkList)malloc(sizeof(LNode));
|
||||
LinkList ou = (LinkList)malloc(sizeof(LNode));
|
||||
LinkList he = (LinkList)malloc(sizeof(LNode));
|
||||
|
||||
// 初始化链表
|
||||
head->next = NULL;
|
||||
ji->next = NULL;
|
||||
ou->next = NULL;
|
||||
he->next = NULL;
|
||||
|
||||
int choose = -1, n;
|
||||
printf("*********************************************\n");
|
||||
printf("********** 实验一 *******\n");
|
||||
printf("********** 单链表操作 *******\n");
|
||||
printf("*********************************************\n");
|
||||
printf("********** 1.初始化单链表 *******\n");
|
||||
printf("********** 2.建立递增链表 *******\n");
|
||||
printf("********** 3.分成奇/偶两链表 *******\n");
|
||||
printf("********** 4.合并成递减单链表 *******\n");
|
||||
printf("********** 5.显示建立的(递增)单链表整体 *******\n");
|
||||
printf("********** 6.求单链表长度 *******\n");
|
||||
printf("********** 7.判断链表是否为空 *******\n");
|
||||
printf("********** 0.退出程序 *******\n");
|
||||
printf("*********************************************\n");
|
||||
|
||||
while (choose)
|
||||
{
|
||||
printf("请输入您的选择:");
|
||||
scanf("%d", &choose);
|
||||
switch (choose)
|
||||
{
|
||||
case 1:
|
||||
chushihua(head, ji, ou, he);
|
||||
break;
|
||||
case 2:
|
||||
printf("请输入要插入的整数个数:");
|
||||
scanf("%d", &n);
|
||||
charu_1(head, n);
|
||||
break;
|
||||
case 3:
|
||||
fenbiao(head, ji, ou);
|
||||
break;
|
||||
case 4:
|
||||
hebiao(ji, ou, he);
|
||||
break;
|
||||
case 5:
|
||||
printf("当前(递增)单链表内容为:");
|
||||
xianshi(head);
|
||||
break;
|
||||
case 6:
|
||||
Length(head);
|
||||
break;
|
||||
case 7:
|
||||
Emp(head);
|
||||
break;
|
||||
case 0:
|
||||
printf("程序已退出,感谢使用!\n");
|
||||
exit(0);
|
||||
break;
|
||||
default:
|
||||
printf("输入错误,请重新输入!\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
136
datastructure/2025301205+施光甲+实验三.cpp
Normal file
136
datastructure/2025301205+施光甲+实验三.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MAXSIZE 10
|
||||
typedef struct Queue
|
||||
{
|
||||
int *data; //存储空间的基地址
|
||||
int front, rear; //头指针、尾指针
|
||||
int count; //新增一个 count变量,用于记录队中元素个数
|
||||
}Queue;
|
||||
|
||||
//初始化队列
|
||||
void Init(Queue &Q)
|
||||
{
|
||||
Q.data = new int[MAXSIZE];
|
||||
//处理front, rear指针,以及count变量
|
||||
Q.front = 0;
|
||||
Q.rear = 0;
|
||||
Q.count = 0;
|
||||
}
|
||||
|
||||
//入队
|
||||
void EnQueue(Queue &Q, int e)
|
||||
{
|
||||
if (Q.count == MAXSIZE) //利用count判断队是否满
|
||||
printf("队满\n");
|
||||
else {
|
||||
//入队元素,尾指针+1
|
||||
Q.data[Q.rear] = e;
|
||||
Q.rear = (Q.rear + 1) % MAXSIZE; //循环队列,需要取模
|
||||
//更新count值
|
||||
Q.count++;
|
||||
printf("元素%d入队成功\n", e);
|
||||
}
|
||||
}
|
||||
|
||||
//出队
|
||||
void DelQueue(Queue &Q, int &e)
|
||||
{
|
||||
if (Q.count == 0) //利用count判断队是否空
|
||||
printf("队空\n");
|
||||
else{
|
||||
//出队元素,头指针+1
|
||||
e = Q.data[Q.front];
|
||||
Q.front = (Q.front + 1) % MAXSIZE; //循环队列,需要取模
|
||||
//更新count值
|
||||
Q.count--;
|
||||
printf("出队元素为:%d\n", e);
|
||||
}
|
||||
}
|
||||
|
||||
//判断队空
|
||||
void IsNull(Queue Q)
|
||||
{
|
||||
if (Q.count == 0) //利用count判断队是否空
|
||||
printf("队空\n");
|
||||
else
|
||||
printf("队不空\n");
|
||||
}
|
||||
|
||||
//显示整个队列
|
||||
void Display(Queue Q)
|
||||
{
|
||||
if (Q.count == 0) {
|
||||
printf("队列为空\n");
|
||||
return;
|
||||
}
|
||||
|
||||
int tempFront = Q.front; // 使用临时变量,避免修改原队列
|
||||
int tempCount = Q.count; // 使用临时计数
|
||||
|
||||
while (tempCount > 0)
|
||||
{
|
||||
printf("%3d,", Q.data[tempFront]);
|
||||
tempFront = (tempFront + 1) % MAXSIZE; // 临时指针后移
|
||||
tempCount--; // 临时计数减1
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
Queue Q;
|
||||
printf("------------------------------------\n");
|
||||
printf("1.初始化队列\n");
|
||||
printf("2.判断队列是否为空\n");
|
||||
printf("3.入队\n");
|
||||
printf("4.出队\n");
|
||||
printf("5.显示整个队列\n");
|
||||
printf("6.退出\n");
|
||||
printf("------------------------------------\n");
|
||||
int sel;
|
||||
while (1)
|
||||
{
|
||||
printf("请输入选项:");
|
||||
scanf("%d", &sel);
|
||||
switch (sel)
|
||||
{
|
||||
case 1:
|
||||
Init(Q);
|
||||
printf("队列已经初始化。\n");
|
||||
break;
|
||||
case 2:
|
||||
IsNull(Q);
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
int n, e;
|
||||
printf("请输入入队元素个数:");
|
||||
scanf("%d", &n);
|
||||
printf("请输入需要入队的%d个元素:",n);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
scanf("%d", &e);
|
||||
EnQueue(Q, e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
int e;
|
||||
DelQueue(Q, e);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
printf("队列为:");
|
||||
Display(Q);
|
||||
break;
|
||||
case 6:
|
||||
exit(0);
|
||||
default:
|
||||
printf("无效选项\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
256
datastructure/2025301205+施光甲+实验二.cpp
Normal file
256
datastructure/2025301205+施光甲+实验二.cpp
Normal file
@@ -0,0 +1,256 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct PNode
|
||||
{
|
||||
int index; //指数
|
||||
int coe; // 系数
|
||||
struct PNode *next; //指针域
|
||||
}PNode,*Polynomial;
|
||||
|
||||
// 初始化三个多项式链表
|
||||
void chushihua(Polynomial *L, Polynomial *M, Polynomial *N)
|
||||
{
|
||||
//todo list 1: 为三个链表分配头节点并初始化
|
||||
*L = (Polynomial)malloc(sizeof(PNode));
|
||||
(*L)->next = NULL;
|
||||
*M = (Polynomial)malloc(sizeof(PNode));
|
||||
(*M)->next = NULL;
|
||||
*N = (Polynomial)malloc(sizeof(PNode));
|
||||
(*N)->next = NULL;
|
||||
}
|
||||
|
||||
// 判断链表是否为空
|
||||
void Emp(Polynomial L)
|
||||
{
|
||||
if (L->next == NULL)
|
||||
printf("链表为空表。\n");
|
||||
else
|
||||
printf("链表为非空表。\n");
|
||||
}
|
||||
|
||||
// 求链表长度
|
||||
void Length(Polynomial L)
|
||||
{
|
||||
PNode *p;
|
||||
int length = 0;
|
||||
//todo list 2: 遍历链表统计节点个数
|
||||
p = L->next;
|
||||
while (p != NULL) {
|
||||
length++;
|
||||
p = p->next;
|
||||
}
|
||||
printf("链表长度为:%d\n", length);
|
||||
}
|
||||
|
||||
// 1、构造两个按指数递增的有序链表:插入节点,创建一元多项式
|
||||
// 1、构造两个按指数递增的有序链表:插入节点,创建一元多项式
|
||||
void charu_1(Polynomial L) {
|
||||
PNode *q, *p;
|
||||
int n, i;
|
||||
printf("请输入你要创建的一元多项式的项数:\n");
|
||||
scanf("%d", &n);
|
||||
for (i = 1; i <= n; i++) {
|
||||
p = L;
|
||||
q = (Polynomial)malloc(sizeof(PNode));
|
||||
printf("请输入第%d项的系数和指数:", i);
|
||||
scanf("%d%d", &q->coe, &q->index);
|
||||
q->next = NULL;
|
||||
|
||||
// 查找插入位置,保持指数递增
|
||||
while (p->next != NULL && p->next->index < q->index) {
|
||||
//todo list 3: p指针移动到合适的位置
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
// 直接插入,不合并相同指数的项
|
||||
//todo list 4: 将*q结点插入到*p结点后
|
||||
q->next = p->next;
|
||||
p->next = q;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 显示函数 - 使用H分隔系数和指数
|
||||
void xianshi(Polynomial L)
|
||||
{
|
||||
PNode *p;
|
||||
p = L->next;
|
||||
if (p == NULL) {
|
||||
printf("多项式为空");
|
||||
return;
|
||||
}
|
||||
while (p != NULL)
|
||||
{
|
||||
printf("%dH%d", p->coe, p->index); // 系数H指数
|
||||
p = p->next;
|
||||
if (p != NULL) {
|
||||
printf(" "); // 项之间的分隔
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
//2、两个一元多项式相加
|
||||
void hebiao(Polynomial J, Polynomial O, Polynomial H)
|
||||
{
|
||||
PNode *p = J->next, *q = O->next, *r = H, *s;
|
||||
|
||||
// 初始化结果链表
|
||||
H->next = NULL;
|
||||
|
||||
while (p != NULL && q != NULL) {
|
||||
if (p->index < q->index) {
|
||||
s = (Polynomial)malloc(sizeof(PNode));
|
||||
//todo list 5: 复制p节点的数据到新节点s
|
||||
s->coe = p->coe;
|
||||
s->index = p->index;
|
||||
s->next = NULL;
|
||||
//todo list 6: 将s节点插入到结果链表H的末尾
|
||||
r->next = s;
|
||||
r = s;
|
||||
p = p->next;
|
||||
} else if (p->index > q->index) {
|
||||
s = (Polynomial)malloc(sizeof(PNode));
|
||||
//todo list 7: 复制q节点的数据到新节点s
|
||||
s->coe = q->coe;
|
||||
s->index = q->index;
|
||||
s->next = NULL;
|
||||
//todo list 8: 将s节点插入到结果链表H的末尾
|
||||
r->next = s;
|
||||
r = s;
|
||||
q = q->next;
|
||||
} else {
|
||||
//todo list 9: 处理指数相等的项
|
||||
int sum = p->coe + q->coe;
|
||||
if (sum != 0) {
|
||||
s = (Polynomial)malloc(sizeof(PNode));
|
||||
s->index = p->index;
|
||||
s->coe = sum;
|
||||
s->next = NULL;
|
||||
//todo list 10: 将合并后的项插入结果链表
|
||||
r->next = s;
|
||||
r = s;
|
||||
}
|
||||
p = p->next;
|
||||
q = q->next;
|
||||
}
|
||||
}
|
||||
|
||||
//todo list 11: 处理剩余节点 - 多项式J
|
||||
while (p != NULL) {
|
||||
s = (Polynomial)malloc(sizeof(PNode));
|
||||
s->coe = p->coe;
|
||||
s->index = p->index;
|
||||
s->next = NULL;
|
||||
r->next = s;
|
||||
r = s;
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
//todo list 12: 处理剩余节点 - 多项式O
|
||||
while (q != NULL) {
|
||||
s = (Polynomial)malloc(sizeof(PNode));
|
||||
s->coe = q->coe;
|
||||
s->index = q->index;
|
||||
s->next = NULL;
|
||||
r->next = s;
|
||||
r = s;
|
||||
q = q->next;
|
||||
}
|
||||
|
||||
printf("两个多项式相加的结果为:");
|
||||
xianshi(H);
|
||||
}
|
||||
|
||||
// 清空链表函数
|
||||
void clearList(Polynomial L) {
|
||||
PNode *p = L->next;
|
||||
while (p != NULL) {
|
||||
PNode *temp = p;
|
||||
p = p->next;
|
||||
free(temp);
|
||||
}
|
||||
L->next = NULL;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
Polynomial head[3];
|
||||
int i;
|
||||
for (i = 0; i < 3; i++) {
|
||||
head[i] = (Polynomial)malloc(sizeof(PNode));
|
||||
head[i]->next = NULL;
|
||||
}
|
||||
|
||||
int choose = -1;
|
||||
|
||||
printf("*********************************************************\n");
|
||||
printf("********** 实验二 *******\n");
|
||||
printf("*********************************************************\n");
|
||||
printf("********** 1.初始化单链表 *******\n");
|
||||
printf("********** 2.建立递增链表(按指数递增) *******\n");
|
||||
printf("********** 3.显示单链表整体 *******\n");
|
||||
printf("********** 4.求单链表长度 *******\n");
|
||||
printf("********** 5.判断单链表是否为空 *******\n");
|
||||
printf("********** 6.求一元多项式的和 *******\n");
|
||||
printf("********** 0.退出 *******\n");
|
||||
printf("*********************************************************\n");
|
||||
|
||||
while (choose != 0) {
|
||||
printf("请输入你的选择项:");
|
||||
scanf("%d", &choose);
|
||||
|
||||
// 在switch外部声明变量
|
||||
PNode *temp;
|
||||
|
||||
switch (choose) {
|
||||
case 1:
|
||||
chushihua(&head[0], &head[1], &head[2]);
|
||||
printf("链表已经初始化。\n");
|
||||
break;
|
||||
case 2:
|
||||
for (i = 0; i < 2; i++) {
|
||||
printf("创建的第%d个一元多项式:\n", i+1);
|
||||
charu_1(head[i]);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
printf("显示第1个链表:");
|
||||
xianshi(head[0]);
|
||||
printf("显示第2个链表:");
|
||||
xianshi(head[1]);
|
||||
break;
|
||||
case 4:
|
||||
printf("计算第1个链表的长度:");
|
||||
Length(head[0]);
|
||||
printf("计算第2个链表的长度:");
|
||||
Length(head[1]);
|
||||
break;
|
||||
case 5:
|
||||
printf("判断第1个链表是否为空:");
|
||||
Emp(head[0]);
|
||||
printf("判断第2个链表是否为空:");
|
||||
Emp(head[1]);
|
||||
break;
|
||||
case 6:
|
||||
// 先清空结果链表
|
||||
clearList(head[2]);
|
||||
hebiao(head[0], head[1], head[2]);
|
||||
break;
|
||||
case 0:
|
||||
printf("程序退出,感谢使用!\n");
|
||||
// 释放内存
|
||||
for (i = 0; i < 3; i++) {
|
||||
clearList(head[i]);
|
||||
free(head[i]);
|
||||
}
|
||||
return 0;
|
||||
default:
|
||||
printf("输入错误,请重新输入!\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
114
datastructure/2025301205+施光甲+实验五.cpp
Normal file
114
datastructure/2025301205+施光甲+实验五.cpp
Normal file
@@ -0,0 +1,114 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int nextval[20];
|
||||
|
||||
int BF(char a[], char b[])
|
||||
{
|
||||
int i = 1;
|
||||
int j = 1;
|
||||
while (i <= strlen(a) && j <= strlen(b))
|
||||
{
|
||||
//todo list 比较数组a、b里对应位置的字符:
|
||||
if (a[i - 1] == b[j - 1]) {
|
||||
// 若匹配成功,则继续比较后续字符;
|
||||
i++;
|
||||
j++;
|
||||
} else {
|
||||
// 若匹配不成功,i指针、j指针回退,重新开始匹配
|
||||
i = i - j + 2;
|
||||
j = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (j > strlen(b))
|
||||
{
|
||||
printf("BF算法匹配成功\n");
|
||||
//todo list //返回和模式b中第一个字符相等的字符在主串a中的序号
|
||||
return i - strlen(b);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("BF算法匹配失败\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Nextval(char b[])
|
||||
{
|
||||
nextval[1] = 0;
|
||||
int i = 1, j = 0;
|
||||
//todo list while 循环求nextval
|
||||
while (i < strlen(b)) {
|
||||
if (j == 0 || b[i - 1] == b[j - 1]) {
|
||||
i++;
|
||||
j++;
|
||||
if (b[i - 1] != b[j - 1]) {
|
||||
nextval[i] = j;
|
||||
} else {
|
||||
nextval[i] = nextval[j];
|
||||
}
|
||||
} else {
|
||||
j = nextval[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int KMP(char a[], char b[])
|
||||
{
|
||||
int i = 1, j = 1, k;
|
||||
Nextval(b); //求b串中所有字符的nextval值
|
||||
for (k = 1; k <= strlen(b); k++)
|
||||
{
|
||||
printf("nextval[%d]为:%4d\n", k, nextval[k]);
|
||||
}
|
||||
|
||||
while (i <= strlen(a) && j <= strlen(b))
|
||||
{
|
||||
//todo list 比较数组a、b里对应位置的字符:
|
||||
if (j == 0 || a[i - 1] == b[j - 1]) {
|
||||
// 若匹配成功,则继续比较后续字符;
|
||||
i++;
|
||||
j++;
|
||||
} else {
|
||||
// 若匹配不成功,利用nextval[j]实现j指针回退,重新开始匹配
|
||||
j = nextval[j];
|
||||
}
|
||||
}
|
||||
|
||||
if (j > strlen(b))
|
||||
{
|
||||
printf("KMP算法匹配成功!\n");
|
||||
//todo list
|
||||
//返回和模式b中第一个字符相等的字符在主串a中的序号
|
||||
return i - strlen(b);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("KMP算法匹配失败!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
char a[100], b[20];
|
||||
printf("请输入主串:\n");
|
||||
scanf("%s", a);
|
||||
// gets_s(a);
|
||||
printf("请输入子串:\n");
|
||||
scanf("%s", b);
|
||||
// gets_s(b);
|
||||
printf("----------------------------------------\n");
|
||||
|
||||
int num_BF, num_KMP;
|
||||
num_BF = BF(a, b);
|
||||
printf("BF:子串的第一个字符在主串中的位置为:%d\n", num_BF);
|
||||
printf("----------------------------------------\n");
|
||||
|
||||
num_KMP = KMP(a, b);
|
||||
printf("KMP:子串的第一个字符在主串中的位置为:%d", num_KMP);
|
||||
|
||||
return 0;
|
||||
}
|
||||
198
datastructure/2025301205+施光甲+实验六.cpp
Normal file
198
datastructure/2025301205+施光甲+实验六.cpp
Normal file
@@ -0,0 +1,198 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define OK 1
|
||||
typedef int Status;
|
||||
typedef struct BiTNode
|
||||
{
|
||||
char data; //结点数据域
|
||||
struct BiTNode *lchild, *rchild; //左右孩子指针
|
||||
}BiTNode,*BiTree;
|
||||
|
||||
//1、创建二叉链表:按先序次序输入二叉树中结点的值,创建二叉链表表示的二叉树T
|
||||
// 例:建立课本P115图5.10(b)的二叉树--读入字符的顺序为:ABC##DE#G##F###(#表示空树)
|
||||
BiTree Create(BiTree &T)
|
||||
{
|
||||
char ch;
|
||||
printf("请输入一个字符:");
|
||||
scanf("%c",&ch);
|
||||
getchar(); //清空缓冲区,把遗留的\n清除
|
||||
//todo list //if: 如果输入的是'#',则建立一棵空树
|
||||
//else:否则,递归建立一个二叉树(注意:是按按先序次序创建的二叉树)
|
||||
if(ch == '#') {
|
||||
T = NULL; //建立空树
|
||||
} else {
|
||||
T = (BiTree)malloc(sizeof(BiTNode)); //创建新结点
|
||||
T->data = ch;
|
||||
T->lchild = NULL;
|
||||
T->rchild = NULL;
|
||||
T->lchild = Create(T->lchild); //递归创建左子树
|
||||
T->rchild = Create(T->rchild); //递归创建右子树
|
||||
}
|
||||
return T;
|
||||
}
|
||||
|
||||
//先序遍历二叉树
|
||||
Status PreOrder(BiTree &T)
|
||||
{
|
||||
//todo list //if: 如果是空树,则返回
|
||||
//else:否则,先访问根结点 (D)
|
||||
//前序遍历左子树 (L)
|
||||
//前序遍历右子树 (R)
|
||||
if(T == NULL) {
|
||||
return OK;
|
||||
} else {
|
||||
printf("%c ", T->data); //访问根结点
|
||||
PreOrder(T->lchild); //前序遍历左子树
|
||||
PreOrder(T->rchild); //前序遍历右子树
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
//中序遍历二叉树
|
||||
Status InOrder(BiTree &T)
|
||||
{
|
||||
//todo list //if: 如果是空树,则返回
|
||||
//else:否则,先中序遍历左子树 (L)
|
||||
//访问根结点 (D)
|
||||
//中序遍历右子树 (R)
|
||||
if(T == NULL) {
|
||||
return OK;
|
||||
} else {
|
||||
InOrder(T->lchild); //中序遍历左子树
|
||||
printf("%c ", T->data); //访问根结点
|
||||
InOrder(T->rchild); //中序遍历右子树
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
//后序遍历
|
||||
Status PostOrder(BiTree &T)
|
||||
{
|
||||
//todo list //if: 如果是空树,则返回
|
||||
//else:否则,先后序遍历左子树 (L)
|
||||
//后序遍历右子树 (R)
|
||||
//访问根结点 (D)
|
||||
if(T == NULL) {
|
||||
return OK;
|
||||
} else {
|
||||
PostOrder(T->lchild); //后序遍历左子树
|
||||
PostOrder(T->rchild); //后序遍历右子树
|
||||
printf("%c ", T->data); //访问根结点
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
//层次遍历1
|
||||
void LeverOrder(BiTree &T)
|
||||
{
|
||||
if (T == NULL) { // 处理空树,避免空指针访问
|
||||
printf("二叉树为空!\n");
|
||||
return;
|
||||
}
|
||||
//BT *Queue[100]; //队列
|
||||
BiTree Queue[100]; //队列
|
||||
char ch;
|
||||
int front = 0;
|
||||
int rear = 0;
|
||||
// 队列边界检查(新增:防止数组越界)
|
||||
if (rear >= 100) {
|
||||
printf("队列已满,无法入队!\n");
|
||||
return;
|
||||
}
|
||||
Queue[rear++] = T; //根节点入队
|
||||
while (front < rear) //当队不空
|
||||
{
|
||||
ch = Queue[front]->data; //出队队头元素
|
||||
printf("%c ",ch);
|
||||
if (Queue[front]->lchild){
|
||||
if (rear >= 100) {
|
||||
printf("队列已满,左孩子无法入队!\n");
|
||||
break;
|
||||
}
|
||||
Queue[rear++] = Queue[front]->lchild;
|
||||
}
|
||||
if (Queue[front]->rchild){
|
||||
if (rear >= 100) {
|
||||
printf("队列已满,右孩子无法入队!\n");
|
||||
break;
|
||||
}
|
||||
Queue[rear++] = Queue[front]->rchild;
|
||||
}
|
||||
front++; // 队头后移,完成出队
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//节点总数
|
||||
int Count(BiTree &T)
|
||||
{
|
||||
//todo list //if:如果是空树,则结点个数为0;
|
||||
//else:否则,结点个数为左子树的结点个数+右子树的结点个数再+1。
|
||||
if(T == NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
return Count(T->lchild) + Count(T->rchild) + 1;
|
||||
}
|
||||
}
|
||||
//叶子节点
|
||||
int CountLeaf(BiTree &T)
|
||||
{
|
||||
//todo list //if:如果是空树,则叶子结点个数为0;
|
||||
//else if:如果是叶子结点,则返回1;
|
||||
//else否则,为左子树的叶子结点个数+右子树的叶子结点个数。
|
||||
if(T == NULL) {
|
||||
return 0;
|
||||
} else if(T->lchild == NULL && T->rchild == NULL) {
|
||||
return 1;
|
||||
} else {
|
||||
return CountLeaf(T->lchild) + CountLeaf(T->rchild);
|
||||
}
|
||||
}
|
||||
int main()
|
||||
{
|
||||
BiTree T = NULL; //创建一颗空树
|
||||
int choose = -1;
|
||||
printf("*********************************************\n");
|
||||
printf("********** 实验六 *******\n");
|
||||
printf("*********************************************\n");
|
||||
printf("********** 1.创建一棵二叉树 *******\n");
|
||||
printf("********** 2.先序遍历二叉树 *******\n");
|
||||
printf("********** 3.中序遍历二叉树 *******\n");
|
||||
printf("********** 4.后序遍历二叉树 *******\n");
|
||||
printf("********** 5.层序遍历二叉树 *******\n");
|
||||
printf("********** 6.求二叉树节点个数 *******\n");
|
||||
printf("********** 7.求二叉数叶子节点个数 *******\n");
|
||||
printf("********** 0.退出 *******\n");
|
||||
printf("*********************************************\n");
|
||||
while (choose)
|
||||
{
|
||||
printf("\n");
|
||||
printf("请输入你的选择项:");
|
||||
scanf("%d", &choose);
|
||||
getchar(); //清空缓冲区,把遗留的\n清除
|
||||
switch (choose)
|
||||
{
|
||||
case 1:T = Create(T); break; //创建
|
||||
printf("\n");
|
||||
case 2:
|
||||
printf("先序序列为:") ;
|
||||
PreOrder(T); break; //先序遍历二叉树
|
||||
printf("\n");
|
||||
case 3:
|
||||
printf("中序序列为:") ;
|
||||
InOrder(T); break; //中序遍历二叉树
|
||||
printf("\n");
|
||||
case 4:
|
||||
printf("后序序列为:") ;
|
||||
PostOrder(T); break; //后序遍历二叉树
|
||||
printf("\n");
|
||||
case 5:
|
||||
printf("层次序列为:") ;
|
||||
LeverOrder(T); break; //层序遍历二叉树
|
||||
printf("\n");
|
||||
case 6:printf("节点总数为:%d\n", Count(T)); break;//结点总数
|
||||
case 7:printf("叶子节点总数为:%d\n", CountLeaf(T)); break; //叶子结点总数
|
||||
case 0:exit(0); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
153
datastructure/2025301205+施光甲+实验四.cpp
Normal file
153
datastructure/2025301205+施光甲+实验四.cpp
Normal file
@@ -0,0 +1,153 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define MAXSIZE 100
|
||||
|
||||
typedef struct Stack
|
||||
{
|
||||
char *base; //栈底指针
|
||||
char *top; //栈顶指针
|
||||
int stacksize; //栈可用的最大容量
|
||||
int length; //新增:用来判断栈是否为空
|
||||
}Stack;
|
||||
|
||||
//初始化
|
||||
void InitStack(Stack &p)
|
||||
{
|
||||
p.base = new char[MAXSIZE]; //分配空间
|
||||
//todo list 处理 栈顶指针top初始为base
|
||||
p.top = p.base;
|
||||
//todo list 处理stacksize、length
|
||||
p.stacksize = MAXSIZE;
|
||||
p.length = 0;
|
||||
}
|
||||
|
||||
#define OK 1
|
||||
#define ERROR 0
|
||||
typedef int Status;
|
||||
|
||||
//入栈
|
||||
Status Push(Stack &p, char e)
|
||||
{
|
||||
if(p.top - p.base == p.stacksize) // 栈满
|
||||
return ERROR;
|
||||
//todo list //将元素e压入栈顶
|
||||
*p.top = e;
|
||||
//todo list //栈顶指针加1
|
||||
p.top++;
|
||||
p.length++;
|
||||
return OK;
|
||||
}
|
||||
|
||||
//出栈
|
||||
char Pop(Stack &p)
|
||||
{
|
||||
char e;
|
||||
if(p.top == p.base) // 栈空
|
||||
return '\0';
|
||||
//todo list //栈顶指针减1
|
||||
p.top--;
|
||||
//todo list //取栈顶元素
|
||||
e = *p.top;
|
||||
p.length--;
|
||||
return e;
|
||||
}
|
||||
|
||||
//1、判断是否为回文串
|
||||
void Palindrome(Stack &S, char a[])
|
||||
{
|
||||
int i;
|
||||
//栈清空
|
||||
S.top = S.base;
|
||||
S.length = 0;
|
||||
for (i = 0; a[i] != '\0'; i++){
|
||||
//todo list //for循环 把字符串全部入栈Push()
|
||||
Push(S, a[i]);
|
||||
}
|
||||
for (i = 0; a[i] != '\0'; i++){
|
||||
//todo list //for循环 对比串的两端元素,如果Pop(S) != a[i]则表明不是回文,退出
|
||||
if(Pop(S) != a[i]){
|
||||
printf("----不是回文----\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (i == strlen(a))
|
||||
{
|
||||
printf("------回文------\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("----不是回文----\n");
|
||||
}
|
||||
}
|
||||
|
||||
//2、括号匹配检验------可参考课本P75
|
||||
//只讨论由圆括号()和中括号[]组成的括号
|
||||
void Matching(Stack &S, char ch[])
|
||||
{
|
||||
int flag = 1; //flag初始为1,当 flag = 1时表示匹配成功
|
||||
int i=0;
|
||||
//栈清空
|
||||
S.top = S.base;
|
||||
S.length = 0;
|
||||
//todo list //while做括号匹配检验:
|
||||
while(ch[i] != '\0' && flag){
|
||||
//若为左括号,则将其入栈;
|
||||
if(ch[i] == '(' || ch[i] == '['){
|
||||
Push(S, ch[i]);
|
||||
}
|
||||
//若为右括号,则与出栈的栈顶元素进行比较,分析是否能够配对(如果不匹配,注意将flag置为0 )。
|
||||
else if(ch[i] == ')' || ch[i] == ']'){
|
||||
if(S.length == 0){
|
||||
flag = 0;
|
||||
}
|
||||
else{
|
||||
char left = Pop(S);
|
||||
if((ch[i] == ')' && left != '(') || (ch[i] == ']' && left != '[')){
|
||||
flag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(S.length == 0 && flag ) //栈空且flag = 1时,括号匹配
|
||||
printf("-----括号匹配-----\n");
|
||||
else
|
||||
printf("----括号不匹配----\n");
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
char a[20], b[20];
|
||||
Stack s;
|
||||
InitStack(s);
|
||||
int choose = -1;
|
||||
printf("------------------------------\n");
|
||||
printf("1.判断是否是回文字符串\n");
|
||||
printf("2.判断括号是否匹配\n");
|
||||
printf("0.退出\n");
|
||||
printf("------------------------------\n");
|
||||
while(choose)
|
||||
{
|
||||
printf("请输入选项:");
|
||||
scanf("%d", &choose);
|
||||
switch(choose)
|
||||
{
|
||||
case 1:
|
||||
printf("请输入一个字符串:");
|
||||
scanf("%s",a);
|
||||
Palindrome(s, a);
|
||||
break;
|
||||
case 2:
|
||||
printf("请输入一个字符串(由圆括号和中括号组成):");
|
||||
scanf("%s",b);
|
||||
Matching(s, b);
|
||||
break;
|
||||
case 0:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
122
nodejs/nodeExperiment1/server.js
Normal file
122
nodejs/nodeExperiment1/server.js
Normal file
@@ -0,0 +1,122 @@
|
||||
const os = require('os');
|
||||
const http = require('http');
|
||||
|
||||
// 获取系统信息
|
||||
const getSystemInfo = () => {
|
||||
try {
|
||||
const totalMem = (os.totalmem() / (1024 ** 3)).toFixed(2) + ' GB';
|
||||
const freeMem = (os.freemem() / (1024 ** 3)).toFixed(2) + ' GB';
|
||||
const usedMem = ((os.totalmem() - os.freemem()) / (1024 ** 3)).toFixed(2) + ' GB';
|
||||
const memUsage = (((os.totalmem() - os.freemem()) / os.totalmem()) * 100).toFixed(2) + '%';
|
||||
|
||||
const cpus = os.cpus();
|
||||
const cpuModel = cpus[0]?.model || 'Unknown';
|
||||
const cpuCores = cpus.length;
|
||||
|
||||
|
||||
return {
|
||||
hostname: os.hostname(),
|
||||
platform: os.platform(),
|
||||
arch: os.arch(),
|
||||
uptime: (os.uptime() / 3600).toFixed(2) + ' hours',
|
||||
|
||||
// 内存信息:使用前面计算好的变量
|
||||
totalMem, // 总内存大小
|
||||
usedMem, // 已使用内存
|
||||
freeMem, // 空闲内存
|
||||
memUsage, // 内存使用率
|
||||
// CPU信息:使用前面计算好的变量
|
||||
|
||||
cpuModel, // CPU型号
|
||||
cpuCores // CPU核心数
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('获取系统信息失败:', error.message);
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
// 创建HTTP服务器
|
||||
const server = http.createServer((req, res) => {
|
||||
if (req.url === '/') {
|
||||
const systemInfo = getSystemInfo();
|
||||
const html = `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>系统信息监控</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 40px;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
text-align: center;
|
||||
border-bottom: 2px solid #eee;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.info-item {
|
||||
margin: 15px 0;
|
||||
padding: 10px;
|
||||
background: #f9f9f9;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.label {
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
}
|
||||
.memory { border-left: 4px solid #4CAF50; }
|
||||
.cpu { border-left: 4px solid #2196F3; }
|
||||
.system { border-left: 4px solid #FF9800; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>🖥️ 系统信息监控</h1>
|
||||
|
||||
<div class="info-item system">
|
||||
<span class="label">主机名:</span> ${systemInfo.hostname || 'N/A'}<br>
|
||||
<span class="label">平台:</span> ${systemInfo.platform || 'N/A'}<br>
|
||||
<span class="label">架构:</span> ${systemInfo.arch || 'N/A'}<br>
|
||||
<span class="label">运行时间:</span> ${systemInfo.uptime || 'N/A'}
|
||||
</div>
|
||||
|
||||
<div class="info-item memory">
|
||||
<span class="label">总内存:</span> ${systemInfo.totalMem || 'N/A'}<br>
|
||||
<span class="label">已用内存:</span> ${systemInfo.usedMem || 'N/A'}<br>
|
||||
<span class="label">空闲内存:</span> ${systemInfo.freeMem || 'N/A'}<br>
|
||||
<span class="label">内存使用率:</span> ${systemInfo.memUsage || 'N/A'}
|
||||
</div>
|
||||
|
||||
<div class="info-item cpu">
|
||||
<span class="label">CPU型号:</span> ${systemInfo.cpuModel || 'N/A'}<br>
|
||||
<span class="label">CPU核心数:</span> ${systemInfo.cpuCores || 'N/A'}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
|
||||
res.end(html);
|
||||
} else {
|
||||
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
||||
res.end('页面未找到');
|
||||
}
|
||||
});
|
||||
|
||||
// 启动服务器
|
||||
const PORT = 3000;
|
||||
server.listen(PORT, () => {
|
||||
console.log(`🚀 服务器运行在 http://localhost:${PORT}`);
|
||||
});
|
||||
36
nodejs/nodeExperiment2/.gitignore
vendored
Normal file
36
nodejs/nodeExperiment2/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
51
nodejs/nodeExperiment2/array_practice.js
Normal file
51
nodejs/nodeExperiment2/array_practice.js
Normal file
@@ -0,0 +1,51 @@
|
||||
const numbers = [15, 8, 23, 4, 42, 16, 7];
|
||||
const students = [
|
||||
{ name: '张三', score: 85 },
|
||||
{ name: '李四', score: 62 },
|
||||
{ name: '王五', score: 91 }
|
||||
];
|
||||
|
||||
console.log('1. slice() - 数组切片');
|
||||
const sliced = numbers.slice(1, 4);
|
||||
console.log('numbers.slice(1, 4):', sliced);
|
||||
|
||||
console.log('\n2. filter() - 筛选元素');
|
||||
const evenNumbers = numbers.filter(numbers => numbers % 3 == 0);
|
||||
console.log('偶数:', evenNumbers);
|
||||
|
||||
console.log('\n3. find() - 查找元素');
|
||||
const findScore = students.find(student => student.score > 90);
|
||||
console.log('分数>90的学生:', findScore);
|
||||
|
||||
console.log('\n4. findIndex() - 查找索引');
|
||||
const index = numbers.findIndex(numbers => numbers > 20);
|
||||
console.log('第一个>20的数的索引:', index);
|
||||
|
||||
console.log('\n5. every() - 所有元素满足条件');
|
||||
|
||||
const allPassed = students.every(student => student.score >= 60);
|
||||
console.log('所有学生都及格:', allPassed);
|
||||
|
||||
|
||||
console.log('\n6. some() - 至少一个满足条件');
|
||||
const hasHighScore = students.some(student => student.score > 90);
|
||||
console.log('有高分学生:', hasHighScore);
|
||||
|
||||
console.log('\n7. unshift() - 开头添加');
|
||||
const arr = [2, 3];
|
||||
arr.unshift(1);
|
||||
console.log('添加后:', arr);
|
||||
|
||||
console.log('\n8. splice() - 添加删除');
|
||||
const colors = ['red', 'green', 'blue'];
|
||||
colors.splice(1, 1, 'yellow');
|
||||
console.log('替换后:', colors);
|
||||
|
||||
console.log('\n9. sort() - 排序');
|
||||
const sortedAsc = [...numbers].sort((a, b) => a - b);
|
||||
const sortedDesc = [...numbers].sort((a, b) => b - a);
|
||||
console.log('升序:', sortedAsc, '降序:', sortedDesc);
|
||||
|
||||
console.log('\n10. reduce() - 累加');
|
||||
const sum = numbers.reduce((total, num) => total + num, 0);
|
||||
console.log('数组求和:', sum);
|
||||
6
nodejs/nodeExperiment2/index.js
Normal file
6
nodejs/nodeExperiment2/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
// index.js
|
||||
const myModule = require('./myModule');
|
||||
|
||||
console.log(`Author: ${myModule.author}`);
|
||||
console.log(myModule.greet('Alice'));
|
||||
console.log(`Sum: ${myModule.add(5, 3)}`);
|
||||
14
nodejs/nodeExperiment2/index2.js
Normal file
14
nodejs/nodeExperiment2/index2.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const lodash =require('lodash')
|
||||
|
||||
|
||||
const arry =[1,2,3,4,5]
|
||||
|
||||
const result = lodash.reverse(arry.slice(arry))
|
||||
console.log('Reversed arry:',result);
|
||||
|
||||
const result2 = lodash.filter(arry, (num)=> {
|
||||
return num >= 3;
|
||||
});
|
||||
|
||||
console.log(result2);
|
||||
|
||||
18
nodejs/nodeExperiment2/myModule.js
Normal file
18
nodejs/nodeExperiment2/myModule.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// 属性
|
||||
const author = "harry";
|
||||
|
||||
// 方法
|
||||
function greet(name) {
|
||||
return `Hello, ${name}`;
|
||||
}
|
||||
|
||||
function add(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
// 共享属性 author 和 greet()、add()方法
|
||||
module.exports = {
|
||||
author,
|
||||
greet,
|
||||
add
|
||||
};
|
||||
18
nodejs/nodeExperiment2/package-lock.json
generated
Normal file
18
nodejs/nodeExperiment2/package-lock.json
generated
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "nodeExpriment2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
5
nodejs/nodeExperiment2/package.json
Normal file
5
nodejs/nodeExperiment2/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
}
|
||||
36
nodejs/nodeExperiment3/.gitignore
vendored
Normal file
36
nodejs/nodeExperiment3/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
9
nodejs/nodeExperiment3/index.js
Normal file
9
nodejs/nodeExperiment3/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const express = require("express");
|
||||
const app = express();
|
||||
const userRouter = require("./router/userRouter.js");
|
||||
|
||||
app.use(userRouter);
|
||||
|
||||
app.listen(8080, () => {
|
||||
console.log("启动成功,访问地址为:http://localhost:8080/");
|
||||
});
|
||||
915
nodejs/nodeExperiment3/package-lock.json
generated
Normal file
915
nodejs/nodeExperiment3/package-lock.json
generated
Normal file
@@ -0,0 +1,915 @@
|
||||
{
|
||||
"name": "nodeexperiment3",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nodeexperiment3",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^5.1.0",
|
||||
"joi": "^18.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@hapi/address": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/@hapi/address/-/address-5.1.1.tgz",
|
||||
"integrity": "sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@hapi/hoek": "^11.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@hapi/formula": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/@hapi/formula/-/formula-3.0.2.tgz",
|
||||
"integrity": "sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@hapi/hoek": {
|
||||
"version": "11.0.7",
|
||||
"resolved": "https://registry.npmmirror.com/@hapi/hoek/-/hoek-11.0.7.tgz",
|
||||
"integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@hapi/pinpoint": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/@hapi/pinpoint/-/pinpoint-2.0.1.tgz",
|
||||
"integrity": "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@hapi/tlds": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmmirror.com/@hapi/tlds/-/tlds-1.1.4.tgz",
|
||||
"integrity": "sha512-Fq+20dxsxLaUn5jSSWrdtSRcIUba2JquuorF9UW1wIJS5cSUwxIsO2GIhaWynPRflvxSzFN+gxKte2HEW1OuoA==",
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@hapi/topo": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/@hapi/topo/-/topo-6.0.2.tgz",
|
||||
"integrity": "sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@hapi/hoek": "^11.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@standard-schema/spec": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/@standard-schema/spec/-/spec-1.0.0.tgz",
|
||||
"integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/accepts/-/accepts-2.0.0.tgz",
|
||||
"integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-types": "^3.0.0",
|
||||
"negotiator": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-2.2.0.tgz",
|
||||
"integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^1.0.5",
|
||||
"debug": "^4.4.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.14.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"type-is": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-1.0.0.tgz",
|
||||
"integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safe-buffer": "5.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie-signature": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.2.2.tgz",
|
||||
"integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz",
|
||||
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/express/-/express-5.1.0.tgz",
|
||||
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.2.0",
|
||||
"content-disposition": "^1.0.0",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.7.1",
|
||||
"cookie-signature": "^1.2.1",
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"finalhandler": "^2.1.0",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"merge-descriptors": "^2.0.0",
|
||||
"mime-types": "^3.0.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"once": "^1.4.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"qs": "^6.14.0",
|
||||
"range-parser": "^1.2.1",
|
||||
"router": "^2.2.0",
|
||||
"send": "^1.1.0",
|
||||
"serve-static": "^2.2.0",
|
||||
"statuses": "^2.0.1",
|
||||
"type-is": "^2.0.1",
|
||||
"vary": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-2.1.0.tgz",
|
||||
"integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"parseurl": "^1.3.3",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/fresh/-/fresh-2.0.0.tgz",
|
||||
"integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz",
|
||||
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"inherits": "2.0.4",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"toidentifier": "1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors/node_modules/statuses": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",
|
||||
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-4.0.0.tgz",
|
||||
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/joi": {
|
||||
"version": "18.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/joi/-/joi-18.0.1.tgz",
|
||||
"integrity": "sha512-IiQpRyypSnLisQf3PwuN2eIHAsAIGZIrLZkd4zdvIar2bDyhM91ubRjy8a3eYablXsh9BeI/c7dmPYHca5qtoA==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@hapi/address": "^5.1.1",
|
||||
"@hapi/formula": "^3.0.2",
|
||||
"@hapi/hoek": "^11.0.7",
|
||||
"@hapi/pinpoint": "^2.0.1",
|
||||
"@hapi/tlds": "^1.1.1",
|
||||
"@hapi/topo": "^6.0.2",
|
||||
"@standard-schema/spec": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-1.1.0.tgz",
|
||||
"integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
|
||||
"integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.54.0",
|
||||
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.54.0.tgz",
|
||||
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-3.0.1.tgz",
|
||||
"integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "^1.54.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-1.0.0.tgz",
|
||||
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
|
||||
"integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-3.0.1.tgz",
|
||||
"integrity": "sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.7.0",
|
||||
"unpipe": "1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body/node_modules/iconv-lite": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.7.0.tgz",
|
||||
"integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/router/-/router-2.2.0.tgz",
|
||||
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"is-promise": "^4.0.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"path-to-regexp": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/send/-/send-1.2.0.tgz",
|
||||
"integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.5",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"mime-types": "^3.0.1",
|
||||
"ms": "^2.1.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"range-parser": "^1.2.1",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-2.2.0.tgz",
|
||||
"integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"parseurl": "^1.3.3",
|
||||
"send": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-list": "^1.0.0",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/type-is": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/type-is/-/type-is-2.0.1.tgz",
|
||||
"integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"content-type": "^1.0.5",
|
||||
"media-typer": "^1.1.0",
|
||||
"mime-types": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
}
|
||||
16
nodejs/nodeExperiment3/package.json
Normal file
16
nodejs/nodeExperiment3/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "nodeexperiment3",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^5.1.0",
|
||||
"joi": "^18.0.1"
|
||||
}
|
||||
}
|
||||
90
nodejs/nodeExperiment3/router/userRouter.js
Normal file
90
nodejs/nodeExperiment3/router/userRouter.js
Normal file
@@ -0,0 +1,90 @@
|
||||
const express = require("express");
|
||||
const joi = require("joi");
|
||||
const router = express.Router();
|
||||
|
||||
|
||||
router.get('/userId/:userId', (req, res) => {
|
||||
const userId = req.params.userId;
|
||||
const { error } = joi.number().validate(userId);
|
||||
if (error) {
|
||||
return res.status(400).send('Invalid userID');
|
||||
}
|
||||
res.send(`User Id is ${userId}`);
|
||||
});
|
||||
|
||||
router.get('/userName', (req, res) => {
|
||||
const { name } = req.query;
|
||||
const schema = joi.object({
|
||||
name: joi.string().min(2).max(20).required()
|
||||
});
|
||||
const { error } = schema.validate({ name });
|
||||
if (error) {
|
||||
return res.status(400).send('Invalid user name');
|
||||
}
|
||||
res.send(`User name is ${name}`);
|
||||
});
|
||||
|
||||
|
||||
router.get('/profile', (req, res) => {
|
||||
res.send('This is the user profile page.');
|
||||
});
|
||||
|
||||
router.get('/profile/settings', (req, res) => {
|
||||
res.send('This is the user profile settings page.');
|
||||
});
|
||||
|
||||
|
||||
const scores = [
|
||||
{ name: 'zs', course: 'app', score: 90 },
|
||||
{ name: 'zs', course: 'java', score: 80 },
|
||||
{ name: 'ls', course: 'app', score: 89 },
|
||||
{ name: 'ls', course: 'java', score: 99 },
|
||||
{ name: 'ww', course: 'app', score: 78 },
|
||||
{ name: 'ww', course: 'java', score: 88 },
|
||||
];
|
||||
|
||||
router.get('/myScore', (req, res) => {
|
||||
const name = req.query.name;
|
||||
const result = scores.filter(s => s.name === name);
|
||||
res.json({ name, scores: result });
|
||||
});
|
||||
|
||||
router.get('/showScore', (req, res) => {
|
||||
const sorted = [...scores].sort((a, b) => a.score - b.score);
|
||||
const avg = {};
|
||||
scores.forEach(s => {
|
||||
avg[s.name] = (avg[s.name] || { total: 0, count: 0 });
|
||||
avg[s.name].total += s.score;
|
||||
avg[s.name].count++;
|
||||
});
|
||||
const avgResult = Object.entries(avg).map(([name, data]) => ({
|
||||
name,
|
||||
average: data.total / data.count
|
||||
}));
|
||||
res.json({ "升序排列": sorted, "平均分": avgResult });
|
||||
});
|
||||
|
||||
const moneys = [
|
||||
{ name: '张三', mny: '9k' },
|
||||
{ name: '李四', mny: 15000 },
|
||||
{ name: '王五', mny: '1w' },
|
||||
{ name: '随便', mny: 6666 }
|
||||
];
|
||||
|
||||
|
||||
router.get('/filterMoney', (req, res) => {
|
||||
const parse = (mny) => {
|
||||
if (typeof mny === 'number') return mny;
|
||||
if (mny.endsWith('k')) return parseFloat(mny) * 1000;
|
||||
if (mny.endsWith('w')) return parseFloat(mny) * 10000;
|
||||
return 0;
|
||||
};
|
||||
|
||||
const result = moneys
|
||||
.map(item => ({ ...item, num: parse(item.mny) }))
|
||||
.filter(item => item.num >= 9000)
|
||||
.sort((a, b) => b.num - a.num);
|
||||
res.json(result);
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
36
nodejs/nodeExperiment4/.gitignore
vendored
Normal file
36
nodejs/nodeExperiment4/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
47
nodejs/nodeExperiment4/app.js
Normal file
47
nodejs/nodeExperiment4/app.js
Normal file
@@ -0,0 +1,47 @@
|
||||
const express = require('express');
|
||||
const Bodyparser = require('body-parser');
|
||||
const cors = require('cors');
|
||||
// const jsonp = require('express-jsonp');
|
||||
const app = express();
|
||||
|
||||
|
||||
const corsOptions = {
|
||||
origin: 'http://localhost',
|
||||
methods: ['GET', 'POST'],
|
||||
allowedHeaders: ['Content-Type', 'Authorization','jsonp']
|
||||
};
|
||||
|
||||
app.use(Bodyparser.urlencoded({ extended: true }));
|
||||
app.use(Bodyparser.json());
|
||||
app.use(cors(corsOptions));
|
||||
// app.use(jsonp());
|
||||
|
||||
|
||||
app.get('/api/data', (req, res) => {
|
||||
const data = [
|
||||
{ id: 1, name: "张三", age: 20, gender: "男" },
|
||||
{ id: 2, name: "李四", age: 22, gender: "女" }
|
||||
];
|
||||
res.send(data);
|
||||
});
|
||||
|
||||
|
||||
app.post('/api/data', (req, res) => {
|
||||
const newData = req.body;
|
||||
console.log("Recevied new data: ", newData);
|
||||
res.status(201).json({ msg: '已添加', data: newData });
|
||||
})
|
||||
|
||||
|
||||
app.get('/api/jsonp', (req, res) => {
|
||||
const data = [
|
||||
{ id: 1, name: "张三", age: 20, gender: "男" },
|
||||
{ id: 2, name: "李四", age: 22, gender: "女" },
|
||||
];
|
||||
res.jsonp(data);
|
||||
})
|
||||
|
||||
const port = 3000;
|
||||
app.listen(port, () => {
|
||||
console.log(`服务器启动成功,端口号为${port}`);
|
||||
})
|
||||
19
nodejs/nodeExperiment4/jsonp.html
Normal file
19
nodejs/nodeExperiment4/jsonp.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>JSONP Test</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
function handleResponse(data) {
|
||||
console.log(data);
|
||||
}
|
||||
</script>
|
||||
<script src="http://localhost:3000/api/jsonp?callback=handleResponse"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
875
nodejs/nodeExperiment4/package-lock.json
generated
Normal file
875
nodejs/nodeExperiment4/package-lock.json
generated
Normal file
@@ -0,0 +1,875 @@
|
||||
{
|
||||
"name": "nodeexperiment4",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nodeexperiment4",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.0",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^5.1.0",
|
||||
"express-jsonp": "^0.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/accepts/-/accepts-2.0.0.tgz",
|
||||
"integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-types": "^3.0.0",
|
||||
"negotiator": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-2.2.0.tgz",
|
||||
"integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^1.0.5",
|
||||
"debug": "^4.4.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.14.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"type-is": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-1.0.0.tgz",
|
||||
"integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safe-buffer": "5.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie-signature": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.2.2.tgz",
|
||||
"integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cors": {
|
||||
"version": "2.8.5",
|
||||
"resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.5.tgz",
|
||||
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"object-assign": "^4",
|
||||
"vary": "^1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz",
|
||||
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/express/-/express-5.1.0.tgz",
|
||||
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.2.0",
|
||||
"content-disposition": "^1.0.0",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.7.1",
|
||||
"cookie-signature": "^1.2.1",
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"finalhandler": "^2.1.0",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"merge-descriptors": "^2.0.0",
|
||||
"mime-types": "^3.0.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"once": "^1.4.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"qs": "^6.14.0",
|
||||
"range-parser": "^1.2.1",
|
||||
"router": "^2.2.0",
|
||||
"send": "^1.1.0",
|
||||
"serve-static": "^2.2.0",
|
||||
"statuses": "^2.0.1",
|
||||
"type-is": "^2.0.1",
|
||||
"vary": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/express-jsonp": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/express-jsonp/-/express-jsonp-0.1.0.tgz",
|
||||
"integrity": "sha512-zEwiw5ZZEUw1VDRcZOX9zbKFAT0FhW68hnflt1aO9norfUdugD/oDN4BSWMWTQksEvlTgKasM+kmffP4l1Z/EQ==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-2.1.0.tgz",
|
||||
"integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"parseurl": "^1.3.3",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/fresh/-/fresh-2.0.0.tgz",
|
||||
"integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz",
|
||||
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"inherits": "2.0.4",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"toidentifier": "1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors/node_modules/statuses": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",
|
||||
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-4.0.0.tgz",
|
||||
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-1.1.0.tgz",
|
||||
"integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
|
||||
"integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.54.0",
|
||||
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.54.0.tgz",
|
||||
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-3.0.1.tgz",
|
||||
"integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "^1.54.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-1.0.0.tgz",
|
||||
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
|
||||
"integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-3.0.1.tgz",
|
||||
"integrity": "sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.7.0",
|
||||
"unpipe": "1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body/node_modules/iconv-lite": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.7.0.tgz",
|
||||
"integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/router/-/router-2.2.0.tgz",
|
||||
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"is-promise": "^4.0.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"path-to-regexp": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/send/-/send-1.2.0.tgz",
|
||||
"integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.5",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"mime-types": "^3.0.1",
|
||||
"ms": "^2.1.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"range-parser": "^1.2.1",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-2.2.0.tgz",
|
||||
"integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"parseurl": "^1.3.3",
|
||||
"send": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-list": "^1.0.0",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/type-is": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/type-is/-/type-is-2.0.1.tgz",
|
||||
"integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"content-type": "^1.0.5",
|
||||
"media-typer": "^1.1.0",
|
||||
"mime-types": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
}
|
||||
18
nodejs/nodeExperiment4/package.json
Normal file
18
nodejs/nodeExperiment4/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "nodeexperiment4",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.0",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^5.1.0",
|
||||
"express-jsonp": "^0.1.0"
|
||||
}
|
||||
}
|
||||
36
nodejs/nodeExperiment5/.gitignore
vendored
Normal file
36
nodejs/nodeExperiment5/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
141
nodejs/nodeExperiment5/index.js
Normal file
141
nodejs/nodeExperiment5/index.js
Normal file
@@ -0,0 +1,141 @@
|
||||
// index.js
|
||||
const express = require('express');
|
||||
const mysql = require('mysql2');
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
const cors = require('cors');
|
||||
|
||||
// 创建 MySQL 数据库连接
|
||||
const db = mysql.createConnection({
|
||||
host: 'localhost',
|
||||
user: 'root',
|
||||
password: '123456',
|
||||
database: 'express_db'
|
||||
});
|
||||
|
||||
// 连接到 MySQL 数据库
|
||||
db.connect((err) => {
|
||||
if (err) {
|
||||
console.error('Error connecting to MySQL database:', err);
|
||||
return;
|
||||
}
|
||||
console.log('Connected to MySQL database');
|
||||
});
|
||||
|
||||
// 设置 Express 应用的 JSON 和urlencoded中间件
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(cors());
|
||||
|
||||
app.set('view engine', 'ejs');
|
||||
app.set('views', './public');
|
||||
|
||||
|
||||
app.get('/register-page', (req, res) => {
|
||||
res.render('register');
|
||||
})
|
||||
|
||||
// 处理表单提交的路由
|
||||
app.post('/register', (req, res) => {
|
||||
const { username, password, email, gender, hobbies, city, description } = req.body;
|
||||
|
||||
let hobbiesStr = '';
|
||||
if (Array.isArray(hobbies)) {
|
||||
hobbiesStr = hobbies.join(',');
|
||||
} else if (hobbies) {
|
||||
hobbiesStr = hobbies;
|
||||
}
|
||||
|
||||
// 构建插入数据的 SQL 语句
|
||||
const sql = 'INSERT INTO users (username, password, email, gender, hobbies, city, description) VALUES (?, ?, ?, ?, ?, ?, ?)';
|
||||
const values = [username, password, email, gender, hobbiesStr, city, description];
|
||||
|
||||
// 执行 SQL 语句
|
||||
db.query(sql, values, (err, result) => {
|
||||
if (err) {
|
||||
console.error('Error inserting data into MySQL database:', err);
|
||||
res.status(500).send('Error inserting data into MySQL database');
|
||||
return;
|
||||
}
|
||||
console.log('Data inserted successfully');
|
||||
res.send('Registration successful');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
app.get('/login-page', (req, res) => {
|
||||
res.render('login');
|
||||
});
|
||||
|
||||
// 处理登录表单提交
|
||||
app.post('/login', (req, res) => {
|
||||
const { username, password } = req.body;
|
||||
|
||||
// 构建查询用户的 SQL 语句
|
||||
const sql = 'SELECT * FROM users WHERE username = ? AND password = ?';
|
||||
const values = [username, password];
|
||||
|
||||
// 执行 SQL 语句
|
||||
db.query(sql, values, (err, results) => {
|
||||
if (err) {
|
||||
console.error('Error querying the database:', err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (results.length > 0) {
|
||||
console.log('Login successful');
|
||||
res.render('login', { message: '登录成功!' });
|
||||
} else {
|
||||
console.log('Login failed');
|
||||
res.render('login', { message: '用户名或密码错误' });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
app.get('/update-password-page', (req, res) => {
|
||||
res.render('update-password');
|
||||
})
|
||||
|
||||
// 处理更新用户密码的路由
|
||||
app.post('/update-password', (req, res) => {
|
||||
const { username, currentPassword, newPassword } = req.body;
|
||||
|
||||
// 验证当前密码是否正确
|
||||
const sqlCheck = 'SELECT * FROM users WHERE username = ? AND password = ?';
|
||||
const checkValues = [username, currentPassword];
|
||||
|
||||
db.query(sqlCheck, checkValues, (err, results) => {
|
||||
if (err) {
|
||||
console.error('Error querying the database:', err);
|
||||
res.status(500).send('Error querying the database');
|
||||
return;
|
||||
}
|
||||
|
||||
if (results.length === 0) {
|
||||
console.log('当前密码输入错误');
|
||||
res.status(400).send('Current password is incorrect');
|
||||
return;
|
||||
}
|
||||
|
||||
// 当前密码正确,更新新密码
|
||||
const sqlUpdate = 'UPDATE users SET password = ? WHERE username = ?';
|
||||
const updateValues = [newPassword, username];
|
||||
|
||||
db.query(sqlUpdate, updateValues, (err, result) => {
|
||||
if (err) {
|
||||
console.error('Error updating user password:', err);
|
||||
res.status(500).send('Error updating user password');
|
||||
return;
|
||||
}
|
||||
console.log('User password updated successfully');
|
||||
res.send('User password updated successfully');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 启动服务器
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is running on http://localhost:${port}`);
|
||||
});
|
||||
975
nodejs/nodeExperiment5/package-lock.json
generated
Normal file
975
nodejs/nodeExperiment5/package-lock.json
generated
Normal file
@@ -0,0 +1,975 @@
|
||||
{
|
||||
"name": "nodeexperiment5",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nodeexperiment5",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cors": "^2.8.5",
|
||||
"express": "^5.1.0",
|
||||
"mysql2": "^3.15.3"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/accepts/-/accepts-2.0.0.tgz",
|
||||
"integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-types": "^3.0.0",
|
||||
"negotiator": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/aws-ssl-profiles": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz",
|
||||
"integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-2.2.0.tgz",
|
||||
"integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^1.0.5",
|
||||
"debug": "^4.4.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.14.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"type-is": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-1.0.0.tgz",
|
||||
"integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safe-buffer": "5.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie-signature": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.2.2.tgz",
|
||||
"integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cors": {
|
||||
"version": "2.8.5",
|
||||
"resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.5.tgz",
|
||||
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"object-assign": "^4",
|
||||
"vary": "^1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz",
|
||||
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/denque": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/denque/-/denque-2.1.0.tgz",
|
||||
"integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/express/-/express-5.1.0.tgz",
|
||||
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.2.0",
|
||||
"content-disposition": "^1.0.0",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.7.1",
|
||||
"cookie-signature": "^1.2.1",
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"finalhandler": "^2.1.0",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"merge-descriptors": "^2.0.0",
|
||||
"mime-types": "^3.0.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"once": "^1.4.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"qs": "^6.14.0",
|
||||
"range-parser": "^1.2.1",
|
||||
"router": "^2.2.0",
|
||||
"send": "^1.1.0",
|
||||
"serve-static": "^2.2.0",
|
||||
"statuses": "^2.0.1",
|
||||
"type-is": "^2.0.1",
|
||||
"vary": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-2.1.0.tgz",
|
||||
"integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"parseurl": "^1.3.3",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/fresh/-/fresh-2.0.0.tgz",
|
||||
"integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/generate-function": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/generate-function/-/generate-function-2.3.1.tgz",
|
||||
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-property": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz",
|
||||
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "2.0.0",
|
||||
"inherits": "2.0.4",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "2.0.1",
|
||||
"toidentifier": "1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors/node_modules/statuses": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",
|
||||
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.7.0.tgz",
|
||||
"integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-4.0.0.tgz",
|
||||
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/is-property": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/is-property/-/is-property-1.0.2.tgz",
|
||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/long": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/long/-/long-5.3.2.tgz",
|
||||
"integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/lru-cache": {
|
||||
"version": "7.18.3",
|
||||
"resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-7.18.3.tgz",
|
||||
"integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/lru.min": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/lru.min/-/lru.min-1.1.3.tgz",
|
||||
"integrity": "sha512-Lkk/vx6ak3rYkRR0Nhu4lFUT2VDnQSxBe8Hbl7f36358p6ow8Bnvr8lrLt98H8J1aGxfhbX4Fs5tYg2+FTwr5Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"bun": ">=1.0.0",
|
||||
"deno": ">=1.30.0",
|
||||
"node": ">=8.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wellwelwel"
|
||||
}
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-1.1.0.tgz",
|
||||
"integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
|
||||
"integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.54.0",
|
||||
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.54.0.tgz",
|
||||
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-3.0.1.tgz",
|
||||
"integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "^1.54.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mysql2": {
|
||||
"version": "3.15.3",
|
||||
"resolved": "https://registry.npmmirror.com/mysql2/-/mysql2-3.15.3.tgz",
|
||||
"integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"aws-ssl-profiles": "^1.1.1",
|
||||
"denque": "^2.1.0",
|
||||
"generate-function": "^2.3.1",
|
||||
"iconv-lite": "^0.7.0",
|
||||
"long": "^5.2.1",
|
||||
"lru.min": "^1.0.0",
|
||||
"named-placeholders": "^1.1.3",
|
||||
"seq-queue": "^0.0.5",
|
||||
"sqlstring": "^2.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/named-placeholders": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/named-placeholders/-/named-placeholders-1.1.3.tgz",
|
||||
"integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lru-cache": "^7.14.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-1.0.0.tgz",
|
||||
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
|
||||
"integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-3.0.1.tgz",
|
||||
"integrity": "sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "3.1.2",
|
||||
"http-errors": "2.0.0",
|
||||
"iconv-lite": "0.7.0",
|
||||
"unpipe": "1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/router/-/router-2.2.0.tgz",
|
||||
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"is-promise": "^4.0.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"path-to-regexp": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/send/-/send-1.2.0.tgz",
|
||||
"integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.5",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"mime-types": "^3.0.1",
|
||||
"ms": "^2.1.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"range-parser": "^1.2.1",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/seq-queue": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmmirror.com/seq-queue/-/seq-queue-0.0.5.tgz",
|
||||
"integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q=="
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-2.2.0.tgz",
|
||||
"integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"parseurl": "^1.3.3",
|
||||
"send": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-list": "^1.0.0",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlstring": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmmirror.com/sqlstring/-/sqlstring-2.3.3.tgz",
|
||||
"integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/type-is": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/type-is/-/type-is-2.0.1.tgz",
|
||||
"integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"content-type": "^1.0.5",
|
||||
"media-typer": "^1.1.0",
|
||||
"mime-types": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
}
|
||||
20
nodejs/nodeExperiment5/package.json
Normal file
20
nodejs/nodeExperiment5/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "nodeexperiment5",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"dev": "nodemon index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cors": "^2.8.5",
|
||||
"express": "^5.1.0",
|
||||
"mysql2": "^3.15.3"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
28
nodejs/nodeExperiment5/public/login.ejs
Normal file
28
nodejs/nodeExperiment5/public/login.ejs
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>登录</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>用户登录</h1>
|
||||
|
||||
<form action="/login" method="POST">
|
||||
<div>
|
||||
<label for="username">用户名:</label>
|
||||
<input type="text" id="username" name="username" required>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="password">密码:</label>
|
||||
<input type="password" id="password" name="password" required>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit">登录</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
53
nodejs/nodeExperiment5/public/register.ejs
Normal file
53
nodejs/nodeExperiment5/public/register.ejs
Normal file
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>注册</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>注册</h1>
|
||||
<form action="/register" method="post">
|
||||
<label for="username">用户名:</label>
|
||||
<input type="text" id="username" name="username" required><br><br>
|
||||
|
||||
<label for="password">密码:</label>
|
||||
<input type="password" id="password" name="password" required><br><br>
|
||||
|
||||
<label for="email">邮箱:</label>
|
||||
<input type="email" id="email" name="email" required><br><br>
|
||||
|
||||
<label for="gender">性别:</label>
|
||||
<input type="radio" id="male" name="gender" value="male" required>
|
||||
<label for="male">男</label>
|
||||
<input type="radio" id="female" name="gender" value="female" required>
|
||||
<label for="female">女</label><br><br>
|
||||
|
||||
<label for="hobbies">爱好:</label>
|
||||
<input type="checkbox" id="hobby1" name="hobbies" value="reading">
|
||||
<label for="hobby1">阅读</label>
|
||||
<input type="checkbox" id="hobby2" name="hobbies" value="music">
|
||||
<label for="hobby2">音乐</label>
|
||||
<input type="checkbox" id="hobby3" name="hobbies" value="sports">
|
||||
<label for="hobby3">运动</label><br><br>
|
||||
|
||||
<label for="city">城市:</label>
|
||||
<select id="city" name="city" required>
|
||||
<option value="">请选择城市</option>
|
||||
<option value="beijing">北京</option>
|
||||
<option value="shanghai">上海</option>
|
||||
<option value="guangzhou">广州</option>
|
||||
<option value="shenzhen">深圳</option>
|
||||
</select><br><br>
|
||||
|
||||
<label for="description">个人描述:</label><br>
|
||||
<textarea id="description" name="description" rows="4" cols="50"></textarea><br><br>
|
||||
|
||||
<button type="submit">注册</button>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
24
nodejs/nodeExperiment5/public/update.ejs
Normal file
24
nodejs/nodeExperiment5/public/update.ejs
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>修改</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 修改密码 -->
|
||||
<form action="/update-password" method="post">
|
||||
<label for="username">用户名:</label>
|
||||
<input type="text" name="username" id="username" required>
|
||||
<label for="currentPassword">旧密码:</label>
|
||||
<input type="password" name="currentPassword" id="currentPassword" required>
|
||||
<label for="newPassword">新密码:</label>
|
||||
<input type="password" name="newPassword" id="newPassword" required>
|
||||
<button type="submit">修改</button>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
36
nodejs/nodeExperiment6/.gitignore
vendored
Normal file
36
nodejs/nodeExperiment6/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
65
nodejs/nodeExperiment6/index.js
Normal file
65
nodejs/nodeExperiment6/index.js
Normal file
@@ -0,0 +1,65 @@
|
||||
const express = require('express');
|
||||
const session = require('express-session');
|
||||
const bodyParser = require('body-parser');
|
||||
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
|
||||
// 设置中间件
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(bodyParser.json());
|
||||
|
||||
// 配置 session 中间件
|
||||
app.use(session({
|
||||
secret: 'hello kitty',
|
||||
resave: false,
|
||||
saveUninitialized: true,
|
||||
cookie: { secure: false } // 在生产环境中设置为 true
|
||||
}));
|
||||
|
||||
|
||||
// 创建登录接口
|
||||
app.post('/login', (req, res) => {
|
||||
const { username, password } = req.body;
|
||||
|
||||
if (username === 'admin' && password === '123456') {
|
||||
req.session.user = { id: 1, username };
|
||||
res.send('User logged in');
|
||||
} else {
|
||||
res.status(401).send('Invalid credentials');
|
||||
}
|
||||
});
|
||||
|
||||
// 创建注销接口
|
||||
app.post('/logout', (req, res) => {
|
||||
req.session.destroy((err) => {
|
||||
if (err) {
|
||||
return res.status(500).send('Could not log out.');
|
||||
}
|
||||
res.send('Logout successful');
|
||||
});
|
||||
});
|
||||
|
||||
// 认证中间件
|
||||
function isAuthenticated(req, res, next) {
|
||||
if (req.session.user) {
|
||||
next();
|
||||
} else {
|
||||
res.status(401).send('You are not authenticated!');
|
||||
}
|
||||
}
|
||||
|
||||
// 创建保护路由
|
||||
app.get('/protected', isAuthenticated, (req, res) => {
|
||||
res.send('This is a protected route');
|
||||
});
|
||||
|
||||
// 实现基于 Session 的身份认证机制
|
||||
app.get('/profile', isAuthenticated, (req, res) => {
|
||||
res.send(`Welcome ${req.session.user.username}`);
|
||||
});
|
||||
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is running on http://localhost:${port}`);
|
||||
});
|
||||
57
nodejs/nodeExperiment6/index2.js
Normal file
57
nodejs/nodeExperiment6/index2.js
Normal file
@@ -0,0 +1,57 @@
|
||||
const express = require('express');
|
||||
const bodyParser = require('body-parser');
|
||||
const jwt = require('jsonwebtoken');
|
||||
|
||||
const app = express();
|
||||
const port = 3001;
|
||||
app.use(bodyParser.json());
|
||||
|
||||
// 配置 JWT 相关函数
|
||||
function generateToken(user) {
|
||||
// 生成 JWT 令牌
|
||||
// - { user }: 包含用户信息的对象
|
||||
// - 'hello kitty': 签名密钥,用于确保 JWT 的完整性
|
||||
return jwt.sign({ user }, 'hello kitty', { expiresIn: '1h' });
|
||||
}
|
||||
|
||||
// 验证 JWT 令牌
|
||||
function authenticateToken(req, res, next) {
|
||||
const authHeader = req.headers['authorization'];// 从请求头中获取 Authorization 字段
|
||||
const token = authHeader && authHeader.split(' ')[1];// 从 Authorization 字段中提取 JWT 令牌
|
||||
|
||||
if (token == null) return res.sendStatus(401);
|
||||
|
||||
jwt.verify(token, 'hello kitty', (err, user) => {// 验证 JWT 令牌
|
||||
if (err) return res.sendStatus(403);
|
||||
req.user = user;
|
||||
next();
|
||||
});
|
||||
}
|
||||
|
||||
// 实现用户登录接口(JWT)
|
||||
app.post('/jwt-login', (req, res) => {
|
||||
const { username, password } = req.body;// 从请求体中提取用户名和密码
|
||||
|
||||
if (username === 'admin' && password === '123456') {
|
||||
const user = { id: 1, username };
|
||||
const accessToken = generateToken(user);// 生成 JWT 令牌
|
||||
res.json({ accessToken });// 返回包含 JWT 令牌的 JSON 响应
|
||||
} else {
|
||||
res.status(401).send('Invalid credentials');
|
||||
}
|
||||
});
|
||||
|
||||
// 实现用户注销接口(JWT)
|
||||
app.post('/jwt-logout', (req, res) => {
|
||||
res.send('Logged out successfully');
|
||||
// 注意:JWT 本身没有会话管理,客户端需要删除存储的 JWT 令牌
|
||||
});
|
||||
|
||||
// 创建保护路由,仅允许已认证用户访问(JWT)
|
||||
app.get('/jwt-profile', authenticateToken, (req, res) => {
|
||||
// 使用 authenticateToken 中间件验证 JWT 令牌
|
||||
res.send(`Welcome ${req.user.user.username}`);
|
||||
});
|
||||
|
||||
|
||||
app.listen(port, () => console.log(`JWT Server running on http://localhost:${port}`));
|
||||
1019
nodejs/nodeExperiment6/package-lock.json
generated
Normal file
1019
nodejs/nodeExperiment6/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
20
nodejs/nodeExperiment6/package.json
Normal file
20
nodejs/nodeExperiment6/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "nodeexperiment6",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"dev": "nodemon index.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.1",
|
||||
"express": "^5.1.0",
|
||||
"express-session": "^1.18.2",
|
||||
"jsonwebtoken": "^9.0.2"
|
||||
}
|
||||
}
|
||||
36
nodejs/nodeExperiment7/.gitignore
vendored
Normal file
36
nodejs/nodeExperiment7/.gitignore
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
||||
.eslintcache
|
||||
|
||||
# Cypress
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Vitest
|
||||
__screenshots__/
|
||||
1
nodejs/nodeExperiment7/example.html
Normal file
1
nodejs/nodeExperiment7/example.html
Normal file
@@ -0,0 +1 @@
|
||||
<html><body>Hello World</body></html>
|
||||
11
nodejs/nodeExperiment7/index.js
Normal file
11
nodejs/nodeExperiment7/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
console.log('开始');
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('Timeout');
|
||||
}, 0);
|
||||
|
||||
setImmediate(() => {
|
||||
console.log('Immediate');
|
||||
});
|
||||
|
||||
console.log('结束');
|
||||
26
nodejs/nodeExperiment7/index2.js
Normal file
26
nodejs/nodeExperiment7/index2.js
Normal file
@@ -0,0 +1,26 @@
|
||||
console.log('Start');
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('Timeout1');
|
||||
}, 1000);
|
||||
|
||||
let a = 1;
|
||||
|
||||
const intervalId = setInterval(() => {
|
||||
console.log('Interval:', a++);
|
||||
|
||||
if (a > 3) {
|
||||
clearInterval(intervalId);
|
||||
console.log('Interval cleared');
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('Timeout2');
|
||||
}, 1000);
|
||||
|
||||
setImmediate(() => {
|
||||
console.log('Immediate');
|
||||
});
|
||||
|
||||
console.log('End');
|
||||
33
nodejs/nodeExperiment7/index3.js
Normal file
33
nodejs/nodeExperiment7/index3.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
console.log('Start');
|
||||
|
||||
const filePath = path.join(__dirname, 'example.html');
|
||||
if (!fs.existsSync(filePath)) {
|
||||
fs.writeFileSync(filePath, '<html><body>Hello World</body></html>', 'utf8');
|
||||
}
|
||||
|
||||
fs.readFile(filePath, 'utf8', (err, data) => {
|
||||
console.log('File data read');
|
||||
|
||||
if (err) {
|
||||
console.log(__dirname);
|
||||
console.log(err.message);
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('Timeout');
|
||||
}, 0);
|
||||
|
||||
setImmediate(() => {
|
||||
console.log('Immediate');
|
||||
});
|
||||
|
||||
process.nextTick(() => {
|
||||
console.log('Next Tick');
|
||||
});
|
||||
});
|
||||
|
||||
console.log('End');
|
||||
19
nodejs/nodeExperiment7/index4.js
Normal file
19
nodejs/nodeExperiment7/index4.js
Normal file
@@ -0,0 +1,19 @@
|
||||
console.log('Start');
|
||||
|
||||
setTimeout(() => {
|
||||
console.log('Timeout');
|
||||
}, 0);
|
||||
|
||||
setImmediate(() => {
|
||||
console.log('Immediate');
|
||||
});
|
||||
|
||||
process.nextTick(() => {
|
||||
console.log('Next Tick 1');
|
||||
});
|
||||
|
||||
process.nextTick(() => {
|
||||
console.log('Next Tick 2');
|
||||
});
|
||||
|
||||
console.log('End');
|
||||
12
nodejs/nodeExperiment7/package.json
Normal file
12
nodejs/nodeExperiment7/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "nodeexperiment7",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
BIN
web_test/images/bg1.jpg
Normal file
BIN
web_test/images/bg1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 133 KiB |
BIN
web_test/images/libai.png
Normal file
BIN
web_test/images/libai.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
BIN
web_test/images/relax.png
Normal file
BIN
web_test/images/relax.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 594 KiB |
93
web_test/test1/plan.html
Normal file
93
web_test/test1/plan.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>我的学习计划</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: "微软雅黑", "Microsoft YaHei", sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
line-height: 1.6;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.section {
|
||||
background-color: white;
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||
}
|
||||
h2 {
|
||||
color: #3498db;
|
||||
border-left: 4px solid #3498db;
|
||||
padding-left: 10px;
|
||||
}
|
||||
ol, ul {
|
||||
margin-left: 20px;
|
||||
}
|
||||
li {
|
||||
margin: 10px 0;
|
||||
}
|
||||
a {
|
||||
color: #e74c3c;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.copyright {
|
||||
text-align: center;
|
||||
margin: 30px 0;
|
||||
color: #7f8c8d;
|
||||
}
|
||||
.rest-img {
|
||||
text-align: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.rest-img img {
|
||||
max-width: 300px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>我的待办事项与学习资源</h1>
|
||||
|
||||
<div class="section">
|
||||
<h2>本周学习计划(周一至周三)</h2>
|
||||
<ol>
|
||||
<li>周一:学习HTML基础标签和语法</li>
|
||||
<li>周二:练习CSS基础样式和布局</li>
|
||||
<li>周三:完成第一次实验作业并复习</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>学习资源网站(周四至周六)</h2>
|
||||
<ul>
|
||||
<li><a href="https://www.w3schools.com" target="_blank">W3Schools在线教程</a></li>
|
||||
<li><a href="https://developer.mozilla.org" target="_blank">MDN Web文档</a></li>
|
||||
<li><a href="https://www.runoob.com" target="_blank">菜鸟教程</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="copyright">
|
||||
<p>版权所有 © [施光甲]</p>
|
||||
</div>
|
||||
|
||||
<div class="rest-img">
|
||||
<!-- 这里使用一个在线图片作为示例,实际使用时请替换为本地图片 -->
|
||||
<img src="..\images\relax.png" alt="周日休息图片">
|
||||
<p><em>周日:休息放松,为下一周做好准备</em></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
59
web_test/test1/poem.html
Normal file
59
web_test/test1/poem.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: "宋体", SimSun, serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
p {
|
||||
text-indent: 2em;
|
||||
}
|
||||
h2 {
|
||||
text-align: center;
|
||||
}
|
||||
.poem {
|
||||
text-align: center;
|
||||
margin: 30px 0;
|
||||
font-size: 18px;
|
||||
line-height: 2;
|
||||
}
|
||||
hr {
|
||||
border: 1px solid #ccc;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>李白《静夜思》赏析</h1>
|
||||
<p>《静夜思》是唐代诗人李白的经典诗作,它短小精悍,却蕴含着深深的思乡之情。</p>
|
||||
|
||||
<h2>原诗内容</h2>
|
||||
|
||||
<div class="poem">
|
||||
<p><strong>床前</strong>明月光,</p>
|
||||
<p>疑是地上霜。</p>
|
||||
<p>举头<sup>①</sup>望明月,</p>
|
||||
<p><em>低头思故乡</em>。</p>
|
||||
</div>
|
||||
|
||||
<p>在诗中,“床前”这个词被加粗(床前),起到了一定的强调作用,让读者首先注意到诗人所处的位置。<br>
|
||||
而“疑是地上霜”这句诗,通过“霜”这个字形象地描绘出月光的皎洁清冷,仿佛地上结了一层霜,这种感觉通过简单的文字就传达给了读者。<br>
|
||||
当诗人“举头<sup>①</sup>望明月”时,这里的上标数字<sup>①</sup>可以用来做注释标记,表示对“举头”这个动作可能存在的特殊解读或者引用来源等,明月成为了引发思乡之情的重要媒介。<br>
|
||||
最后“低头思故乡”,诗人<em>深沉地(用em标签表示情感上的强调)</em>陷入对故乡的思念之中。</p>
|
||||
<hr>
|
||||
<p>这首诗虽然没有华丽的辞藻,但每一个字都像是经过精心雕琢,<strong>强烈地(用strong标签表示语义上的强调)</strong>触动着读者内心深处的思乡情感,成为了千古流传的佳作。</p>
|
||||
</body>
|
||||
</html>
|
||||
68
web_test/test2/attri_practice.html
Normal file
68
web_test/test2/attri_practice.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>CSS属性练习</title>
|
||||
<style>
|
||||
/* (3) 使用标记选择器将p标签中的字体颜色设置为#cc0000,字体大小为32px */
|
||||
p {
|
||||
color: #cc0000;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
/* (4) 使用id选择器将p标签的背景颜色设置为gray */
|
||||
#paragraph {
|
||||
background-color: gray;
|
||||
}
|
||||
|
||||
/* (5) 使用类选择器将p标签中内容的对齐方式设置为水平居中对齐,字体样式为斜体,字体用宋体 */
|
||||
.center {
|
||||
text-align: center;
|
||||
font-style: italic;
|
||||
font-family: "SimSun", "宋体", serif;
|
||||
}
|
||||
|
||||
/* (6) 使用伪类选择器,取消a标签的下划线 */
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* 注意:伪类选择器的顺序很重要,必须按照LVHA顺序 */
|
||||
/* a标记未被访问时,字体颜色为gray */
|
||||
a:link {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
/* a标记在被访问后,字体颜色为#9900ff */
|
||||
a:visited {
|
||||
color: #9900ff;
|
||||
}
|
||||
|
||||
/* 鼠标悬停在a标记上时,字体颜色为red,字体大小为24px */
|
||||
a:hover {
|
||||
color: red;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
/* a标记在被用户激活时,字体颜色为rgb(0, 204, 0) */
|
||||
a:active {
|
||||
color: rgb(0, 204, 0);
|
||||
}
|
||||
|
||||
/* (7) 选取带有title属性的标记,并设置字体粗细为bold */
|
||||
[title] {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- (1) 为p标签添加title属性,属性值为tit -->
|
||||
<p id="paragraph" class="center" title="tit">一个段落</p>
|
||||
|
||||
<!-- (2) 实现a标签点击跳转到菜鸟教程的功能,要求在一个全新的空白窗口打开链接 -->
|
||||
<a href="https://www.runoob.com" target="_blank">点击跳转到菜鸟教程</a>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
27
web_test/test2/news.html
Normal file
27
web_test/test2/news.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>新闻</title>
|
||||
<style>
|
||||
p {
|
||||
letter-spacing: 6px;
|
||||
/* 字符间距 */
|
||||
line-height: 2em;
|
||||
/* 行高 */
|
||||
text-indent: 2em;
|
||||
/* 首行缩进 */
|
||||
word-spacing: 10px;
|
||||
/* 单词间距 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>昨天上午,南京国际博览中心金陵会议中心内欢声笑语,春意盎然,省委、省政府在这里举行春节团拜会。 Yesterday morning, the Jinling Conference Center of Nanjing
|
||||
International Expo Center was filled with laughter and joy, and the provincial party committee and government
|
||||
held a Spring Festival gathering here.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
48
web_test/test2/product.html
Normal file
48
web_test/test2/product.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>产品介绍</title>
|
||||
<style>
|
||||
/* 使用标记选择器为介绍重庆的段落设置样式 */
|
||||
p.chongqing {
|
||||
text-decoration: underline;
|
||||
/* 下划线 */
|
||||
text-transform: capitalize;
|
||||
/* 首字母大写 */
|
||||
}
|
||||
|
||||
/* 使用id选择器为介绍四川的段落设置样式 */
|
||||
#sichuan {
|
||||
text-decoration: line-through;
|
||||
/* 删除线 */
|
||||
text-transform: lowercase;
|
||||
/* 所有字母小写 */
|
||||
}
|
||||
|
||||
/* 使用类选择器为介绍贵州的段落设置样式 */
|
||||
.guizhou {
|
||||
text-decoration: overline;
|
||||
/* 上划线 */
|
||||
text-transform: uppercase;
|
||||
/* 所有字母大写 */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>设置文字装饰及大小写转换</h3>
|
||||
|
||||
<p class="chongqing">Chongqing, abbreviated as "Yu", is a municipality directly under the central and western
|
||||
regions of China, famous for its mountainous city characteristics, hotpot culture, and the beautiful scenery of
|
||||
the confluence of the Yangtze River and Jialing River.</p>
|
||||
|
||||
<p id="sichuan">Sichuan, abbreviated as "Chuan" or "Shu", is located in southwestern China and is a province known
|
||||
for its magnificent natural scenery, rich cultural heritage, and spicy cuisine.</p>
|
||||
|
||||
<p class="guizhou">Guizhou, abbreviated as "Qian" or "Gui", is located in southwestern China and is a province
|
||||
renowned for its diverse ethnic cultures, spectacular karst landforms, and beautiful natural landscapes.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
92
web_test/test3/table.html
Normal file
92
web_test/test3/table.html
Normal file
@@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>简易学生表</title>
|
||||
<link rel="stylesheet" href="tableTitle.css">
|
||||
<style>
|
||||
.tou {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.shou {
|
||||
|
||||
background-color: yellowgreen;
|
||||
|
||||
}
|
||||
|
||||
.odd {
|
||||
|
||||
background-color: #CDF8F9;
|
||||
|
||||
}
|
||||
|
||||
.even {
|
||||
|
||||
background-color: #FDEFBB;
|
||||
|
||||
}
|
||||
|
||||
|
||||
td,
|
||||
th {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table border="1" width="600" height="400" align="center" cellspacing="0" cellpadding="5"
|
||||
style="border-collapse: collapse;">
|
||||
<caption>简易学生表</caption>
|
||||
|
||||
<!-- 表头行:姓名、单位、学号 -->
|
||||
<tr class="tou">
|
||||
<td></td>
|
||||
<th>姓名</th>
|
||||
<th>单位</th>
|
||||
<th>学号</th>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行1:基数行,背景色#CDF8F9(由伪类控制) -->
|
||||
<tr class="odd">
|
||||
<td rowspan="4" class="shou">2024-2025学年</td>
|
||||
<td>王小品</td>
|
||||
<td>商学院</td>
|
||||
<td>110204</td>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行2:偶数行,背景色#FDEFBB(由伪类控制) -->
|
||||
<tr class="even">
|
||||
<td>李中</td>
|
||||
<td>财经学院</td>
|
||||
<td>120204</td>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行3:基数行,含跨行单元格(rowspan="2") -->
|
||||
<tr class="odd">
|
||||
<!-- 跨行单元格:“2024-2025学年”跨2行,对应实验“单元格跨行”要求 -->
|
||||
|
||||
<td>胡三</td>
|
||||
<td>大数据学院</td>
|
||||
<td>130504</td>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行4:偶数行,因上一行有跨行单元格,本行少1个td -->
|
||||
<tr class="even">
|
||||
<td>李白</td>
|
||||
<td>人工智能学院</td>
|
||||
<td>100244</td>
|
||||
</tr>
|
||||
|
||||
<!-- 数据行5:含跨列单元格(colspan="3"),对应实验“单元格跨列”要求 -->
|
||||
<tr>
|
||||
<!-- 跨列单元格:“重庆城市科技学院”跨3列 -->
|
||||
<td colspan="4">重庆城市科技学院</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
13
web_test/test3/tableTitle.css
Normal file
13
web_test/test3/tableTitle.css
Normal file
@@ -0,0 +1,13 @@
|
||||
/* 表格标题(caption)样式定义,对应实验要求的标题样式 */
|
||||
caption {
|
||||
/* 标题字体粗细为bold */
|
||||
font-weight: bold;
|
||||
/* 标题字体大小为24px */
|
||||
font-size: 24px;
|
||||
/* 标题字体颜色为#0DAEB4 */
|
||||
color: #0DAEB4;
|
||||
/* 标题背景颜色为bisque */
|
||||
background-color: bisque;
|
||||
/* 标题行高为36px */
|
||||
line-height: 36px;
|
||||
}
|
||||
51
web_test/test4/index.html
Normal file
51
web_test/test4/index.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>主页</title>
|
||||
<link rel="stylesheet" href="./public/mainMenu.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ul class="main-menu">
|
||||
<li><a href="#">菜单1</a>
|
||||
|
||||
<ul class="sub-menu">
|
||||
<li><a href="#">菜单1-1</a></li>
|
||||
<li><a href="#">菜单1-2</a></li>
|
||||
<li><a href="#">菜单1-3</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">菜单2</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a href="#">菜单2-1</a></li>
|
||||
<li><a href="#">菜单2-2</a></li>
|
||||
<li><a href="#">菜单2-3</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">菜单3</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a href="#">菜单3-1</a></li>
|
||||
<li><a href="#">菜单3-2</a></li>
|
||||
<li><a href="#">菜单3-3</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div></div>
|
||||
</body>
|
||||
|
||||
|
||||
<body>
|
||||
<ul class="main-menu">
|
||||
<li><a href="#">菜单1</a><ul class="sub-menu"><li><a href="#">菜单1-1</a></li><li><a href="#">菜单1-2</a></li><li><a href="#">菜单1-3</a></li></ul></li>
|
||||
<li><a href="#">菜单2</a><ul class="sub-menu"><li><a href="#">菜单2-1</a></li><li><a href="#">菜单2-2</a></li><li><a href="#">菜单2-3</a></li></ul></li>
|
||||
<li><a href="#">菜单3</a><ul class="sub-menu"><li><a href="#">菜单3-1</a></li><li><a href="#">菜单3-2</a></li><li><a href="#">菜单3-3</a></li></ul></li>
|
||||
</ul>
|
||||
<div></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
49
web_test/test4/public/mainMenu.css
Normal file
49
web_test/test4/public/mainMenu.css
Normal file
@@ -0,0 +1,49 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 24px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
ul li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
ul>li:hover .sub-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.main-menu li {
|
||||
background-color: #c22fef;
|
||||
color: aliceblue;
|
||||
border-radius: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.main-menu>li {
|
||||
width: 200px;
|
||||
border: 1px solid #77049a;
|
||||
margin: 1px 3px;
|
||||
|
||||
}
|
||||
|
||||
li:hover {
|
||||
background-color: #a93aca;
|
||||
}
|
||||
|
||||
div {
|
||||
border: 20px solid red;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
display: inline-block;
|
||||
}
|
||||
60
web_test/test5/index.html
Normal file
60
web_test/test5/index.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="./public/index.css">
|
||||
<link rel="stylesheet" href="./public/mainMenu.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 页面容器 -->
|
||||
<div class="container">
|
||||
<header>
|
||||
标题栏
|
||||
</header>
|
||||
<main class="clearfiexd">
|
||||
<nav>
|
||||
<ul class="main-menu">
|
||||
<li><a href="#">菜单1</a>
|
||||
|
||||
<ul class="sub-menu">
|
||||
<li><a href="#">菜单1-1</a></li>
|
||||
<li><a href="#">菜单1-2</a></li>
|
||||
<li><a href="#">菜单1-3</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">菜单2</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a href="#">菜单2-1</a></li>
|
||||
<li><a href="#">菜单2-2</a></li>
|
||||
<li><a href="#">菜单2-3</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">菜单3</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a href="#">菜单3-1</a></li>
|
||||
<li><a href="#">菜单3-2</a></li>
|
||||
<li><a href="#">菜单3-3</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="content">
|
||||
<img src="../images/libai.png" alt="图片">
|
||||
<div style="font-size: 0;">
|
||||
<button>图片详情1</button>
|
||||
<button>图片详情2</button>
|
||||
<button>图片详情3</button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer>© 2025 FlexLayout 示例. 保留所有权利.</footer>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
62
web_test/test5/public/index.css
Normal file
62
web_test/test5/public/index.css
Normal file
@@ -0,0 +1,62 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
header {
|
||||
background-color: #9a9bb4;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
main {
|
||||
background-color: blue;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
main nav {
|
||||
background-color: #9a9bb4;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.content {
|
||||
background-color: #e8d5d5;
|
||||
/* width: 500px; */
|
||||
margin-left: auto;
|
||||
text-align: center;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
.clearfiexd::after {
|
||||
content: "";
|
||||
height: 0;
|
||||
display: block;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.content img {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.content button {
|
||||
margin-top: 20px;
|
||||
margin-right: 20px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
}
|
||||
49
web_test/test5/public/mainMenu.css
Normal file
49
web_test/test5/public/mainMenu.css
Normal file
@@ -0,0 +1,49 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 24px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
ul li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
ul>li:hover .sub-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.main-menu li {
|
||||
background-color: #c22fef;
|
||||
color: aliceblue;
|
||||
border-radius: 2px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.main-menu>li {
|
||||
width: 200px;
|
||||
border: 1px solid #77049a;
|
||||
margin: 1px 3px;
|
||||
|
||||
}
|
||||
|
||||
li:hover {
|
||||
background-color: #a93aca;
|
||||
}
|
||||
|
||||
/* div {
|
||||
border: 20px solid red;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
display: inline-block;
|
||||
} */
|
||||
67
web_test/test6/login.css
Normal file
67
web_test/test6/login.css
Normal file
@@ -0,0 +1,67 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100vh;
|
||||
background-image: url('../images/bg1.jpg');
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form-container {
|
||||
width: 400px;
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form div {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.user-type-label {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
38
web_test/test6/login.html
Normal file
38
web_test/test6/login.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>登录</title>
|
||||
<link rel="stylesheet" href="./login.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 登录 -->
|
||||
<div class="form-container">
|
||||
<h2>欢迎登陆</h2>
|
||||
<form class="form">
|
||||
<div>
|
||||
<label for="username">用户名:</label>
|
||||
<input type="text" name="username" placeholder="请输入用户名" required><br>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password">密码:</label>
|
||||
<input type="password" name="password" placeholder="请输入密码" required><br>
|
||||
</div>
|
||||
<div>
|
||||
<label class="user-type-label">用户类型:</label>
|
||||
<input type="radio" name="userType" value="1" checked>普通用户
|
||||
<input type="radio" name="userType" value="2">管理员
|
||||
</div>
|
||||
<div>
|
||||
记住我<input type="checkbox" name="rememberMe">
|
||||
</div>
|
||||
<button type="submit"><a href="../test5/index.html">登录</a></button>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
67
web_test/test6/register.css
Normal file
67
web_test/test6/register.css
Normal file
@@ -0,0 +1,67 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100vh;
|
||||
background-image: url('../images/bg1.jpg');
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form-container {
|
||||
width: 400px;
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
padding: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form div {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.user-type-label {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
38
web_test/test6/register.html
Normal file
38
web_test/test6/register.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>注册</title>
|
||||
<link rel="stylesheet" href="./register.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="form-container">
|
||||
<h2>注册</h2>
|
||||
<form class="form">
|
||||
<div>
|
||||
<label for="username">用户名:</label>
|
||||
<input type="text" name="username" placeholder="请输入用户名" required><br>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password">密码:</label>
|
||||
<input type="password" name="password" placeholder="请输入密码" required><br>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password">密码:</label>
|
||||
<input type="password" name="password" placeholder="请再次输入密码" required><br>
|
||||
</div>
|
||||
<div>
|
||||
<label class="user-type-label">用户类型:</label>
|
||||
<input type="radio" name="userType" value="1" checked>普通用户
|
||||
<input type="radio" name="userType" value="2">管理员
|
||||
</div>
|
||||
<button type="submit"><a href="../test5/index.html">注册</a></button>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
131
web_test/test7/index.html
Normal file
131
web_test/test7/index.html
Normal file
@@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
// 1、字符串操作
|
||||
// let str1 = "1203def456";
|
||||
|
||||
// let num1 = parseInt(str1);
|
||||
// console.log("num1的值为:", num1);
|
||||
|
||||
// console.log("num1的数据类型:", typeof num1);
|
||||
|
||||
// let str2 = num1.toString();
|
||||
// console.log("str2的值为:", str2);
|
||||
|
||||
// console.log("str2中的字符'0':", str2.charAt(1));
|
||||
|
||||
// 2、矩形面积计算函数
|
||||
// function calculateArea(width, height) {
|
||||
// let area = width * height;
|
||||
// return area;
|
||||
// }
|
||||
|
||||
// let scaleFactor = 2;
|
||||
|
||||
// let width = 5;
|
||||
// let height = 3;
|
||||
// let area = calculateArea(width * scaleFactor, height * scaleFactor);
|
||||
// console.log("计算后的面积为:", area);
|
||||
|
||||
|
||||
// 3、 使用for循环计算1+2+3+4+5的和
|
||||
// let sum = 0;
|
||||
// for (let i = 1; i <= 5; i++) {
|
||||
// sum += i;
|
||||
// }
|
||||
// console.log("1+2+3+4+5的和为:", sum);
|
||||
|
||||
// 4. 通过提示框输入整数并判断奇偶
|
||||
// let inputNum = prompt("请输入一个整数:");
|
||||
// let result = (inputNum % 2 === 0) ? "该数是偶数" : "该数是奇数";
|
||||
// alert(result);
|
||||
|
||||
// 5、操作数组
|
||||
// 5.1 向arr1添加元素后
|
||||
// 5.2 删除arr2最后一个元素后
|
||||
// 5.3 删除arr3第一个元素后
|
||||
// 5.4 在arr4开头添加元素后
|
||||
// 5.5 数组转字符串
|
||||
// 5.5 字符串转数组
|
||||
// 5.6 拼接后的数组
|
||||
// let arr1 = [1, 2, 3];
|
||||
// let newLength1 = arr1.push(4);
|
||||
// console.log("5.1 向arr1添加元素后:", arr1, "新长度:", newLength1);
|
||||
|
||||
// let arr2 = ['apple', 'banana', 'orange'];
|
||||
// let removedElement2 = arr2.pop();
|
||||
// console.log("5.2 删除arr2最后一个元素后:", arr2, "被删除的元素:", removedElement2);
|
||||
|
||||
// let arr3 = [1, 2, 3];
|
||||
// let removedElement3 = arr3.shift();
|
||||
// console.log("5.3 删除arr3第一个元素后:", arr3, "被删除的元素:", removedElement3);
|
||||
|
||||
// let arr4 = [1, 2, 3];
|
||||
// let newLength4 = arr4.unshift(0);
|
||||
// console.log("5.4 在arr4开头添加元素后:", arr4, "新长度:", newLength4);
|
||||
|
||||
// let arr5 = [1, 2, 3, 4];
|
||||
// let strFromArr = arr5.join('-');
|
||||
// let arrFromStr = strFromArr.split('-');
|
||||
// console.log("5.5 数组转字符串:", strFromArr);
|
||||
// console.log("5.5 字符串转数组:", arrFromStr);
|
||||
|
||||
// let arr6 = ['A', 'B', "C"];
|
||||
// let arr7 = [true, false];
|
||||
// let concatenatedArr = arr6.concat(arr7);
|
||||
// console.log("5.6 拼接后的数组:", concatenatedArr);
|
||||
|
||||
// 6. 使用for循环循环打印fruits数组的元素
|
||||
// let fruits = ["apple", "banana", "cherry"];
|
||||
// console.log("6. fruits数组元素:");
|
||||
// for (let i = 0; i < fruits.length; i++) {
|
||||
// console.log(fruits[i]);
|
||||
// }
|
||||
|
||||
// 7. 使用for...in循环遍历对象的属性
|
||||
// let person = {
|
||||
// name: "John",
|
||||
// age: 30,
|
||||
// city: "New York"
|
||||
// };
|
||||
|
||||
// console.log("7. 遍历person对象:");
|
||||
// for (let key in person) {
|
||||
// console.log("属性名:", key, "属性值:", person[key]);
|
||||
// }
|
||||
|
||||
// 8. 获得当前日期并格式化
|
||||
function getCurrentDateFormatted() {
|
||||
let now = new Date();
|
||||
|
||||
// 获取年、月、日、时、分、秒
|
||||
let year = now.getFullYear();
|
||||
let month = String(now.getMonth() + 1).padStart(2, '0');
|
||||
let day = String(now.getDate()).padStart(2, '0');
|
||||
let hours = String(now.getHours()).padStart(2, '0');
|
||||
let minutes = String(now.getMinutes()).padStart(2, '0');
|
||||
let seconds = String(now.getSeconds()).padStart(2, '0');
|
||||
|
||||
// 格式化日期字符串
|
||||
let formattedDate = `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
// 在控制台输出
|
||||
let currentDate = getCurrentDateFormatted();
|
||||
console.log("8. 当前日期:", currentDate);
|
||||
|
||||
// 在页面上显示
|
||||
document.body.innerHTML += `<p>当前时间: ${currentDate}</p>`;
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user