测试代码的可用性
import ajax from ‘./ajax‘ /* 用户模块 */ /* 获取验证码 */ export const getcode = (code) => ajax({ url: ‘/user/handleEmail/getcode‘, type: ‘post‘, params: code }) /* 注册用户 */ export const registerUser = (data) => ajax({ url: ‘/user/useradmin/register‘, type: ‘post‘, params: data }) /* 用户登录 */ export const loginUser = (data) => ajax({ url: ‘/user/useradmin/loginUser‘, type: ‘post‘, params: data }) /* 检验邮箱 */ export const checkCode = (data) => ajax({ url: ‘/user/handleEmail/checkcode‘, type: ‘post‘, params: data }) // 验证码是否正确 export const matchCode = (data) => ajax({ url: ‘/user/handleEmail/matchcode‘, type: ‘post‘, params: data }) //重置密码 export const resetPasswords = (data) => ajax({ url: ‘/user/useradmin/resetPasswords‘, type: ‘post‘, params: data }) /* 用户退出 */ export const signOut = () => ajax({ url: ‘/user/useradmin/signOut‘, type: ‘post‘ })
<template> <div class="user-action-container"> <el-menu ref="item" mode="horizontal" background-color="#141619" menu-trigger="click" active-text-color="#ffb848" :unique-opened="true" @open="openItem" text-color="rgba(255,255,255,.6)"> <el-submenu index="1"> <template slot="title"> <el-badge class="item h_24 lh_24 " :value="3"> <i class="icon iconfont icon-lingdang ft_24 c_f"></i> </el-badge> </template> <el-menu-item index="1-1">选项1</el-menu-item> <el-menu-item index="1-2">选项2</el-menu-item> <el-menu-item index="1-3">选项3</el-menu-item> </el-submenu> <el-submenu index="2"> <template slot="title"> <i class="el-icon-chat-dot-square ft_24 c_f"></i> </template> <el-menu-item index="2-1">选项2-2</el-menu-item> <el-menu-item index="2-2">选项2-2</el-menu-item> <el-menu-item index="2-3">选项2-3</el-menu-item> </el-submenu> <el-submenu index="3"> <template slot="title"> <el-avatar src="/images/home/user_bg.png"></el-avatar> </template> <el-menu-item index="3-1">选项3-1</el-menu-item> <el-menu-item index="3-2">选项3-2</el-menu-item> <el-menu-item index="3-3" @click="_signOut"> <span class="icon iconfont icon-084tuichu mr_5"></span> <span> 退出 </span> </el-menu-item> </el-submenu> </el-menu> </div> </template> <script> import { signOut } from ‘~/plugins/api‘ import ruleMixin from ‘~/assets/mixin/userRuleMixin‘ export default { mixins: [ruleMixin], data () { return { timer: null }; }, methods: { openItem (index) { this.timer = setTimeout(() => { if (index !== ‘0‘) { this.$refs.item.close(index) } }, 5000) }, async _signOut () { let { code, message } = await signOut() location.reload() } }, beforeDestroy () { this.timer && clearTimeout(this.timer) } } </script> <style scoped lang="stylus"> .user-action-container >>>.el-submenu__title .el-submenu__icon-arrow display none >>>.el-submenu__title padding 0 13px border none !important .el-badge__content border none </style>
<template> <div class="user-action-container"> <el-menu ref="item" mode="horizontal" background-color="#141619" menu-trigger="click" active-text-color="#ffb848" :unique-opened="true" @open="openItem" text-color="rgba(255,255,255,.6)"> <el-submenu index="1"> <template slot="title"> <el-badge class="item h_24 lh_24 " :value="3"> <i class="icon iconfont icon-lingdang ft_24 c_f"></i> </el-badge> </template> <el-menu-item index="1-1">选项1</el-menu-item> <el-menu-item index="1-2">选项2</el-menu-item> <el-menu-item index="1-3">选项3</el-menu-item> </el-submenu> <el-submenu index="2"> <template slot="title"> <i class="el-icon-chat-dot-square ft_24 c_f"></i> </template> <el-menu-item index="2-1">选项2-2</el-menu-item> <el-menu-item index="2-2">选项2-2</el-menu-item> <el-menu-item index="2-3">选项2-3</el-menu-item> </el-submenu> <el-submenu index="3"> <template slot="title"> <el-avatar src="/images/home/user_bg.png"></el-avatar> </template> <el-menu-item index="3-1">选项3-1</el-menu-item> <el-menu-item index="3-2">选项3-2</el-menu-item> <el-menu-item index="3-3" @click="_signOut"> <span class="icon iconfont icon-084tuichu mr_5"></span> <span> 退出 </span> </el-menu-item> </el-submenu> </el-menu> </div> </template> <script> import { signOut } from ‘~/plugins/api‘ import ruleMixin from ‘~/assets/mixin/userRuleMixin‘ export default { mixins: [ruleMixin], data () { return { timer: null }; }, methods: { openItem (index) { this.timer = setTimeout(() => { if (index !== ‘0‘) { this.$refs.item.close(index) } }, 5000) }, async _signOut () { let { code, message } = await signOut() location.reload() } }, beforeDestroy () { this.timer && clearTimeout(this.timer) } } </script> <style scoped lang="stylus"> .user-action-container >>>.el-submenu__title .el-submenu__icon-arrow display none >>>.el-submenu__title padding 0 13px border none !important .el-badge__content border none </style>
相关推荐
咻咻ing 2020-05-28
lucialee 2020-03-03
80443361 2020-02-28
jszy 2020-02-24
mohanzb 2019-12-05
today0 2016-10-28
Testingba工作室 2016-03-17
灰蓝 2017-07-19
sharpljc 2011-12-20
phpboy 2011-12-19
phpboy 2011-08-12
yelinag 2016-03-16
liuuil0 2015-02-04
gilbertzhyin 2010-11-16
thug 2019-06-20
YBsisterchang 2012-01-06
xiaoyezihanghui 2019-05-23
花江 2017-12-07