rename canal-admin project to admin

This commit is contained in:
agapple
2019-10-09 14:50:08 +08:00
parent 9c75e25da7
commit 31562919bb
211 changed files with 54 additions and 33 deletions

View File

@@ -0,0 +1,20 @@
/**
* Created by PanJiaChen on 16/11/18.
*/
/**
* @param {string} path
* @returns {Boolean}
*/
export function isExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export function validUsername(str) {
const valid_map = ['admin', 'editor']
return valid_map.indexOf(str.trim()) >= 0
}