mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-16 14:00:56 +08:00
fix installation for beta5
This commit is contained in:
@@ -97,6 +97,7 @@ export default {
|
||||
next()
|
||||
}
|
||||
}
|
||||
console.log('showMenu: ', !noMenu.includes(to.path))
|
||||
state.showMenu = !noMenu.includes(to.path)
|
||||
state.currentPath = to.path
|
||||
document.title = pathMap[to.name]
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
<div class="nickname">
|
||||
<p>Username:{{ userInfo && userInfo.username || '' }}</p>
|
||||
<p>Email:{{ userInfo && userInfo.email || '' }}</p>
|
||||
<p>Class:{{ userInfo && userInfo.class_text || '' }}</p>
|
||||
<el-tag size="small" effect="dark" class="logout" @click="logout">Logout</el-tag>
|
||||
</div>
|
||||
</el-popover>
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
router.back()
|
||||
}
|
||||
router.afterEach((to) => {
|
||||
// console.log("Head afterEach to", to)
|
||||
console.log("Head afterEach to", to)
|
||||
const { id } = to.query
|
||||
state.name = pathMap[to.name]
|
||||
})
|
||||
|
||||
13
admin/src/utils/axios.js
vendored
13
admin/src/utils/axios.js
vendored
@@ -8,13 +8,14 @@ axios.defaults.withCredentials = true
|
||||
axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
|
||||
axios.defaults.headers['Content-Type'] = 'application/json'
|
||||
axios.defaults.headers['Accept'] = 'application/json'
|
||||
axios.defaults.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
// axios.defaults.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
|
||||
// axios.interceptors.request.use(config => {
|
||||
// // console.log('before request', config)
|
||||
// config.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
// return config
|
||||
// })
|
||||
axios.interceptors.request.use(config => {
|
||||
config.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
return config
|
||||
}, error => {
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
axios.interceptors.response.use(res => {
|
||||
console.log(res)
|
||||
|
||||
@@ -57,11 +57,9 @@ export default {
|
||||
if (valid) {
|
||||
api.login(state.ruleForm).then(res => {
|
||||
console.log(res)
|
||||
localSet('token', res.data.token)
|
||||
router.push({name: 'dashboard'})
|
||||
// api.getUserBase().then(res => {
|
||||
// localSet('userInfo', res.data)
|
||||
// })
|
||||
localSet('token', res.data.token)
|
||||
localSet('userInfo', res.data)
|
||||
router.push({name: 'dashboard'})
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
|
||||
Reference in New Issue
Block a user