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",
|
||||
"version": "2.14.413",
|
||||
"version": "2.14.414",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -21,6 +21,7 @@ import registerSettingRoutes from '@/restful/settings';
|
||||
import registerMiscRoutes from '@/restful/miscs';
|
||||
import registerSortRoutes from '@/restful/sort';
|
||||
import registerFileRoutes from '@/restful/file';
|
||||
import registerTokenRoutes from '@/restful/token';
|
||||
import registerModuleRoutes from '@/restful/module';
|
||||
|
||||
migrate();
|
||||
@ -32,6 +33,7 @@ function serve() {
|
||||
// register routes
|
||||
registerCollectionRoutes($app);
|
||||
registerSubscriptionRoutes($app);
|
||||
registerTokenRoutes($app);
|
||||
registerFileRoutes($app);
|
||||
registerModuleRoutes($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 tokens = $.read(TOKENS_KEY) || [];
|
||||
// const now = Date.now();
|
||||
@ -166,7 +166,7 @@ async function signToken(req, res) {
|
||||
$.write(tokens, TOKENS_KEY);
|
||||
return success(res, {
|
||||
token,
|
||||
secret,
|
||||
// secret,
|
||||
});
|
||||
} catch (e) {
|
||||
return failed(
|
||||
|
Loading…
x
Reference in New Issue
Block a user