-
Notifications
You must be signed in to change notification settings - Fork 657
Upgrade to version 0.3.4 #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
} | ||
.loader-logo { | ||
width: 60px; | ||
height: 98px; | ||
height: 91px; | ||
position: fixed; | ||
left: 20%; | ||
top: 43%; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
window.SUCCESS_CODE = 9999 | ||
window.MAX_MAX_SUCCESS_CODE = 9998 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import Vue from 'vue' | ||
import Vuex from 'vuex' | ||
import createLogger from 'vuex/dist/logger' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个引入是不是有点问题 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import VuexPersistence from 'vuex-persist' | ||
import mutations from './mutations' | ||
import state from './state' | ||
|
@@ -18,11 +19,13 @@ const vuexLocal = new VuexPersistence({ | |
}), | ||
}) | ||
|
||
const debug = process.env.NODE_ENV !== 'production' | ||
|
||
export default new Vuex.Store({ | ||
state, | ||
getters, | ||
mutations, | ||
actions, | ||
plugins: [vuexLocal.plugin], | ||
strict: process.env.NODE_ENV !== 'production', | ||
plugins: debug ? [vuexLocal.plugin, createLogger()] : [vuexLocal.plugin], | ||
strict: debug, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ export default { | |
this.loading = false | ||
console.log(e) | ||
} | ||
if (res.code < window.SUCCESS_CODE) { | ||
if (res.code < window.MAX_SUCCESS_CODE) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个写法感觉有点问题, 既然是成功失败, 判断写在通用的组件里, 应用的时候使用 try catch是不是更好一些. 也不需要在window上挂全局变量 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
写在通用组件里,每次使用的时候还要引入,除非挂载在 vm 实例上 |
||
this.loading = false | ||
this.$message.success(`${res.message}`) | ||
this.resetForm(formName) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个块不拆分, 少一次请求, 其实也没啥问题