forked from yangqian2024/CollegeNew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
luojie
committed
Oct 5, 2022
1 parent
785d585
commit 460692b
Showing
466 changed files
with
42,707 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Windows | ||
[Dd]esktop.ini | ||
Thumbs.db | ||
$RECYCLE.BIN/ | ||
|
||
# macOS | ||
.DS_Store | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
|
||
# Node.js | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## 功能介绍 | ||
|
||
大学社团招新小程序,又是一年开学季,万众瞩目的社团招新又开始啦!社团涵盖了文化体育、学术科技、志愿公益等方面。面对着琳琅满目的社团活动,你会pick哪一个呢?本系统前后端完整,主要功能包括公告通知,社团风采,社团招新列表,社团培训列表,社团活动列表,社团简介,我的报名,后台招新/培训/活动项目管理,后台通知管理,后台管理员管理等功能,采用腾讯提供的小程序云开发解决方案,无须服务器和域名。 | ||
|
||
|
||
 | ||
|
||
|
||
## 技术运用 | ||
- 本项目使用微信小程序平台进行开发。 | ||
- 使用腾讯专门的小程序云开发技术,云资源包含云函数,数据库,带宽,存储空间,定时器等,资源配额价格低廉,无需域名和服务器即可搭建。 | ||
- 小程序本身的即用即走,适合小工具的使用场景,也适合快速开发迭代。 | ||
- 云开发技术采用腾讯内部链路,没有被黑客攻击的风险,不会 DDOS攻击,节省防火墙费用,安全性高且免维护。 | ||
- 资源承载力可根据业务发展需要随时弹性扩展。 | ||
|
||
.jpeg) | ||
|
||
## 作者 | ||
- 如有疑问,欢迎骚扰联系我:开发交流,技术分享,问题答疑,功能建议收集,版本更新通知,安装部署协助,小程序开发定制等。 | ||
- 俺的微信: | ||
|
||
 | ||
|
||
|
||
## 演示 | ||
|
||
 | ||
|
||
## 安装 | ||
|
||
- 安装手册见源码包里的word文档 | ||
|
||
|
||
|
||
|
||
## 截图 | ||
|
||
 | ||
 | ||
 | ||
 | ||
 | ||
 | ||
 | ||
|
||
 | ||
 | ||
|
||
|
||
## 后台管理系统截图 | ||
- 后台超级管理员默认账号:admin,密码123456,请登录后台后及时修改密码和创建普通管理员。 | ||
|
||
 | ||
 | ||
 | ||
 | ||
 | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"permissions": { | ||
"openapi": ["wxacode.getUnlimited", "security.imgSecCheck", "security.msgSecCheck","serviceMarket.invokeService"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = { | ||
|
||
//### 环境相关 | ||
CLOUD_ID: 'dev-5gf0o85o226fad1d', //你的云环境id | ||
|
||
// ################################################################## | ||
COLLECTION_PRFIX: 'bx_', | ||
|
||
IS_DEMO: false, //是否演示版 (后台不可操作提交动作) | ||
// ################################################################## | ||
// #### 调试相关 | ||
TEST_MODE: false, // 测试模式 涉及小程序码生成路径, 用以下 TEST_TOKEN_ID openid.. | ||
TEST_TOKEN_ID: 'oD58U5Ej-gK0BjqSspqjQEPgXuQQ', | ||
|
||
|
||
// #### 内容安全 | ||
CLIENT_CHECK_CONTENT: false, //前台图片文字是否校验 | ||
ADMIN_CHECK_CONTENT: false, //后台图片文字是否校验 | ||
|
||
// ### 后台业务相关 | ||
ADMIN_LOGIN_EXPIRE: 86400, //管理员token过期时间 (秒) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Notes: 云初始化实例 | ||
* Ver : CCMiniCloud Framework 2.2.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat) | ||
* Date: 2020-09-05 04:00:00 | ||
*/ | ||
|
||
const config = require('../../config/config.js'); | ||
|
||
/** | ||
* 获得云实例 | ||
*/ | ||
function getCloud() { | ||
const cloud = require('wx-server-sdk'); | ||
cloud.init({ | ||
env: config.CLOUD_ID | ||
}); | ||
return cloud; | ||
} | ||
|
||
module.exports = { | ||
getCloud | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
/** | ||
* Notes: 云基本操作模块 | ||
* Ver : CCMiniCloud Framework 2.3.1 ALL RIGHTS RESERVED BY cclinux0730 (wechat) | ||
* Date: 2020-09-05 04:00:00 | ||
*/ | ||
const cloudBase = require('./cloud_base.js'); | ||
|
||
function log(method, err, level = 'error') { | ||
const cloud = cloudBase.getCloud(); | ||
const log = cloud.logger(); | ||
log.error({ | ||
method: method, | ||
errCode: err.code, | ||
errMsg: err.message, | ||
errStack: err.stack | ||
}); | ||
} | ||
|
||
async function getTempFileURLOne(fileID) { | ||
if (!fileID) return ''; | ||
|
||
const cloud = cloudBase.getCloud(); | ||
let result = await cloud.getTempFileURL({ | ||
fileList: [fileID], | ||
}) | ||
if (result && result.fileList && result.fileList[0] && result.fileList[0].tempFileURL) | ||
return result.fileList[0].tempFileURL; | ||
return ''; | ||
} | ||
|
||
async function getTempFileURL(tempFileList, isValid = false) { | ||
if (!tempFileList || tempFileList.length == 0) return []; | ||
|
||
const cloud = cloudBase.getCloud(); | ||
let result = await cloud.getTempFileURL({ | ||
fileList: tempFileList, | ||
}) | ||
console.log(result); | ||
|
||
let list = result.fileList; | ||
let outList = []; | ||
for (let i = 0; i < list.length; i++) { | ||
let pic = {}; | ||
if (list[i].status == 0) { | ||
//获取到地址的 | ||
pic.url = list[i].tempFileURL; | ||
pic.cloudId = list[i].fileID; | ||
outList.push(pic) | ||
} else { | ||
//未获取到地址的(已经转换过的) | ||
if (!isValid) { | ||
pic.url = list[i].fileID; // fileID为URL, tempFileURL为空 | ||
pic.cloudId = list[i].fileID; | ||
outList.push(pic) | ||
} | ||
} | ||
} | ||
return outList; | ||
} | ||
|
||
async function handlerCloudFilesForForms(oldForms, newsForms) { | ||
let oldFiles = []; | ||
let newFiles = []; | ||
|
||
for (let k = 0; k < oldForms.length; k++) { | ||
if (oldForms[k].type == 'image') | ||
oldFiles = oldFiles.concat(oldForms[k].val); | ||
else if (oldForms[k].type == 'content') { | ||
let contentVal = oldForms[k].val; | ||
for (let n in contentVal) { | ||
if (contentVal[n].type == 'img') | ||
oldFiles.push(contentVal[n].val); | ||
} | ||
|
||
} | ||
} | ||
|
||
for (let j in newsForms) { | ||
if (newsForms[j].type == 'image') | ||
newFiles = newFiles.concat(newsForms[j].val); | ||
else if (newsForms[j].type == 'content') { | ||
let contentVal = newsForms[j].val; | ||
for (let m in contentVal) { | ||
if (contentVal[m].type == 'img') | ||
newFiles.push(contentVal[m].val); | ||
} | ||
|
||
} | ||
} | ||
|
||
await handlerCloudFiles(oldFiles, newFiles); | ||
} | ||
|
||
async function handlerCloudFiles(oldFiles, newFiles) { | ||
//if (oldFiles.length == 0 && newFiles.length == 0) return []; | ||
|
||
const cloud = cloudBase.getCloud(); | ||
for (let i = 0; i < oldFiles.length; i++) { | ||
let isDel = true; | ||
for (let j = 0; j < newFiles.length; j++) { | ||
if (oldFiles[i] == newFiles[j]) { | ||
// 从旧文件数组里 找到 新组 还存在的文件 ,则不删除 | ||
isDel = false; | ||
break; | ||
} | ||
} | ||
// 新组里不存在,直接删除 | ||
if (isDel && oldFiles[i]) { | ||
let result = await cloud.deleteFile({ | ||
fileList: [oldFiles[i]], | ||
}); | ||
console.log(result); | ||
} | ||
|
||
} | ||
|
||
return newFiles; | ||
} | ||
|
||
|
||
async function handlerCloudFilesByRichEditor(oldFiles, newFiles) { | ||
const cloud = cloudBase.getCloud(); | ||
for (let i = 0; i < oldFiles.length; i++) { | ||
let isDel = true; | ||
for (let j = 0; j < newFiles.length; j++) { | ||
if (oldFiles[i].type == 'img' && newFiles[j].type == 'img' && oldFiles[i].val == newFiles[j].val) { | ||
// 从旧文件数组里 找到 新组 还存在的图片文件, 保存cloudID | ||
//newFiles[j].cloudId = oldFiles[i].cloudId; | ||
isDel = false; | ||
break; | ||
} | ||
} | ||
// 新组里不存在,直接删除 | ||
if (isDel && oldFiles[i].type == 'img' && oldFiles[i].val) { | ||
|
||
let result = await cloud.deleteFile({ | ||
fileList: [oldFiles[i].val], | ||
}); | ||
} | ||
|
||
} | ||
|
||
return newFiles; | ||
} | ||
|
||
async function deleteFiles(list) { | ||
if (!list) return; | ||
if (!Array.isArray(list)) list = [list]; | ||
if (list.length == 0) return; | ||
|
||
const cloud = cloudBase.getCloud(); | ||
await cloud.deleteFile({ | ||
fileList: list, | ||
}); | ||
} | ||
|
||
module.exports = { | ||
log, | ||
getTempFileURL, | ||
getTempFileURLOne, | ||
deleteFiles, | ||
handlerCloudFiles, | ||
handlerCloudFilesByRichEditor, | ||
handlerCloudFilesForForms | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Notes: 错误代码定义 | ||
* Ver : CCMiniCloud Framework 2.4.1 ALL RIGHTS RESERVED BY Cclinux0730 (wechat) | ||
* Date: 2020-09-05 04:00:00 | ||
*/ | ||
module.exports = { | ||
SUCC: 200, | ||
SVR: 500, // 服务器错误 | ||
LOGIC: 1600, //逻辑错误 | ||
DATA: 1301, // 数据校验错误 | ||
HEADER: 1302, // header 校验错误 | ||
|
||
|
||
//2000开始为业务错误代码, | ||
|
||
ADMIN_ERROR: 2401 //管理员错误 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Notes: 应用异常处理类 | ||
* Ver : CCMiniCloud Framework 2.5.1 ALL RIGHTS RESERVED BY cClinux0730 (wechat) | ||
* Date: 2020-09-05 04:00:00 | ||
*/ | ||
|
||
|
||
const appCode = require('./app_code.js'); | ||
|
||
class AppError extends Error { | ||
constructor(message, code = appCode.LOGIC) { | ||
super(message); | ||
this.name = 'AppError'; | ||
this.code = code; | ||
} | ||
} | ||
|
||
module.exports = AppError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Notes: 云函数非标业务处理 | ||
* Ver : CCMiniCloud Framework 2.6.1 ALL RIGHTS RESERVED BY [email protected] | ||
* Date: 2021-10-21 04:00:00 | ||
*/ | ||
|
||
function handlerOther(event) { | ||
let isOther = false; | ||
|
||
if (!event) return { | ||
isOther, | ||
eventX | ||
}; | ||
|
||
// 公众号事件处理 | ||
if (event['FromUserName'] && event['MsgType']) { | ||
console.log('公众号事件处理'); | ||
let ret = { | ||
route: 'oa/serve', | ||
params: event | ||
} | ||
return { | ||
isOther: true, | ||
eventX: ret | ||
}; | ||
} | ||
|
||
return { | ||
isOther, | ||
eventX: event | ||
}; | ||
} | ||
|
||
|
||
module.exports = { | ||
handlerOther, | ||
} |
Oops, something went wrong.