cli3 代码优化
This commit is contained in:
@@ -25,6 +25,13 @@
|
|||||||
"git add"
|
"git add"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/elunez/eladmin/issues"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"clipboard": "2.0.4",
|
"clipboard": "2.0.4",
|
||||||
"@riophae/vue-treeselect": "0.1.0",
|
"@riophae/vue-treeselect": "0.1.0",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ $menuHover:#263445;
|
|||||||
$subMenuBg:#1f2d3d;
|
$subMenuBg:#1f2d3d;
|
||||||
$subMenuHover:#001528;
|
$subMenuHover:#001528;
|
||||||
|
|
||||||
$sideBarWidth: 210px;
|
$sideBarWidth: 200px;
|
||||||
|
|
||||||
// the :export directive is the magic sauce for webpack
|
// the :export directive is the magic sauce for webpack
|
||||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||||
|
|
||||||
<el-tooltip content="Global Size" effect="dark" placement="bottom">
|
<el-tooltip content="布局设置" effect="dark" placement="bottom">
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</scroll-pane>
|
</scroll-pane>
|
||||||
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
||||||
<li @click="refreshSelectedTag(selectedTag)">Refresh</li>
|
<li @click="refreshSelectedTag(selectedTag)">刷新</li>
|
||||||
<li v-if="!(selectedTag.meta&&selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">Close</li>
|
<li v-if="!(selectedTag.meta&&selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">关闭</li>
|
||||||
<li @click="closeOthersTags">Close Others</li>
|
<li @click="closeOthersTags">关闭其他</li>
|
||||||
<li @click="closeAllTags(selectedTag)">Close All</li>
|
<li @click="closeAllTags(selectedTag)">关闭全部</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -348,3 +348,40 @@ export function removeClass(ele, cls) {
|
|||||||
ele.className = ele.className.replace(reg, ' ')
|
ele.className = ele.className.replace(reg, ' ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 替换邮箱字符
|
||||||
|
export function regEmail(email) {
|
||||||
|
if (String(email).indexOf('@') > 0) {
|
||||||
|
const str = email.split('@')
|
||||||
|
let _s = ''
|
||||||
|
if (str[0].length > 3) {
|
||||||
|
for (var i = 0; i < str[0].length - 3; i++) {
|
||||||
|
_s += '*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var new_email = str[0].substr(0, 3) + _s + '@' + str[1]
|
||||||
|
}
|
||||||
|
return new_email
|
||||||
|
}
|
||||||
|
|
||||||
|
// 替换手机字符
|
||||||
|
export function regMobile(mobile) {
|
||||||
|
if (mobile.length > 7) {
|
||||||
|
var new_mobile = mobile.substr(0, 3) + '****' + mobile.substr(7)
|
||||||
|
}
|
||||||
|
return new_mobile
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载文件
|
||||||
|
export function downloadFile(obj, name, suffix) {
|
||||||
|
const url = window.URL.createObjectURL(new Blob([obj]))
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.style.display = 'none'
|
||||||
|
link.href = url
|
||||||
|
const fileName = parseTime(new Date()) + '-' + name + '.' + suffix
|
||||||
|
link.setAttribute('download', fileName)
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { validatEmail } from '@/utils/validate'
|
import { validEmail } from '@/utils/validate'
|
||||||
import { updateEmail } from '@/api/user'
|
import { updateEmail } from '@/api/user'
|
||||||
import { resetEmail } from '@/api/code'
|
import { resetEmail } from '@/api/code'
|
||||||
export default {
|
export default {
|
||||||
@@ -39,7 +39,7 @@ export default {
|
|||||||
callback(new Error('新邮箱不能为空'))
|
callback(new Error('新邮箱不能为空'))
|
||||||
} else if (value === this.email) {
|
} else if (value === this.email) {
|
||||||
callback(new Error('新邮箱不能与旧邮箱相同'))
|
callback(new Error('新邮箱不能与旧邮箱相同'))
|
||||||
} else if (validatEmail(value)) {
|
} else if (validEmail(value)) {
|
||||||
callback()
|
callback()
|
||||||
} else {
|
} else {
|
||||||
callback(new Error('邮箱格式错误'))
|
callback(new Error('邮箱格式错误'))
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import { send } from '@/api/email'
|
import { send } from '@/api/email'
|
||||||
import { validatEmail } from '@/utils/validate'
|
import { validEmail } from '@/utils/validate'
|
||||||
import E from 'wangeditor'
|
import E from 'wangeditor'
|
||||||
export default {
|
export default {
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
@@ -96,7 +96,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
sub = true
|
sub = true
|
||||||
} else if (validatEmail(data.value)) {
|
} else if (validEmail(data.value)) {
|
||||||
_this.form.tos.push(data.value)
|
_this.form.tos.push(data.value)
|
||||||
} else {
|
} else {
|
||||||
_this.$message({
|
_this.$message({
|
||||||
|
|||||||
Reference in New Issue
Block a user