|
@@ -208,6 +208,15 @@ function getParam(paramName) {
|
|
return validh.split("=")[1];
|
|
return validh.split("=")[1];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function getDomain() {
|
|
|
|
+ let domain;
|
|
|
|
+ if (process.env.VUE_APP_SELF_DEFINE_DOMAIN === "true") {
|
|
|
|
+ domain = window.localStorage.getItem("domain_in_url");
|
|
|
|
+ }
|
|
|
|
+ if (!domain) domain = window.location.hostname.split(".")[0];
|
|
|
|
+ return domain;
|
|
|
|
+}
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: "app",
|
|
name: "app",
|
|
data() {
|
|
data() {
|
|
@@ -233,19 +242,18 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async getData() {
|
|
async getData() {
|
|
- const code = getParam("code");
|
|
|
|
|
|
+ const code = getParam("code") || getDomain();
|
|
if (!code) {
|
|
if (!code) {
|
|
- window.alert("学校code丢失!");
|
|
|
|
|
|
+ this.$message.error("学校code丢失!");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
const res = await getSchoolInfo(code);
|
|
const res = await getSchoolInfo(code);
|
|
this.info = res.data.data;
|
|
this.info = res.data.data;
|
|
- if (!this.info.version) {
|
|
|
|
- this.$message.error("数据错误!");
|
|
|
|
|
|
+ if (!this.info.packagePath) {
|
|
|
|
+ this.$message.error("下载地址丢失!");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleSelect(key, keyPath) {
|
|
handleSelect(key, keyPath) {
|
|
- console.log(key, keyPath);
|
|
|
|
const parentId = keyPath[0];
|
|
const parentId = keyPath[0];
|
|
const pmenu = this.menus.find((item) => item.id === parentId);
|
|
const pmenu = this.menus.find((item) => item.id === parentId);
|
|
if (!pmenu) return;
|
|
if (!pmenu) return;
|