|
|
@@ -20,6 +20,7 @@
|
|
|
<script>
|
|
|
import lucencyHeader from "~/components/header/lucencyHeader";
|
|
|
import langMap from "@/map/langMap";
|
|
|
+import handle from "@/until/handle";
|
|
|
export default {
|
|
|
name: "index",
|
|
|
props:['uLang'],
|
|
|
@@ -92,10 +93,12 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
mounted() {
|
|
|
this.$root.$on('changeLang',this.switchLang);
|
|
|
- // todo 从后台获取下载列表数据
|
|
|
+ this.loadDownloads();
|
|
|
},
|
|
|
+
|
|
|
methods:{
|
|
|
switchLang(nextLang){
|
|
|
if(nextLang){
|
|
|
@@ -107,6 +110,22 @@ export default {
|
|
|
this.lang = langMap.lang.cn
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ async loadDownloads(){
|
|
|
+ // todo 从后台获取下载列表数据
|
|
|
+ let err, res;
|
|
|
+ [err, res] = await handle(this.$axios.$get('/api/downloadItem.php'));
|
|
|
+ if(err) {
|
|
|
+ console.log(err);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ if(res.rcode === 1){
|
|
|
+ this.downloadsType = res.data;
|
|
|
+ }else{
|
|
|
+ console.log(res.msg);
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
}
|