Browse Source

项目设置,出错时,重定向调整

MaiXinRong 3 months ago
parent
commit
63979d4466
1 changed files with 5 additions and 5 deletions
  1. 5 5
      app/controller/sub_proj_setting_controller.js

+ 5 - 5
app/controller/sub_proj_setting_controller.js

@@ -65,7 +65,7 @@ module.exports = app => {
                 await this.layout('sp_setting/category.ejs', renderData, 'sp_setting/category_modal.ejs');
             } catch (error) {
                 console.log(error);
-                ctx.redirect('/dashboard');
+                ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
             }
         }
 
@@ -229,7 +229,7 @@ module.exports = app => {
                 await this.layout('sp_setting/logs.ejs', renderData);
             } catch (error) {
                 console.log(error);
-                ctx.redirect('/dashboard');
+                ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
             }
         }
 
@@ -246,7 +246,7 @@ module.exports = app => {
                 }, 'sp_setting/fun_modal.ejs');
             } catch (error) {
                 ctx.helper.log(error);
-                ctx.redirect('/dashboard');
+                ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
             }
         }
 
@@ -333,7 +333,7 @@ module.exports = app => {
             } catch (error) {
                 ctx.helper.log(error);
                 ctx.session.postError = error.toString();
-                ctx.redirect('/dashboard');
+                ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
             }
         }
 
@@ -480,7 +480,7 @@ module.exports = app => {
                 await this.layout('sp_setting/manage.ejs', renderData, 'sp_setting/manage_modal.ejs');
             } catch (error) {
                 ctx.helper.log(error);
-                ctx.redirect('/dashboard');
+                ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
             }
         }