33
33
<li >申請時間:{{ dateParsedCreatedAt }}</li >
34
34
</ul >
35
35
<ul class =" mb-3" >
36
- <li >IP 位址:{{ application.ip_address }}</li >
36
+ <li >IP 位址:{{ application.ipAddress }}</li >
37
37
<li >IP 地理資訊:
38
38
<ul class =" pl-3" >
39
- <li >國家:{{ application.ip_geolocation .country }}</li >
40
- <li >城市:{{ application.ip_geolocation .city }}</li >
41
- <li >時區:{{ application.ip_geolocation .timezone }}</li >
39
+ <li >國家:{{ application.ipGeolocation .country }}</li >
40
+ <li >城市:{{ application.ipGeolocation .city }}</li >
41
+ <li >時區:{{ application.ipGeolocation .timezone }}</li >
42
42
</ul >
43
43
</li >
44
44
</ul >
66
66
</li >
67
67
</ul >
68
68
</p >
69
- <div v-if =" !application.approval_by " class =" flex justify-end mt-4" >
69
+ <div v-if =" !application.commitBy " class =" flex justify-end mt-4" >
70
70
<button
71
71
class =" flex items-center justify-center bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 mx-1 rounded-full"
72
72
@click =" approval" >
79
79
</button >
80
80
</div >
81
81
<p v-else class =" mt-2 text-amber-600" >
82
- 已由 {{ application.approval_by }} 於 {{ dateParsedApprovalAt }} 許可
82
+ 已由 {{ application.commitBy }} 於 {{ dateParsedApprovalAt }} 簽署 {{ application.commitState ? '許可' : '否決' }}
83
83
</p >
84
84
</div >
85
85
</div >
@@ -133,18 +133,24 @@ export default {
133
133
}
134
134
},
135
135
async approval () {
136
- const options = {params: {code: this .query }};
136
+ const options = {params: {
137
+ code: this .query ,
138
+ state: " true" ,
139
+ }};
137
140
try {
138
- await this .$axios .patch (" application " , null , options)
141
+ await this .$axios .patch (" applications " , null , options)
139
142
await this .submit ()
140
143
} catch (e) {
141
144
console .error (e)
142
145
}
143
146
},
144
147
async reject () {
145
- const options = {params: {code: this .query }};
148
+ const options = {params: {
149
+ code: this .query ,
150
+ state: " false" ,
151
+ }};
146
152
try {
147
- await this .$axios .delete ( " application " , options)
153
+ await this .$axios .patch ( " applications " , null , options)
148
154
this .application = {}
149
155
} catch (e) {
150
156
console .error (e)
@@ -154,24 +160,24 @@ export default {
154
160
computed: {
155
161
uaParsed () {
156
162
const {
157
- user_agent : uaString ,
163
+ userAgent : uaString ,
158
164
} = this .application ;
159
165
return uaParser (uaString);
160
166
},
161
167
dateParsedCreatedAt () {
162
168
const {
163
- created_at : createdAt ,
169
+ createdAt ,
164
170
} = this .application ;
165
171
return this .dateToHuman (
166
- createdAt * 1000 ,
172
+ createdAt,
167
173
);
168
174
},
169
175
dateParsedApprovalAt () {
170
176
const {
171
- approval_at : approvalAt ,
177
+ commitAt ,
172
178
} = this .application ;
173
179
return this .dateToHuman (
174
- approvalAt * 1000 ,
180
+ commitAt ,
175
181
);
176
182
},
177
183
},
0 commit comments