mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
chore: updates
This commit is contained in:
@@ -26,11 +26,12 @@ func (s *Server) authModdleware(c *gin.Context) {
|
|||||||
|
|
||||||
auth := c.GetHeader("Authorization")
|
auth := c.GetHeader("Authorization")
|
||||||
if auth == "" {
|
if auth == "" {
|
||||||
|
log.Infof("token is not present, abort")
|
||||||
c.AbortWithStatus(http.StatusForbidden)
|
c.AbortWithStatus(http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
auth = strings.TrimPrefix(auth, "Bearer ")
|
auth = strings.TrimPrefix(auth, "Bearer ")
|
||||||
log.Infof("current token: %v", auth)
|
//log.Infof("current token: %v", auth)
|
||||||
token, err := jwt.ParseWithClaims(auth, &jwt.RegisteredClaims{}, func(t *jwt.Token) (interface{}, error) {
|
token, err := jwt.ParseWithClaims(auth, &jwt.RegisteredClaims{}, func(t *jwt.Token) (interface{}, error) {
|
||||||
return []byte(s.jwtSerect), nil
|
return []byte(s.jwtSerect), nil
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -155,7 +155,9 @@ func (s *Server) checkFileExists(series *ent.Series) error{
|
|||||||
}
|
}
|
||||||
epNum := strings.TrimPrefix(match[0], "E")
|
epNum := strings.TrimPrefix(match[0], "E")
|
||||||
epNum1, _ := strconv.Atoi(epNum)
|
epNum1, _ := strconv.Atoi(epNum)
|
||||||
err := s.db.UpdateEpisodeFile(series.ID, seasonNum1, epNum1, filepath.Join(in.Name(), ep.Name()))
|
var dirname = filepath.Join(in.Name(), ep.Name())
|
||||||
|
log.Infof("found match: %v", dirname)
|
||||||
|
err := s.db.UpdateEpisodeFile(series.ID, seasonNum1, epNum1, dirname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("update episode: %v", err)
|
log.Error("update episode: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class MyApp extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: ActivityPage.route,
|
path: ActivityPage.route,
|
||||||
builder: (context, state) => ActivityPage(),
|
builder: (context, state) => const ActivityPage(),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:quiver/strings.dart';
|
|
||||||
import 'package:ui/providers/login.dart';
|
import 'package:ui/providers/login.dart';
|
||||||
import 'package:ui/providers/settings.dart';
|
import 'package:ui/providers/settings.dart';
|
||||||
import 'package:ui/utils.dart';
|
import 'package:ui/utils.dart';
|
||||||
|
|||||||
Reference in New Issue
Block a user