mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 07:19:01 +08:00
feat: 模块版文件中增加 token 路由
This commit is contained in:
parent
2b60c515cd
commit
772f431887
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.413",
|
"version": "2.14.414",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -21,6 +21,7 @@ import registerSettingRoutes from '@/restful/settings';
|
|||||||
import registerMiscRoutes from '@/restful/miscs';
|
import registerMiscRoutes from '@/restful/miscs';
|
||||||
import registerSortRoutes from '@/restful/sort';
|
import registerSortRoutes from '@/restful/sort';
|
||||||
import registerFileRoutes from '@/restful/file';
|
import registerFileRoutes from '@/restful/file';
|
||||||
|
import registerTokenRoutes from '@/restful/token';
|
||||||
import registerModuleRoutes from '@/restful/module';
|
import registerModuleRoutes from '@/restful/module';
|
||||||
|
|
||||||
migrate();
|
migrate();
|
||||||
@ -32,6 +33,7 @@ function serve() {
|
|||||||
// register routes
|
// register routes
|
||||||
registerCollectionRoutes($app);
|
registerCollectionRoutes($app);
|
||||||
registerSubscriptionRoutes($app);
|
registerSubscriptionRoutes($app);
|
||||||
|
registerTokenRoutes($app);
|
||||||
registerFileRoutes($app);
|
registerFileRoutes($app);
|
||||||
registerModuleRoutes($app);
|
registerModuleRoutes($app);
|
||||||
registerArtifactRoutes($app);
|
registerArtifactRoutes($app);
|
||||||
|
@ -140,7 +140,7 @@ async function signToken(req, res) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const secret = eval('process.env.SUB_STORE_FRONTEND_BACKEND_PATH');
|
// const secret = eval('process.env.SUB_STORE_FRONTEND_BACKEND_PATH');
|
||||||
const nanoid = eval(`require("nanoid")`);
|
const nanoid = eval(`require("nanoid")`);
|
||||||
const tokens = $.read(TOKENS_KEY) || [];
|
const tokens = $.read(TOKENS_KEY) || [];
|
||||||
// const now = Date.now();
|
// const now = Date.now();
|
||||||
@ -166,7 +166,7 @@ async function signToken(req, res) {
|
|||||||
$.write(tokens, TOKENS_KEY);
|
$.write(tokens, TOKENS_KEY);
|
||||||
return success(res, {
|
return success(res, {
|
||||||
token,
|
token,
|
||||||
secret,
|
// secret,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return failed(
|
return failed(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user