Commit 2af77db9 by hank

fix bug

parent e77faf9e
# just a flag
ENV = 'production'
# base api
VUE_APP_BASE_API = 'http://39.97.179.60:8092'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......@@ -64,8 +64,7 @@ export default [
}
return {
code: 20000,
data: info
info
}
}
},
......
......@@ -7,6 +7,7 @@
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:test": "vue-cli-service build --mode test",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --fix --ext .js,.vue src",
......
......@@ -35,8 +35,8 @@ const actions = {
return new Promise((resolve, reject) => {
login({ username: username.trim(), password: password }).then(response => {
const { data } = response
commit('SET_TOKEN', data.token)
setToken(data.token)
commit('SET_TOKEN', data)
setToken(data)
resolve()
}).catch(error => {
reject(error)
......@@ -48,7 +48,7 @@ const actions = {
getInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo(state.token).then(response => {
const { data } = response
const data = response
if (!data) {
reject('Verification failed, please Login again.')
......
......@@ -44,7 +44,7 @@ service.interceptors.response.use(
*/
response => {
const res = response.data
console.log(res.code, res.code !== 'undefined', String(res.code))
console.log(res.code, res.code !== '0', String(res.code))
// if the custom code is not 20000, it is judged as an error.
if (res.code !== '0' && res.code) {
Message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment