feat: dispatch sage_login event after successful login in withLoginInfo

jsoncall.js: after login retry succeeds, dispatch 'sage_login' on bricks.app
so shell can reload the global menu dynamically.
This commit is contained in:
yumoqing 2026-05-27 17:57:38 +08:00
parent 2e22085122
commit ffc9350fcb
2 changed files with 8 additions and 0 deletions

View File

@ -206,6 +206,10 @@ bricks.HttpText = class {
}
console.log('withLoginInfo: retry successful');
// Dispatch sage_login event so shell can reload menu
if (bricks.app && bricks.app.dispatch) {
bricks.app.dispatch('sage_login');
}
return await this.get_result_data(retryResult);
}
async get(url, {headers=null, params=null}={}){

4
dist/bricks.js vendored
View File

@ -3554,6 +3554,10 @@ bricks.HttpText = class {
}
console.log('withLoginInfo: retry successful');
// Dispatch sage_login event so shell can reload menu
if (bricks.app && bricks.app.dispatch) {
bricks.app.dispatch('sage_login');
}
return await this.get_result_data(retryResult);
}
async get(url, {headers=null, params=null}={}){