Skip to content

Commit

Permalink
feat: 模块版文件中增加 token 路由
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Nov 8, 2024
1 parent 2b60c51 commit 772f431
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/products/sub-store-0.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -32,6 +33,7 @@ function serve() {
// register routes
registerCollectionRoutes($app);
registerSubscriptionRoutes($app);
registerTokenRoutes($app);
registerFileRoutes($app);
registerModuleRoutes($app);
registerArtifactRoutes($app);
Expand Down
4 changes: 2 additions & 2 deletions backend/src/restful/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -166,7 +166,7 @@ async function signToken(req, res) {
$.write(tokens, TOKENS_KEY);
return success(res, {
token,
secret,
// secret,
});
} catch (e) {
return failed(
Expand Down

0 comments on commit 772f431

Please sign in to comment.