remove
This commit is contained in:
49
package.json
49
package.json
@@ -27,43 +27,42 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kevisual/auth": "1.0.5",
|
"@kevisual/auth": "1.0.5",
|
||||||
"@kevisual/router": "^0.0.23",
|
"@kevisual/router": "^0.0.33",
|
||||||
"@kevisual/use-config": "^1.0.19",
|
"@kevisual/use-config": "^1.0.21",
|
||||||
"ioredis": "^5.6.1",
|
"ioredis": "^5.8.2",
|
||||||
"nanoid": "^5.1.5",
|
"nanoid": "^5.1.6",
|
||||||
"pg": "^8.16.2",
|
"pg": "^8.16.3",
|
||||||
"sequelize": "^6.37.7",
|
"sequelize": "^6.37.7",
|
||||||
"socket.io": "^4.8.1",
|
"socket.io": "^4.8.1",
|
||||||
"zod": "^3.25.67"
|
"zod": "^4.1.13"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@kevisual/context": "^0.0.3",
|
"@kevisual/context": "^0.0.4",
|
||||||
"@kevisual/types": "^0.0.10",
|
"@kevisual/types": "^0.0.10",
|
||||||
"@rollup/plugin-alias": "^5.1.1",
|
"@rollup/plugin-alias": "^6.0.0",
|
||||||
"@rollup/plugin-commonjs": "^28.0.6",
|
"@rollup/plugin-commonjs": "^29.0.0",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||||
"@rollup/plugin-replace": "^6.0.2",
|
"@rollup/plugin-replace": "^6.0.3",
|
||||||
"@rollup/plugin-typescript": "^12.1.3",
|
"@rollup/plugin-typescript": "^12.3.0",
|
||||||
"@types/archiver": "^6.0.3",
|
"@types/archiver": "^7.0.0",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/formidable": "^3.4.5",
|
"@types/formidable": "^3.4.6",
|
||||||
"@types/jsonwebtoken": "^9.0.10",
|
"@types/jsonwebtoken": "^9.0.10",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/node": "^24.0.4",
|
"@types/node": "^24.10.1",
|
||||||
"@types/react": "^19.1.8",
|
"@types/react": "^19.2.7",
|
||||||
"@types/uuid": "^10.0.0",
|
"concurrently": "^9.2.1",
|
||||||
"concurrently": "^9.2.0",
|
"cross-env": "^10.1.0",
|
||||||
"cross-env": "^7.0.3",
|
"nodemon": "^3.1.11",
|
||||||
"nodemon": "^3.1.10",
|
"rimraf": "^6.1.2",
|
||||||
"rimraf": "^6.0.1",
|
"rollup": "^4.53.3",
|
||||||
"rollup": "^4.44.1",
|
|
||||||
"rollup-plugin-copy": "^3.5.0",
|
"rollup-plugin-copy": "^3.5.0",
|
||||||
"rollup-plugin-dts": "^6.2.1",
|
"rollup-plugin-dts": "^6.3.0",
|
||||||
"rollup-plugin-esbuild": "^6.2.1",
|
"rollup-plugin-esbuild": "^6.2.1",
|
||||||
"tape": "^5.9.0",
|
"tape": "^5.9.0",
|
||||||
"tsx": "^4.20.3",
|
"tsx": "^4.21.0",
|
||||||
"typescript": "^5.8.3"
|
"typescript": "^5.9.3"
|
||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
|
|||||||
869
pnpm-lock.yaml
generated
869
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@ import { checkAuth, getLoginUser } from './middleware/auth-manual.ts';
|
|||||||
export { User, Org, UserServices, UserInit, OrgInit, UserModel, OrgModel, UserSecret, UserSecretInit };
|
export { User, Org, UserServices, UserInit, OrgInit, UserModel, OrgModel, UserSecret, UserSecretInit };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 可以不需要user成功, 有则赋值,交给下一个中间件
|
* 可以不需要user成功, 有则赋值,没有则无所谓,交给下一个中间件
|
||||||
*/
|
*/
|
||||||
export const authCan = 'auth-can';
|
export const authCan = 'auth-can';
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,6 +8,23 @@ import { OauthUser } from '@/oauth/oauth.ts';
|
|||||||
export const redis = useContextKey<Redis>('redis');
|
export const redis = useContextKey<Redis>('redis');
|
||||||
|
|
||||||
const UserSecretStatus = ['active', 'inactive', 'expired'] as const;
|
const UserSecretStatus = ['active', 'inactive', 'expired'] as const;
|
||||||
|
|
||||||
|
type Data = {
|
||||||
|
[key: string]: any;
|
||||||
|
/**
|
||||||
|
* 微信开放平台的某一个应用的openid
|
||||||
|
*/
|
||||||
|
wxOpenid?: string;
|
||||||
|
/**
|
||||||
|
* 微信开放平台的unionid:主要
|
||||||
|
*/
|
||||||
|
wxUnionid?: string;
|
||||||
|
/**
|
||||||
|
* 微信公众号的openid:次要
|
||||||
|
*/
|
||||||
|
wxmpOpenid?: string;
|
||||||
|
|
||||||
|
}
|
||||||
export class UserSecret extends Model {
|
export class UserSecret extends Model {
|
||||||
static oauth = oauth;
|
static oauth = oauth;
|
||||||
declare id: string;
|
declare id: string;
|
||||||
@@ -18,7 +35,7 @@ export class UserSecret extends Model {
|
|||||||
declare description: string;
|
declare description: string;
|
||||||
declare status: (typeof UserSecretStatus)[number];
|
declare status: (typeof UserSecretStatus)[number];
|
||||||
declare expiredTime: Date;
|
declare expiredTime: Date;
|
||||||
declare data: any;
|
declare data: Data;
|
||||||
/**
|
/**
|
||||||
* 验证token
|
* 验证token
|
||||||
* @param token
|
* @param token
|
||||||
@@ -44,9 +61,6 @@ export class UserSecret extends Model {
|
|||||||
if (userSecret.status !== 'active') {
|
if (userSecret.status !== 'active') {
|
||||||
return null; // 如果用户密钥状态不是active,则返回null
|
return null; // 如果用户密钥状态不是active,则返回null
|
||||||
}
|
}
|
||||||
if (!userSecret.token) {
|
|
||||||
return null; // 如果用户密钥没有token,则返回null
|
|
||||||
}
|
|
||||||
// 如果用户密钥未过期,则返回用户信息
|
// 如果用户密钥未过期,则返回用户信息
|
||||||
const oauthUser = await userSecret.getOauthUser();
|
const oauthUser = await userSecret.getOauthUser();
|
||||||
if (!oauthUser) {
|
if (!oauthUser) {
|
||||||
|
|||||||
Reference in New Issue
Block a user