Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

打包出新版本的app,但热更新代码的服务器里的www没更新,会自动下载就旧的代码覆盖 #353

Closed
q759410559 opened this issue Apr 28, 2018 · 2 comments

Comments

@q759410559
Copy link

打包出新版本的app,但热更新代码的服务器里的www没更新,会自动下载就旧的代码覆盖?
新的:{
"update": "start",
"content_url": "http://www.xxx.com/app/www",
"release": "2018.04.28-16.15.09"
}

旧的:{
"update": "start",
"content_url": "http://www.xxx.com/app/www",
"release": "2018.04.07-16.15.09"
}

这个bug吗?还是我哪里没有配置?

@XiaofengdiZhu
Copy link

release不一致就会自动更新,建议自己写一段检测是不是更新的代码然后更新
这是我的:

function checkUpdateAvailable() {
    $.getJSON("xxxxxxxxxxxxx/chcp.json", function (data) {
        if(webVersion2Date(data.release) > webVersion2Date(webVersion)){
            chcp.fetchUpdate(fetchUpdateCallback);
        }
    });
}
function webVersion2Date(str) {
    let array1 = str.split('-');
    let array2 = array1[0].split('.');
    let array3 = array1[1].split('.');
    return new Date(array2[0], array2[1], array2[2], array3[0], array3[1], array3[2], 0);
}

@nordnet-deprecation-bot
Copy link
Contributor

👋 Hi! Thank you for your interest in this repo.

😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹ️ Please see #371 for more information.

@nordnet nordnet locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants