feat: 新增AI客服/积分管理/合同审查/我的报告页面,完善.sign.vue入口与积分显示

This commit is contained in:
2026-10-16 21:09:21 +08:00
parent 8a1da677e4
commit ae97c5d2be
476 changed files with 35618 additions and 540 deletions
@@ -15,43 +15,40 @@ module.exports = {
main: async (event) => {
let { data = {}, util, originalParam } = event;
let { uniID, config, pubFun, vk, db, _ } = util;
let { uid } = data;
let { uid, accountType, code } = data;
let res = {};
// 业务逻辑开始-----------------------------------------------------------
let {
code,
accessToken,
type,
myInviteCode,
needPermission
} = data;
res = await uniID.loginByQQ({
code,
accessToken,
type,
myInviteCode,
needPermission
});
if (res.token) {
if (!res.msg) {
res.msg = res.type === "register" ? "注册成功" : "登录成功";
}
let encrypted = vk.crypto.aes.encrypt({
data: res
});
delete res.sessionKey; // 删除明文sessionKey
delete res.accessToken; // 删除明文accessToken
delete res.refreshToken; // 删除明文refreshToken
res.encryptedKey = encrypted; // 返回前端加密内容
// 日志服务
const loginLogService = vk.require("service/user/util/login_log");
await loginLogService.add({
type: "login",
login_type: "qq",
user_id: res.uid,
context: originalParam.context
}, util);
}
let custom = {
accountType: parseInt(accountType),
nickname: `QQ用户` + vk.pubfn.random(6)
};
// res = await uniID.loginByQQ({
// code,
// accessToken,
// type,
// myInviteCode,
// needPermission
// });
const redirect_uri = 'http://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/pages/auth/login/qq'
const qqRes = await vk.request({
url: `https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=101795826&client_secret=1a41633966fb97cefea512f6c8601638&code=${code}&redirect_uri=` + encodeURIComponent(redirect_uri),
method: 'GET',
})
if (qqRes.access_token) {
const qqUserRes = await vk.request({
url: `https://graph.qq.com/oauth2.0/me?access_token=${qqRes.access_token}`,
method: 'GET',
})
if (qqUserRes.openid) {
const userByQQOpenid = await vk.baseDao.findByWhereJson({
dbName: "uni-id-users",
whereJson: {
"qq.openid": qqUserRes.openid
}
})
}
}
// 业务逻辑结束-----------------------------------------------------------
return res;
}