add root_url

This commit is contained in:
zhaofeng-shu33 2020-03-17 14:15:06 +08:00
parent d526dd8f46
commit 31fe83c1ba

View file

@ -130,8 +130,8 @@
}, },
getConfig() { getConfig() {
let vm = this; let vm = this;
let root_url = window.location.href.split('wp-admin')[0];
axios.get('/wp-content/plugins/wp-china-yes/api.php?get_config') axios.get(root_url + 'wp-content/plugins/wp-china-yes/api.php?get_config')
.then(function (response) { .then(function (response) {
vm.mirrors_form = response.data.data; vm.mirrors_form = response.data.data;
}) })
@ -175,8 +175,9 @@
data.append('custom_download_server', vm.mirrors_form.custom_download_server); data.append('custom_download_server', vm.mirrors_form.custom_download_server);
data.append('api_server', vm.mirrors_form.api_server); data.append('api_server', vm.mirrors_form.api_server);
data.append('download_server', vm.mirrors_form.download_server); data.append('download_server', vm.mirrors_form.download_server);
axios.post('/wp-content/plugins/wp-china-yes/api.php', data) let root_url = window.location.href.split('wp-admin')[0];
axios.post(root_url + 'wp-content/plugins/wp-china-yes/api.php', data)
.then(function (response) { .then(function (response) {
vm.$message({ vm.$message({
message: '保存成功', message: '保存成功',
@ -221,4 +222,4 @@
padding-top: 0; padding-top: 0;
} }
</style> </style>
</html> </html>