Skip to content

Commit

Permalink
依存ライブラリの更新
Browse files Browse the repository at this point in the history
axios 変更時に混入した細かな不具合を修正
  • Loading branch information
jkazama committed Jan 17, 2019
1 parent 90c9468 commit 1e678e6
Show file tree
Hide file tree
Showing 6 changed files with 1,200 additions and 1,443 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2018 jkazama
Copyright (c) 2016-2019 jkazama

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sample-ui-vue-pages",
"version": "2.0.0",
"version": "2.5.22",
"description": "Vue.js Boilerplate [Multi Page]",
"main": "src/js/common.js",
"scripts": {
Expand All @@ -9,19 +9,19 @@
},
"author": "jkazama",
"license": "MIT",
"repository" : {
"type" : "git",
"url" : "https://github.com/jkazama/sample-ui-vue-pages.git"
"repository": {
"type": "git",
"url": "https://github.com/jkazama/sample-ui-vue-pages.git"
},
"dependencies": {
"@fortawesome/fontawesome-free": "~5.3.0",
"axios": "~0.18.0",
"bootstrap": "~4.1.0",
"flatpickr": "~4.5.0",
"@fortawesome/fontawesome-free": "~5.3.0",
"jquery": "~3.3.0",
"popper.js": "~1.14.0",
"lodash": "~4.17.0",
"moment": "~2.22.0",
"axios": "~0.18.0",
"popper.js": "~1.14.0",
"vue": "~2.5.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/js/entry/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const app = new Vue({
}
let failure = (error) => {
this.updating = false
switch (error.status) {
switch (error.response.status) {
case 400:
this.messageError("IDまたはパスワードに誤りがあります", [], Level.WARN)
break
Expand Down
12 changes: 7 additions & 5 deletions src/js/platform/plain.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ axios.defaults.withCredentials = true
export class Ajax {
// GET形式のPromiseを返します。
static promiseGet(url, data = {}) {
return axios.get(this.requestUrl(url), { params: data })
const params = new URLSearchParams();
Object.keys(data).forEach((key) => params.append(key, data[key]))
return axios.get(this.requestUrl(url), {params: params})
}
// GET形式でサーバ側へリクエスト処理をします。
static get(url, data = {}, success = this.handleSuccess, failure = this.handleFailure) {
Expand All @@ -52,9 +54,9 @@ export class Ajax {
}
// POST形式のPromiseを返します。
static promisePost(url, data = {}) {
let form = new FormData()
Object.keys(data).forEach((key) => form.append(key, data[key]))
return axios.post(this.requestUrl(url), form)
const params = new URLSearchParams();
Object.keys(data).forEach((key) => params.append(key, data[key]))
return axios.post(this.requestUrl(url), params)
}
// POST形式でサーバ側へリクエスト処理をします。
static post(url, data = {}, success = this.handleSuccess, failure = this.handleFailure) {
Expand Down Expand Up @@ -97,7 +99,7 @@ export class Ajax {
// リクエスト失敗時の事前処理を行います。
static handlePreFailure(err) {
const res = err.response
if (res.status) {
if (res && res.status) {
Log.warn("[" + res.status + "] " + res.statusText)
switch (res.status) {
case 0:
Expand Down
3 changes: 3 additions & 0 deletions src/js/views/mixins/view-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ export default {
case 401:
message = "機能実行権限がありません"
break
case 403:
message = "機能実行権限がありません"
break
default:
message = "要求処理に失敗しました"
}
Expand Down
Loading

0 comments on commit 1e678e6

Please sign in to comment.