update 数据字典缓存&add momentjs
This commit is contained in:
@@ -106,9 +106,23 @@ export default {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
Cookies.set('token', res.data.token)
|
||||
|
||||
/** 保存dictlist */
|
||||
this.$http.get(this.$http.adornUrl('/sys/dict/data/getAll')).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
localStorage.setItem('dictList', JSON.stringify(res.data))
|
||||
} else {
|
||||
this.$message({
|
||||
message: '数据字典拉取失败,请检查!',
|
||||
type: 'error',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
this.$router.replace({ name: 'home' })
|
||||
})
|
||||
.catch((err) => {
|
||||
.catch(err => {
|
||||
this.$message({
|
||||
message: err.message,
|
||||
type: 'error',
|
||||
|
||||
Reference in New Issue
Block a user