操作的好好的,确认没有别人登录账号,老会突然跳到登录界面(登录老掉)

Blade 未结 2 510
颜丙
颜丙 剑者 2025-03-05 14:17
悬赏:5

一、该问题的重现步骤是什么?

1. 

2. 

3.


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。

2条回答
  • 2025-03-05 16:22

    使用版本是多少,bladex4.1.0开始支持无感刷新token,应该就没这个问题了

    作者追问:2025-03-06 12:03

    用的版本是

    3.2.0.RELEASE

    那这种低版本的怎么弄呢

    回答: 2025-03-06 17:49

    可以在saber的commit记录里搜索无感两个字,有两次提交,根据提交改造下现有前端就行

    CleanShot20250306174847@2x.png

    作者追问:2025-03-08 12:50

    修改完之后长时间不操作会突然突出登录呢?

    相对应的后端需要改什么嘛?

    回答: 2025-03-09 10:53

    你先用最新版测试,最新版可以而你的不行就说明没有更新到位,核心也就在axios.js里了。token过期会去自动调用刷新接口

    作者追问:2025-03-09 11:21

    store router { } { } { } { } website { Base64 } { } crypto isErrorShown = isRefreshing = refreshTokenPromise = axios..= axios..= (status) {
        status >= && status <= }axios..= .configure({
        : })axios...(
        config => {
            .start()isErrorShown = (!(config.) && !config..()) {
                config.= + config.}
            config.[] = authorization = config.authorization === (!authorization) {
                config.[] = ${Base64.(
                    ${website.}${website.})}}
            meta = config.meta || {}isToken = meta.isToken === cryptoToken = config.cryptoToken === cryptoData = config.cryptoData === token = ()(token && !isToken) {
                config.[website.] = cryptoToken
                    ? + crypto.(tokencrypto.cryptoKey)
                    : + token}
            (cryptoData) {
                (config.) {
                    data = crypto.(.(config.)crypto.)config.= { data }}
                (config.) {
                    config.= config.= crypto.(.(config.)crypto.)}
            }
            (config.text === ) {
                config.[] = }
            (config.=== && meta.isSerialize === ) {
                config.= (config.)}
            config}error => {
            .(error)}
    )axios...(
        res => {
            .done()config = res.cryptoData = config.cryptoData === (cryptoData) {
                res.= .(crypto.(res.crypto.))}
            status = res..error_code || res..|| res.statusWhiteList = website.|| []message = res..|| res..error_description || (statusWhiteList.(status)) .(res)(status === && !config._retry) {
                config.= (isRefreshing) {
                    refreshTokenPromise.(() => {
                        meta = config.meta || {}isToken = meta.isToken === cryptoToken = config.cryptoToken === token = ()(token && !isToken) {
                            config.[website.] = cryptoToken
                                ? + crypto.(tokencrypto.cryptoKey)
                                : + token}
                        axios(config)})}
    
                isRefreshing = refreshTokenPromise = store
                    .()
                    .(() => {
                        isRefreshing = meta = config.meta || {}isToken = meta.isToken === cryptoToken = config.cryptoToken === token = ()(token && !isToken) {
                            config.[website.] = cryptoToken
                                ? + crypto.(tokencrypto.cryptoKey)
                                : + token}
                        axios(config)})
                    .(() => {
                        isRefreshing = (!isErrorShown) {
                            isErrorShown = ({
                                : : })}
                        ()()store.().(() => router.({ : })).((message))})refreshTokenPromise}
    
            (status === && config._retry) {
                (!isErrorShown) {
                    isErrorShown = ({
                        : : })}
                ()()store.().(() => router.({ : })).((message))}
    
            (status > && !(res..error_description)) {
                (!isErrorShown) {
                    isErrorShown = ({
                        : message: })}
                .((message))}
    
            (status !== && status !== ) {
                ({
                    : message: }).((message))}
            res}error => {
            .done().((error))}
    )axios

    我的整体将axios文件复制过来的

    作者追问:2025-03-09 11:22

    store router { } { } { } { } website { Base64 } { } crypto isErrorShown = isRefreshing = refreshTokenPromise = axios..= axios..= (status) {
        status >= && status <= }axios..= .configure({
        : })axios...(
        config => {
            .start()isErrorShown = (!(config.) && !config..()) {
                config.= + config.}
            config.[] = authorization = config.authorization === (!authorization) {
                config.[] = ${Base64.(
                    ${website.}${website.})}}
            meta = config.meta || {}isToken = meta.isToken === cryptoToken = config.cryptoToken === cryptoData = config.cryptoData === token = ()(token && !isToken) {
                config.[website.] = cryptoToken
                    ? + crypto.(tokencrypto.cryptoKey)
                    : + token}
            (cryptoData) {
                (config.) {
                    data = crypto.(.(config.)crypto.)config.= { data }}
                (config.) {
                    config.= config.= crypto.(.(config.)crypto.)}
            }
            (config.text === ) {
                config.[] = }
            (config.=== && meta.isSerialize === ) {
                config.= (config.)}
            config}error => {
            .(error)}
    )axios...(
        res => {
            .done()config = res.cryptoData = config.cryptoData === (cryptoData) {
                res.= .(crypto.(res.crypto.))}
            status = res..error_code || res..|| res.statusWhiteList = website.|| []message = res..|| res..error_description || (statusWhiteList.(status)) .(res)(status === && !config._retry) {
                config.= (isRefreshing) {
                    refreshTokenPromise.(() => {
                        meta = config.meta || {}isToken = meta.isToken === cryptoToken = config.cryptoToken === token = ()(token && !isToken) {
                            config.[website.] = cryptoToken
                                ? + crypto.(tokencrypto.cryptoKey)
                                : + token}
                        axios(config)})}
    
                isRefreshing = refreshTokenPromise = store
                    .()
                    .(() => {
                        isRefreshing = meta = config.meta || {}isToken = meta.isToken === cryptoToken = config.cryptoToken === token = ()(token && !isToken) {
                            config.[website.] = cryptoToken
                                ? + crypto.(tokencrypto.cryptoKey)
                                : + token}
                        axios(config)})
                    .(() => {
                        isRefreshing = (!isErrorShown) {
                            isErrorShown = ({
                                : : })}
                        ()()store.().(() => router.({ : })).((message))})refreshTokenPromise}
    
            (status === && config._retry) {
                (!isErrorShown) {
                    isErrorShown = ({
                        : : })}
                ()()store.().(() => router.({ : })).((message))}
    
            (status > && !(res..error_description)) {
                (!isErrorShown) {
                    isErrorShown = ({
                        : message: })}
                .((message))}
    
            (status !== && status !== ) {
                ({
                    : message: }).((message))}
            res}error => {
            .done().((error))}
    )axios


    回答: 2025-03-09 11:28

    整体覆盖肯定不行啊,差了快10个版本呢,我是让你把commit里修改的内容放到你现在的axios里

    作者追问:2025-03-09 13:23

    image.png



    我把这个绿色这个放进去了,同样的道理还是会突然退出登录呢


    0 讨论(0)
  • 2025-03-09 13:20

    image.png



    我把这个绿色这个放进去了,同样的道理还是会突然退出登录呢


    作者追问:2025-03-09 13:30

    这里下载对应的原版历史版本的saber:https://center.javablade.com/blade/BladeX/releases


    修改后多打点log,看看再次退回到首页的时候打印了哪些内容。如果你用原版的还是有问题,把你改造的axios.js发到我们邮箱并且附上重现视频。 bladejava@qq.com

    回答: 2025-03-10 20:34

    image.png

    回答: 2025-03-10 20:42

    image.png已发邮箱

    0 讨论(0)
提交回复