update:请求版本

master
guoshuang 3 years ago
parent a0c1ea920c
commit 29bf3b4db0

@ -83,6 +83,7 @@ export default class ServerPage extends BasePage {
} }
onSubmit(): void { onSubmit(): void {
localStorage.removeItem('host');
this.$form.validate(async (valid: boolean) => { this.$form.validate(async (valid: boolean) => {
if (valid) { if (valid) {
const { host, port } = this.form; const { host, port } = this.form;
@ -98,6 +99,7 @@ export default class ServerPage extends BasePage {
throw e; throw e;
} }
server.setServerAddress({ address }); server.setServerAddress({ address });
localStorage.setItem('host', host);
uni.showToast({ uni.showToast({
//icon: 'success', //icon: 'success',
title: this.$t('message.SetServerSuccessfully') as string, title: this.$t('message.SetServerSuccessfully') as string,

@ -160,7 +160,9 @@ class SessionService extends VuexModule {
//查询版本号 //查询版本号
@MutationAction @MutationAction
async QueryVersion() { async QueryVersion() {
const res: any = await request.get('https://seamom.haier.net/sgNginxDownload/Debug/setup.json'); const a = localStorage.getItem('host');
console.log('a', a);
const res: any = await request.get(a + '/sgNginxDownload/Debug/setup.json');
const Version = res.version; const Version = res.version;
const url = res.url + '/' + res.file; const url = res.url + '/' + res.file;
console.log('url..........', url); console.log('url..........', url);

Loading…
Cancel
Save