Skip to content

Commit

Permalink
fix: 路由拼写错误导致请求url错误 #286
Browse files Browse the repository at this point in the history
  • Loading branch information
boxshadow committed Apr 19, 2018
1 parent 19e3774 commit 67995b0
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions resources/assets/admin/components/pages/Cdn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,38 @@
</template>

<script>
import components from '../modules/cdn';
import Alert from '../modules/Alert';
import request, { createRequestURI } from '../../util/request';
import components from "../modules/cdn";
import Alert from "../modules/Alert";
import request, { createRequestURI } from "../../util/request";
export default {
name: 'page-cdn',
name: "page-cdn",
components: {
...components,
[Alert.name]: Alert,
[Alert.name]: Alert
},
data: () => ({
selecetd: 'filesystem',
loading: false,
selecetd: "filesystem",
loading: false
}),
methods: {
handleSelect (cdn) {
handleSelect(cdn) {
this.selecetd = cdn;
}
},
created () {
created() {
this.loading = true;
request.get(createRequestURI('cdn/seleced'), {
validateStatus: status => status === 200,
}).then(({ data: { seleced: cdn = 'filesystem' } }) => {
this.selecetd = cdn;
this.loading = false;
}).catch(({ response: { data = { message: '获取失败' } } = {} }) => {
this.loading = false;
this.$store.dispatch('alert-open', { type: 'danger', message: data });
});
request
.get(createRequestURI("cdn/selected"), {
validateStatus: status => status === 200
})
.then(({ data: { seleced: cdn = "filesystem" } }) => {
this.selecetd = cdn;
this.loading = false;
})
.catch(({ response: { data = { message: "获取失败" } } = {} }) => {
this.loading = false;
this.$store.dispatch("alert-open", { type: "danger", message: data });
});
}
};
</script>

0 comments on commit 67995b0

Please sign in to comment.