支持离线模式
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -25,3 +25,4 @@ yarn-error.log*
|
|||||||
/.hbuilderx/launch.json
|
/.hbuilderx/launch.json
|
||||||
/src/pages.json
|
/src/pages.json
|
||||||
|
|
||||||
|
/src/config.json
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const saveApps = app => {
|
|||||||
if (app.list.length > 0) {
|
if (app.list.length > 0) {
|
||||||
axios.post("http://dvcp.sinoecare.net/node/wechatapps/addOrUpdate", app).then(res => {
|
axios.post("http://dvcp.sinoecare.net/node/wechatapps/addOrUpdate", app).then(res => {
|
||||||
if (res?.code == 0) chalkTag.done("产品库目录已同步至后台数据库...")
|
if (res?.code == 0) chalkTag.done("产品库目录已同步至后台数据库...")
|
||||||
}).catch(() => 0)
|
}).catch(() => 0).finally(() => fsExtra.outputJson('src/config.json', {apps: app.list}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const start = () => {
|
const start = () => {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {mapActions, mapState} from 'vuex'
|
import {mapActions, mapState} from 'vuex'
|
||||||
|
import config from "../config.json";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "home",
|
name: "home",
|
||||||
@@ -66,6 +67,7 @@ export default {
|
|||||||
uni.navigateTo({url: `${app.path}`})
|
uni.navigateTo({url: `${app.path}`})
|
||||||
},
|
},
|
||||||
getApps() {
|
getApps() {
|
||||||
|
this.apps = config.apps
|
||||||
this.$instance.post("/node/wechatapps/list", null, {
|
this.$instance.post("/node/wechatapps/list", null, {
|
||||||
baseURL: "http://dvcp.sinoecare.net/", params: {size: 999, type: 'mp'}, withoutToken: true
|
baseURL: "http://dvcp.sinoecare.net/", params: {size: 999, type: 'mp'}, withoutToken: true
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user