注销逻辑转移到 vuex
Former-commit-id: f31a633b971c45a544a373c581ef603941cae327 [formerly 23fdc68df2f8fc6fd5c4e69ca8b7d884fe53decf] [formerly f31a633b971c45a544a373c581ef603941cae327 [formerly 23fdc68df2f8fc6fd5c4e69ca8b7d884fe53decf] [formerly f31a633b971c45a544a373c581ef603941cae327 [formerly 23fdc68df2f8fc6fd5c4e69ca8b7d884fe53decf] [formerly 23fdc68df2f8fc6fd5c4e69ca8b7d884fe53decf [formerly b31ed8b7ee9f03071b452e3b7086b06bf261078f [formerly 6c23c54805a07c133be8e8b70752ed73bbf34a13]]]]] Former-commit-id: 044f1437f929847962bd7eb7f753b8770bccde9e Former-commit-id: 5bde6cd5f3c5af8a0c1a9ac1e61f69fff025c61c Former-commit-id: 169a1a6c4eb0c0522a30b6d9bc3f8c078f725d9e [formerly 9cb800d61661dc15361191620058015de2217714] Former-commit-id: fc88ea03ef389486d001dbcb05798f6340b8bbb7 Former-commit-id: 9c101f9a8098d7f2c411b38a518281ecfeb535f5 Former-commit-id: 6134dbd30721e57493ae936127967df8453c95e2 Former-commit-id: 7657a1fb82e736be0caab9b3c9b3df2b549b9d61 Former-commit-id: de7f04298e233f2e6c5b42fbbbe8f877c9ba44a6
This commit is contained in:
parent
31c16f2d3a
commit
ca97c5ca4f
|
|
@ -19,9 +19,11 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
background: #757F9A;
|
||||
background: -webkit-linear-gradient(to top, #D7DDE8, #757F9A);
|
||||
background: linear-gradient(to top, #D7DDE8, #757F9A);
|
||||
/* background: #757F9A; */
|
||||
/* background: -webkit-linear-gradient(to top, #D7DDE8, #757F9A); */
|
||||
/* background: linear-gradient(to top, #D7DDE8, #757F9A); */
|
||||
background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.15) 100%), radial-gradient(at top center, rgba(255,255,255,0.40) 0%, rgba(0,0,0,0.40) 120%) #989898;
|
||||
background-blend-mode: multiply,multiply;
|
||||
}
|
||||
.d2-app-loading-title {
|
||||
color: #FFF;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
// 插件
|
||||
import Cookies from 'js-cookie'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import { mapState, mapActions } from 'vuex'
|
||||
export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
|
|
@ -19,29 +17,16 @@ export default {
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
'd2adminUtilDbRemoveByUuid'
|
||||
...mapActions([
|
||||
'd2adminLogout'
|
||||
]),
|
||||
/**
|
||||
* @description 登出
|
||||
*/
|
||||
logOff () {
|
||||
this.$confirm('注销此账户吗?', '注销', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 删除用户信息
|
||||
this.d2adminUtilDbRemoveByUuid({
|
||||
key: 'userInfo',
|
||||
emptyValue: ''
|
||||
})
|
||||
// 删除cookie
|
||||
Cookies.remove('token')
|
||||
Cookies.remove('uuid')
|
||||
// 跳转路由
|
||||
this.$router.push({
|
||||
name: 'login'
|
||||
})
|
||||
}).catch(() => {
|
||||
// 取消了注销
|
||||
this.d2adminLogout({
|
||||
vm: this,
|
||||
confirm: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ const userDB = [
|
|||
name: '编辑'
|
||||
},
|
||||
{
|
||||
username: 'user',
|
||||
password: 'user',
|
||||
uuid: 'user-uuid',
|
||||
name: '一般用户'
|
||||
username: 'user1',
|
||||
password: 'user1',
|
||||
uuid: 'user1-uuid',
|
||||
name: '用户1'
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,9 @@ export default {
|
|||
password: 'editor'
|
||||
},
|
||||
{
|
||||
name: '用户',
|
||||
username: 'user',
|
||||
password: 'user'
|
||||
name: '用户1',
|
||||
username: 'user1',
|
||||
password: 'user1'
|
||||
}
|
||||
],
|
||||
// 表单
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
cb5203e7da4a54f17ca8f08ae175eae15db544f0
|
||||
ba1f2c6d38619c095d25a69254227124c5bc6000
|
||||
|
|
@ -12,6 +12,7 @@ module.exports = {
|
|||
publicPath: '/d2-admin-preview/' // 和 baseUrl 保持一致
|
||||
},
|
||||
// webpack 设置
|
||||
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
|
||||
chainWebpack: config => {
|
||||
// markdown
|
||||
config.module
|
||||
|
|
@ -48,8 +49,12 @@ module.exports = {
|
|||
.add(resolve('src/assets/svg-icons/icons'))
|
||||
.end()
|
||||
// 重新设置 alias
|
||||
config.resolve
|
||||
.alias
|
||||
config.resolve.alias
|
||||
.set('@', resolve('src'))
|
||||
// babel-polyfill 加入 entry
|
||||
const entry = config.entry('app')
|
||||
entry
|
||||
.add('babel-polyfill')
|
||||
.end()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue