Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Aug 27, 2024
1 parent 891a346 commit 78d63d1
Show file tree
Hide file tree
Showing 11 changed files with 453 additions and 207 deletions.
26 changes: 2 additions & 24 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,7 @@ app.all("*", function (req, res, next) {
res.locals["is_admin"] = 1;
}
//console.log("JWT验证成功: " + userInfo.email);
console.log(
"调试用户信息(session):" +
res.locals.userid +
"," +
res.locals.email +
"," +
res.locals.username +
"," +
res.locals.display_name +
"," +
res.locals.is_admin
);
//console.log( "调试用户信息(session):" + res.locals.userid + "," + res.locals.email + "," + res.locals.username + "," + res.locals.display_name + "," + res.locals.is_admin );

res.locals = {
login: true,
Expand All @@ -168,18 +157,7 @@ app.all("*", function (req, res, next) {
is_admin: res.locals["is_admin"],
};

console.log(
"调试用户信息(locals ):" +
res.locals.userid +
"," +
res.locals.email +
"," +
res.locals.username +
"," +
res.locals.display_name +
"," +
res.locals.is_admin
);
//console.log( "调试用户信息(locals ):" + res.locals.userid + "," + res.locals.email + "," + res.locals.username + "," + res.locals.display_name + "," + res.locals.is_admin );
}

next();
Expand Down
19 changes: 18 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ model ow_projects {
time DateTime @default(now()) @db.Timestamp(0)
title String? @default("ow_projects新项目") @db.VarChar(50)
description String? @default("OurWorld上的ow_projects项目") @db.VarChar(1000)
src String? @db.MediumText
source String? @db.MediumText
history Int @default(1) @db.TinyInt
devenv Int? @default(1) @db.TinyInt
devsource String? @db.MediumText
}

/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
Expand Down Expand Up @@ -269,3 +272,17 @@ model ow_project {
source String? @db.MediumText
environment Json?
}

/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
model ow_projects_history {
id Int @id @default(autoincrement()) @db.UnsignedInt
authorid Int @db.UnsignedInt
projectid Int @db.UnsignedInt
type String? @default("text") @db.VarChar(32)
time DateTime @default(now()) @db.Timestamp(0)
title String? @default("ZeroCat新项目") @db.VarChar(50)
description String? @default("commit") @db.VarChar(1000)
source String? @db.MediumText
state String? @default("private") @db.VarChar(32)
licence String? @db.VarChar(45)
}
18 changes: 17 additions & 1 deletion server/lib/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ try {
} catch (err) {
console.log("S3 update Error: ", err);
}

};

//以md5的格式创建一个哈希值
Expand Down Expand Up @@ -96,3 +96,19 @@ exports.GenerateJwt = function (json) {
);
return token;
};
exports.isJSON = function (str) {
if (typeof str == 'string') {
try {
var obj=JSON.parse(str);
if(typeof obj == 'object' && obj ){
return true;
}else{
return false;
}

} catch(e) {
console.log('error:'+str+'!!!'+e);
return false;
}
}
}
2 changes: 1 addition & 1 deletion server/lib/scratch_default_project.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 78d63d1

Please sign in to comment.