Skip to content

Commit e3a3951

Browse files
authored
Update version.vue
1 parent 79ebc0b commit e3a3951

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

client/version.vue

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="container">
33

4-
<form role="form" style="display:none" id="selectid"><strong>请选择appID:</strong>
4+
<form role="form" id="selectid"><strong>请选择appID:</strong>
55

66
<div class="form-group">
77
<select v-model="value" @change="changeFunc(value)" class="form-control">
@@ -14,7 +14,7 @@
1414
</form>
1515

1616

17-
<table class="table" style="display:none">
17+
<table class="table" >
1818
<caption><strong>app下版本号</strong></caption>
1919
<thead>
2020
<tr>
@@ -37,7 +37,7 @@
3737
<td><input v-model="editing.binMax" placeholder="可以不填,ex:5.0.0"/></td>
3838
<td><input v-model="editing.binMin" placeholder="可以不填,ex:1.0.0"/></td>
3939
<td>
40-
<button class="btn btn-info" @click="addApp" style="display:none;">添加</button>
40+
<button class="btn btn-info" @click="addApp" >添加</button>
4141
</td>
4242
</tr>
4343

@@ -69,7 +69,7 @@
6969
props: ["appid"],
7070
7171
http: {
72-
root: '/api'
72+
root: '/api/v1'
7373
},
7474
events: {
7575
"remove-app": function (app) {
@@ -151,14 +151,19 @@
151151
changeFunc: function (value) {
152152
153153
var self = this;
154-
// // GET request
155-
// self.$http({url: '/api/apps', method: 'GET'}).then(function (response) {
156-
// // success callback
157-
// self.myapp = response.data;
158-
// }, function (response) {
159-
// // error callback
160-
// });
161-
var resurl = 'apps/' + value + '/versions/:id';
154+
var access_token = localStorage.getItem('access_token');
155+
// console.log(access_token);
156+
157+
// GET request
158+
var httpurl = '/api/v1/apps?access_token=' + access_token;
159+
self.$http({url: httpurl, method: 'GET'}).then(function (response) {
160+
// success callback
161+
self.myapp = response.data;
162+
}, function (response) {
163+
// error callback
164+
});
165+
var access_token = localStorage.getItem('access_token');
166+
var resurl = 'apps/' + value + '/versions/:id?access_token=' + access_token;
162167
apps = self.$resource(resurl);
163168
this.fetchApps();
164169
@@ -167,17 +172,20 @@
167172
},
168173
ready: function () {
169174
var self = this;
175+
var access_token = localStorage.getItem('access_token');
176+
// console.log(access_token);
177+
170178
// GET request
171-
self.$http({url: '/api/apps', method: 'GET'}).then(function (response) {
179+
var httpurl = '/api/v1/apps?access_token=' + access_token;
180+
self.$http({url: httpurl, method: 'GET'}).then(function (response) {
172181
// success callback
173182
self.myapp = response.data;
174-
console.log(self.myapp[0].id);
183+
console.log(self.myapp[0]);
175184
self.changeFunc(self.myapp[0].id);
176185
}, function (response) {
177186
// error callback
178187
});
179-
180188
}
181189
182190
}
183-
</script>
191+
</script>

0 commit comments

Comments
 (0)