Commit b8e9ab6b by zhanghui1

Merge branch 'zhanghui' into develop

parents cfc04940 5c645564
File added
......@@ -357,3 +357,6 @@ html,body {-webkit-tap-highlight-color: rgba(0, 0, 0,0); font-size: 0.28rem; bac
}
}
}
.login-reg{
}
\ No newline at end of file
<template>
<div class="captcha">
<input autofocus="true" class="left" ref="captchaIpt" type="text" v-model="captchaComputed" placeholder="请输入正确的验证码">
<img @click="newCaptcha" :src="captchaUrl" alt="">
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
props: ['captcha'],
beforeMount() {
this.captchaUrl = this.UC_BASEURL + '/captcha?' + new Date().getTime();
},
data() {
return {
captchaUrl: ''
}
},
computed: {
...mapState(["txt", 'UC_BASEURL']),
language() {
return this.$store.state.language || localStorage.getItem('language');
},
captchaComputed: {
get() {
return this.$props.captcha
},
set(captcha) {
this.$emit('dispatchCaptcha', captcha);
}
}
},
mounted() {
},
methods: {
newCaptcha() {
this.captchaUrl = this.UC_BASEURL + '/captcha?' + new Date().getTime();
},
focusCaptchaInput() {
// 这个地方有bug,用异步hack
setTimeout(() => {
this.$refs.captchaIpt.focus();
}, 100)
}
}
}
</script>
{
"data":
[
{
"code": "AL",
"text_en": "Albania(Shqipëri)",
"text_zh-cn": "阿尔巴尼亚",
"phone_country_code": "355",
"lang": "en"
},
{
"code": "DZ",
"text_en": "Algeria",
"text_zh-cn": "阿尔及利亚",
"phone_country_code": "213",
"lang": "en"
},
{
"code": "AF",
"text_en": "Afghanistan(‫افغانستان‬‎)",
"text_zh-cn": "阿富汗",
"phone_country_code": "93",
"lang": "en"
},
{
"code": "AR",
"text_en": "Argentina",
"text_zh-cn": "阿根廷",
"phone_country_code": "54",
"lang": "en"
},
{
"code": "AE",
"text_en": "UnitedArabEmirates(‫الإماراتالعربيةالمتحدة‬‎)",
"text_zh-cn": "阿拉伯联合酋长国",
"phone_country_code": "971",
"lang": "en"
},
{
"code": "AW",
"text_en": "Aruba",
"text_zh-cn": "阿鲁巴",
"phone_country_code": "297",
"lang": "en"
},
{
"code": "OM",
"text_en": "Oman(‫عُمان‬‎)",
"text_zh-cn": "阿曼",
"phone_country_code": "968",
"lang": "en"
},
{
"code": "AZ",
"text_en": "Azerbaijan(Azərbaycan)",
"text_zh-cn": "阿塞拜疆",
"phone_country_code": "994",
"lang": "en"
},
{
"code": "AC",
"text_en": "AscensionIsland",
"text_zh-cn": "阿森松岛",
"phone_country_code": "247",
"lang": "en"
},
{
"code": "EG",
"text_en": "Egypt(‫مصر‬‎)",
"text_zh-cn": "埃及",
"phone_country_code": "20",
"lang": "en"
},
{
"code": "ET",
"text_en": "Ethiopia",
"text_zh-cn": "埃塞俄比亚",
"phone_country_code": "251",
"lang": "en"
},
{
"code": "IE",
"text_en": "Ireland",
"text_zh-cn": "爱尔兰",
"phone_country_code": "353",
"lang": "en"
},
{
"code": "EE",
"text_en": "Estonia(Eesti)",
"text_zh-cn": "爱沙尼亚",
"phone_country_code": "372",
"lang": "en"
},
{
"code": "AD",
"text_en": "Andorra",
"text_zh-cn": "安道尔",
"phone_country_code": "376",
"lang": "en"
},
{
"code": "AO",
"text_en": "Angola",
"text_zh-cn": "安哥拉",
"phone_country_code": "244",
"lang": "en"
},
{
"code": "AG",
"text_en": "Antigua & Barbuda",
"text_zh-cn": "安提瓜和巴布达",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "AT",
"text_en": "Austria(Österreich)",
"text_zh-cn": "奥地利",
"phone_country_code": "43",
"lang": "en"
},
{
"code": "AU",
"text_en": "Australia",
"text_zh-cn": "澳大利亚",
"phone_country_code": "61",
"lang": "en"
},
{
"code": "MO",
"text_en": "Macau(澳門)",
"text_zh-cn": "澳门特别行政区",
"phone_country_code": "853",
"lang": "en"
},
{
"code": "BB",
"text_en": "Barbados",
"text_zh-cn": "巴巴多斯",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "PG",
"text_en": "PapuaNewGuinea",
"text_zh-cn": "巴布亚新几内亚",
"phone_country_code": "675",
"lang": "en"
},
{
"code": "BS",
"text_en": "Bahamas",
"text_zh-cn": "巴哈马",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "PK",
"text_en": "Pakistan(‫پاکستان‬‎)",
"text_zh-cn": "巴基斯坦",
"phone_country_code": "92",
"lang": "en"
},
{
"code": "PY",
"text_en": "Paraguay",
"text_zh-cn": "巴拉圭",
"phone_country_code": "595",
"lang": "en"
},
{
"code": "PS",
"text_en": "Palestine(‫فلسطين‬‎)",
"text_zh-cn": "巴勒斯坦民族权力机构",
"phone_country_code": "972",
"lang": "en"
},
{
"code": "BH",
"text_en": "Bahrain(‫البحرين‬‎)",
"text_zh-cn": "巴林",
"phone_country_code": "973",
"lang": "en"
},
{
"code": "PA",
"text_en": "Panama(Panamá)",
"text_zh-cn": "巴拿马",
"phone_country_code": "507",
"lang": "en"
},
{
"code": "BR",
"text_en": "Brazil(Brasil)",
"text_zh-cn": "巴西",
"phone_country_code": "55",
"lang": "en"
},
{
"code": "BY",
"text_en": "Belarus(Беларусь)",
"text_zh-cn": "白俄罗斯",
"phone_country_code": "375",
"lang": "en"
},
{
"code": "BM",
"text_en": "Bermuda",
"text_zh-cn": "百慕大群岛",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "BG",
"text_en": "Bulgaria(България)",
"text_zh-cn": "保加利亚",
"phone_country_code": "359",
"lang": "en"
},
{
"code": "MP",
"text_en": "NorthernMarianaIslands",
"text_zh-cn": "北马里亚纳群岛",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "BJ",
"text_en": "Benin(Bénin)",
"text_zh-cn": "贝宁",
"phone_country_code": "229",
"lang": "en"
},
{
"code": "BE",
"text_en": "Belgium",
"text_zh-cn": "比利时",
"phone_country_code": "32",
"lang": "en"
},
{
"code": "IS",
"text_en": "Iceland(Ísland)",
"text_zh-cn": "冰岛",
"phone_country_code": "354",
"lang": "en"
},
{
"code": "PL",
"text_en": "Poland(Polska)",
"text_zh-cn": "波兰",
"phone_country_code": "48",
"lang": "en"
},
{
"code": "BA",
"text_en": "Bosnia & Herzegovina(БоснаиХерцеговина)",
"text_zh-cn": "波斯尼亚和黑塞哥维那",
"phone_country_code": "387",
"lang": "en"
},
{
"code": "BO",
"text_en": "Bolivia",
"text_zh-cn": "玻利维亚",
"phone_country_code": "591",
"lang": "en"
},
{
"code": "BZ",
"text_en": "Belize",
"text_zh-cn": "伯利兹",
"phone_country_code": "501",
"lang": "en"
},
{
"code": "BW",
"text_en": "Botswana",
"text_zh-cn": "博茨瓦纳",
"phone_country_code": "267",
"lang": "en"
},
{
"code": "BT",
"text_en": "Bhutan(འབྲུག)",
"text_zh-cn": "不丹",
"phone_country_code": "975",
"lang": "en"
},
{
"code": "BF",
"text_en": "BurkinaFaso",
"text_zh-cn": "布基纳法索",
"phone_country_code": "226",
"lang": "en"
},
{
"code": "BI",
"text_en": "Burundi(Uburundi)",
"text_zh-cn": "布隆迪",
"phone_country_code": "257",
"lang": "en"
},
{
"code": "BV",
"text_en": "BouvetIsland",
"text_zh-cn": "布韦岛",
"phone_country_code": "47",
"lang": "en"
},
{
"code": "KP",
"text_en": "NorthKorea(조선민주주의인민공화국)",
"text_zh-cn": "朝鲜",
"phone_country_code": "850",
"lang": "en"
},
{
"code": "GQ",
"text_en": "EquatorialGuinea(GuineaEcuatorial)",
"text_zh-cn": "赤道几内亚",
"phone_country_code": "240",
"lang": "en"
},
{
"code": "DK",
"text_en": "Denmark(Danmark)",
"text_zh-cn": "丹麦",
"phone_country_code": "45",
"lang": "en"
},
{
"code": "DE",
"text_en": "Germany(Deutschland)",
"text_zh-cn": "德国",
"phone_country_code": "49",
"lang": "en"
},
{
"code": "TL",
"text_en": "Timor-Leste",
"text_zh-cn": "东帝汶",
"phone_country_code": "670",
"lang": "en"
},
{
"code": "TG",
"text_en": "Togo",
"text_zh-cn": "多哥",
"phone_country_code": "228",
"lang": "en"
},
{
"code": "DO",
"text_en": "DominicanRepublic(RepúblicaDominicana)",
"text_zh-cn": "多米尼加共和国",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "DM",
"text_en": "Dominica",
"text_zh-cn": "多米尼克",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "RU",
"text_en": "Russia(Россия)",
"text_zh-cn": "俄罗斯",
"phone_country_code": "7",
"lang": "en"
},
{
"code": "EC",
"text_en": "Ecuador",
"text_zh-cn": "厄瓜多尔",
"phone_country_code": "593",
"lang": "en"
},
{
"code": "ER",
"text_en": "Eritrea",
"text_zh-cn": "厄立特里亚",
"phone_country_code": "291",
"lang": "en"
},
{
"code": "FR",
"text_en": "France",
"text_zh-cn": "法国",
"phone_country_code": "33",
"lang": "en"
},
{
"code": "FO",
"text_en": "FaroeIslands(Føroyar)",
"text_zh-cn": "法罗群岛",
"phone_country_code": "298",
"lang": "en"
},
{
"code": "PF",
"text_en": "FrenchPolynesia(Polynésiefrançaise)",
"text_zh-cn": "法属波利尼西亚",
"phone_country_code": "689",
"lang": "en"
},
{
"code": "GF",
"text_en": "FrenchGuiana(Guyanefrançaise)",
"text_zh-cn": "法属圭亚那",
"phone_country_code": "594",
"lang": "en"
},
{
"code": "PH",
"text_en": "Philippines",
"text_zh-cn": "菲律宾",
"phone_country_code": "63",
"lang": "en"
},
{
"code": "FJ",
"text_en": "Fiji",
"text_zh-cn": "斐济群岛",
"phone_country_code": "679",
"lang": "en"
},
{
"code": "FI",
"text_en": "Finland(Suomi)",
"text_zh-cn": "芬兰",
"phone_country_code": "358",
"lang": "en"
},
{
"code": "CV",
"text_en": "CapeVerde(KabuVerdi)",
"text_zh-cn": "佛得角",
"phone_country_code": "238",
"lang": "en"
},
{
"code": "FK",
"text_en": "FalklandIslands(IslasMalvinas)",
"text_zh-cn": "福克兰群岛",
"phone_country_code": "500",
"lang": "en"
},
{
"code": "GM",
"text_en": "Gambia",
"text_zh-cn": "冈比亚",
"phone_country_code": "220",
"lang": "en"
},
{
"code": "CD",
"text_en": "Congo(DRC)(JamhuriyaKidemokrasiayaKongo)",
"text_zh-cn": "刚果(DRC)",
"phone_country_code": "243",
"lang": "en"
},
{
"code": "CG",
"text_en": "Congo(Republic)(Congo-Brazzaville)",
"text_zh-cn": "刚果共和国",
"phone_country_code": "242",
"lang": "en"
},
{
"code": "CO",
"text_en": "Colombia",
"text_zh-cn": "哥伦比亚",
"phone_country_code": "57",
"lang": "en"
},
{
"code": "CR",
"text_en": "CostaRica",
"text_zh-cn": "哥斯达黎加",
"phone_country_code": "506",
"lang": "en"
},
{
"code": "GG",
"text_en": "Guernsey",
"text_zh-cn": "格恩西岛",
"phone_country_code": "44",
"lang": "en"
},
{
"code": "GD",
"text_en": "Grenada",
"text_zh-cn": "格林纳达",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "GL",
"text_en": "Greenland(KalaallitNunaat)",
"text_zh-cn": "格陵兰",
"phone_country_code": "299",
"lang": "en"
},
{
"code": "GE",
"text_en": "Georgia(საქართველო)",
"text_zh-cn": "格鲁吉亚",
"phone_country_code": "995",
"lang": "en"
},
{
"code": "CU",
"text_en": "Cuba",
"text_zh-cn": "古巴",
"phone_country_code": "53",
"lang": "en"
},
{
"code": "GP",
"text_en": "Guadeloupe",
"text_zh-cn": "瓜德罗普岛",
"phone_country_code": "590",
"lang": "en"
},
{
"code": "GU",
"text_en": "Guam",
"text_zh-cn": "关岛",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "GY",
"text_en": "Guyana",
"text_zh-cn": "圭亚那",
"phone_country_code": "592",
"lang": "en"
},
{
"code": "KZ",
"text_en": "Kazakhstan(Казахстан)",
"text_zh-cn": "哈萨克斯坦",
"phone_country_code": "7",
"lang": "en"
},
{
"code": "HT",
"text_en": "Haiti",
"text_zh-cn": "海地",
"phone_country_code": "509",
"lang": "en"
},
{
"code": "KR",
"text_en": "SouthKorea(대한민국)",
"text_zh-cn": "韩国",
"phone_country_code": "82",
"lang": "en"
},
{
"code": "NL",
"text_en": "Netherlands(Nederland)",
"text_zh-cn": "荷兰",
"phone_country_code": "31",
"lang": "en"
},
{
"code": "AN",
"text_en": "Netherlands Antilles (Former)",
"text_zh-cn": "荷属安的列斯(前)",
"phone_country_code": "599",
"lang": "en"
},
{
"code": "ME",
"text_en": "Montenegro(CrnaGora)",
"text_zh-cn": "黑山",
"phone_country_code": "382",
"lang": "en"
},
{
"code": "HN",
"text_en": "Honduras",
"text_zh-cn": "洪都拉斯",
"phone_country_code": "504",
"lang": "en"
},
{
"code": "KI",
"text_en": "Kiribati",
"text_zh-cn": "基里巴斯",
"phone_country_code": "686",
"lang": "en"
},
{
"code": "DJ",
"text_en": "Djibouti",
"text_zh-cn": "吉布提",
"phone_country_code": "253",
"lang": "en"
},
{
"code": "KG",
"text_en": "Kyrgyzstan(Кыргызстан)",
"text_zh-cn": "吉尔吉斯斯坦",
"phone_country_code": "996",
"lang": "en"
},
{
"code": "GN",
"text_en": "Guinea(Guinée)",
"text_zh-cn": "几内亚",
"phone_country_code": "224",
"lang": "en"
},
{
"code": "GW",
"text_en": "Guinea-Bissau(Guiné-Bissau)",
"text_zh-cn": "几内亚比绍",
"phone_country_code": "245",
"lang": "en"
},
{
"code": "CA",
"text_en": "Canada",
"text_zh-cn": "加拿大",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "GH",
"text_en": "Ghana(Gaana)",
"text_zh-cn": "加纳",
"phone_country_code": "233",
"lang": "en"
},
{
"code": "GA",
"text_en": "Gabon",
"text_zh-cn": "加蓬",
"phone_country_code": "241",
"lang": "en"
},
{
"code": "KH",
"text_en": "Cambodia(កម្ពុជា)",
"text_zh-cn": "柬埔寨",
"phone_country_code": "855",
"lang": "en"
},
{
"code": "CZ",
"text_en": "CzechRepublic(Českárepublika)",
"text_zh-cn": "捷克共和国",
"phone_country_code": "420",
"lang": "en"
},
{
"code": "ZW",
"text_en": "Zimbabwe",
"text_zh-cn": "津巴布韦",
"phone_country_code": "263",
"lang": "en"
},
{
"code": "CM",
"text_en": "Cameroon(Cameroun)",
"text_zh-cn": "喀麦隆",
"phone_country_code": "237",
"lang": "en"
},
{
"code": "QA",
"text_en": "Qatar(‫قطر‬‎)",
"text_zh-cn": "卡塔尔",
"phone_country_code": "974",
"lang": "en"
},
{
"code": "KY",
"text_en": "CaymanIslands",
"text_zh-cn": "开曼群岛",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "CC",
"text_en": "Cocos(Keeling)Islands(KepulauanCocos(Keeling))",
"text_zh-cn": "科科斯群岛(基灵群岛)",
"phone_country_code": "61",
"lang": "en"
},
{
"code": "KM",
"text_en": "Comoros(‫جزرالقمر‬‎)",
"text_zh-cn": "科摩罗联盟",
"phone_country_code": "269",
"lang": "en"
},
{
"code": "CI",
"text_en": "Côted’Ivoire",
"text_zh-cn": "科特迪瓦共和国",
"phone_country_code": "225",
"lang": "en"
},
{
"code": "KW",
"text_en": "Kuwait(‫الكويت‬‎)",
"text_zh-cn": "科威特",
"phone_country_code": "965",
"lang": "en"
},
{
"code": "HR",
"text_en": "Croatia(Hrvatska)",
"text_zh-cn": "克罗地亚",
"phone_country_code": "385",
"lang": "en"
},
{
"code": "KE",
"text_en": "Kenya",
"text_zh-cn": "肯尼亚",
"phone_country_code": "254",
"lang": "en"
},
{
"code": "CK",
"text_en": "CookIslands",
"text_zh-cn": "库可群岛",
"phone_country_code": "682",
"lang": "en"
},
{
"code": "LV",
"text_en": "Latvia(Latvija)",
"text_zh-cn": "拉脱维亚",
"phone_country_code": "371",
"lang": "en"
},
{
"code": "LS",
"text_en": "Lesotho",
"text_zh-cn": "莱索托",
"phone_country_code": "266",
"lang": "en"
},
{
"code": "LA",
"text_en": "Laos(ລາວ)",
"text_zh-cn": "老挝",
"phone_country_code": "856",
"lang": "en"
},
{
"code": "LB",
"text_en": "Lebanon(‫لبنان‬‎)",
"text_zh-cn": "黎巴嫩",
"phone_country_code": "961",
"lang": "en"
},
{
"code": "LT",
"text_en": "Lithuania(Lietuva)",
"text_zh-cn": "立陶宛",
"phone_country_code": "370",
"lang": "en"
},
{
"code": "LR",
"text_en": "Liberia",
"text_zh-cn": "利比里亚",
"phone_country_code": "231",
"lang": "en"
},
{
"code": "LY",
"text_en": "Libya(‫ليبيا‬‎)",
"text_zh-cn": "利比亚",
"phone_country_code": "218",
"lang": "en"
},
{
"code": "LI",
"text_en": "Liechtenstein",
"text_zh-cn": "列支敦士登",
"phone_country_code": "423",
"lang": "en"
},
{
"code": "RE",
"text_en": "Réunion(LaRéunion)",
"text_zh-cn": "留尼汪",
"phone_country_code": "262",
"lang": "en"
},
{
"code": "LU",
"text_en": "Luxembourg",
"text_zh-cn": "卢森堡",
"phone_country_code": "352",
"lang": "en"
},
{
"code": "RW",
"text_en": "Rwanda",
"text_zh-cn": "卢旺达",
"phone_country_code": "250",
"lang": "en"
},
{
"code": "RO",
"text_en": "Romania(România)",
"text_zh-cn": "罗马尼亚",
"phone_country_code": "40",
"lang": "en"
},
{
"code": "MG",
"text_en": "Madagascar(Madagasikara)",
"text_zh-cn": "马达加斯加",
"phone_country_code": "261",
"lang": "en"
},
{
"code": "IM",
"text_en": "IsleofMan",
"text_zh-cn": "马恩岛",
"phone_country_code": "44",
"lang": "en"
},
{
"code": "MV",
"text_en": "Maldives",
"text_zh-cn": "马尔代夫",
"phone_country_code": "960",
"lang": "en"
},
{
"code": "MT",
"text_en": "Malta",
"text_zh-cn": "马耳他",
"phone_country_code": "356",
"lang": "en"
},
{
"code": "MW",
"text_en": "Malawi",
"text_zh-cn": "马拉维",
"phone_country_code": "265",
"lang": "en"
},
{
"code": "MY",
"text_en": "Malaysia",
"text_zh-cn": "马来西亚",
"phone_country_code": "60",
"lang": "en"
},
{
"code": "ML",
"text_en": "Mali",
"text_zh-cn": "马里",
"phone_country_code": "223",
"lang": "en"
},
{
"code": "MH",
"text_en": "MarshallIslands",
"text_zh-cn": "马绍尔群岛",
"phone_country_code": "692",
"lang": "en"
},
{
"code": "MQ",
"text_en": "Martinique",
"text_zh-cn": "马提尼克岛",
"phone_country_code": "596",
"lang": "en"
},
{
"code": "YT",
"text_en": "Mayotte",
"text_zh-cn": "马约特",
"phone_country_code": "262",
"lang": "en"
},
{
"code": "MU",
"text_en": "Mauritius(Moris)",
"text_zh-cn": "毛里求斯",
"phone_country_code": "230",
"lang": "en"
},
{
"code": "MR",
"text_en": "Mauritania(‫موريتانيا‬‎)",
"text_zh-cn": "毛利塔尼亚",
"phone_country_code": "222",
"lang": "en"
},
{
"code": "US",
"text_en": "UnitedStates",
"text_zh-cn": "美国",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "UM",
"text_en": "U.S.OutlyingIslands",
"text_zh-cn": "美属外岛",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "VI",
"text_en": "U.S.VirginIslands",
"text_zh-cn": "美属维尔京群岛",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "MN",
"text_en": "Mongolia(Монгол)",
"text_zh-cn": "蒙古",
"phone_country_code": "976",
"lang": "en"
},
{
"code": "MS",
"text_en": "Montserrat",
"text_zh-cn": "蒙特塞拉特",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "BD",
"text_en": "Bangladesh(বাংলাদেশ)",
"text_zh-cn": "孟加拉国",
"phone_country_code": "880",
"lang": "en"
},
{
"code": "PE",
"text_en": "Peru(Perú)",
"text_zh-cn": "秘鲁",
"phone_country_code": "51",
"lang": "en"
},
{
"code": "FM",
"text_en": "Micronesia",
"text_zh-cn": "密克罗尼西亚",
"phone_country_code": "691",
"lang": "en"
},
{
"code": "MM",
"text_en": "Myanmar(Burma)(မြန်မာ)",
"text_zh-cn": "缅甸",
"phone_country_code": "95",
"lang": "en"
},
{
"code": "MD",
"text_en": "Moldova(RepublicaMoldova)",
"text_zh-cn": "摩尔多瓦",
"phone_country_code": "373",
"lang": "en"
},
{
"code": "MA",
"text_en": "Morocco",
"text_zh-cn": "摩洛哥",
"phone_country_code": "212",
"lang": "en"
},
{
"code": "MC",
"text_en": "Monaco",
"text_zh-cn": "摩纳哥",
"phone_country_code": "377",
"lang": "en"
},
{
"code": "MZ",
"text_en": "Mozambique(Moçambique)",
"text_zh-cn": "莫桑比克",
"phone_country_code": "258",
"lang": "en"
},
{
"code": "MX",
"text_en": "Mexico(México)",
"text_zh-cn": "墨西哥",
"phone_country_code": "52",
"lang": "en"
},
{
"code": "NA",
"text_en": "Namibia(Namibië)",
"text_zh-cn": "纳米比亚",
"phone_country_code": "264",
"lang": "en"
},
{
"code": "ZA",
"text_en": "SouthAfrica",
"text_zh-cn": "南非",
"phone_country_code": "27",
"lang": "en"
},
{
"code": "AQ",
"text_en": "Antarctica",
"text_zh-cn": "南极洲",
"phone_country_code": "672",
"lang": "en"
},
{
"code": "NR",
"text_en": "Nauru",
"text_zh-cn": "瑙鲁",
"phone_country_code": "674",
"lang": "en"
},
{
"code": "NP",
"text_en": "Nepal(नेपाल)",
"text_zh-cn": "尼泊尔",
"phone_country_code": "977",
"lang": "en"
},
{
"code": "NI",
"text_en": "Nicaragua",
"text_zh-cn": "尼加拉瓜",
"phone_country_code": "505",
"lang": "en"
},
{
"code": "NE",
"text_en": "Niger(Nijar)",
"text_zh-cn": "尼日尔",
"phone_country_code": "227",
"lang": "en"
},
{
"code": "NG",
"text_en": "Nigeria",
"text_zh-cn": "尼日利亚",
"phone_country_code": "234",
"lang": "en"
},
{
"code": "NU",
"text_en": "Niue",
"text_zh-cn": "纽埃",
"phone_country_code": "683",
"lang": "en"
},
{
"code": "NO",
"text_en": "Norway(Norge)",
"text_zh-cn": "挪威",
"phone_country_code": "47",
"lang": "en"
},
{
"code": "PW",
"text_en": "Palau",
"text_zh-cn": "帕劳群岛",
"phone_country_code": "680",
"lang": "en"
},
{
"code": "PT",
"text_en": "Portugal",
"text_zh-cn": "葡萄牙",
"phone_country_code": "351",
"lang": "en"
},
{
"code": "MK",
"text_en": "Macedonia(FYROM)(Македонија)",
"text_zh-cn": "前南斯拉夫马其顿共和国",
"phone_country_code": "389",
"lang": "en"
},
{
"code": "JP",
"text_en": "Japan(日本)",
"text_zh-cn": "日本",
"phone_country_code": "81",
"lang": "en"
},
{
"code": "SE",
"text_en": "Sweden(Sverige)",
"text_zh-cn": "瑞典",
"phone_country_code": "46",
"lang": "en"
},
{
"code": "CH",
"text_en": "Switzerland(Schweiz)",
"text_zh-cn": "瑞士",
"phone_country_code": "41",
"lang": "en"
},
{
"code": "SV",
"text_en": "ElSalvador",
"text_zh-cn": "萨尔瓦多",
"phone_country_code": "503",
"lang": "en"
},
{
"code": "WS",
"text_en": "Samoa",
"text_zh-cn": "萨摩亚",
"phone_country_code": "685",
"lang": "en"
},
{
"code": "RS",
"text_en": "Serbia(Србија)",
"text_zh-cn": "塞尔维亚共和国",
"phone_country_code": "381",
"lang": "en"
},
{
"code": "SL",
"text_en": "SierraLeone",
"text_zh-cn": "塞拉利昂",
"phone_country_code": "232",
"lang": "en"
},
{
"code": "SN",
"text_en": "Senegal",
"text_zh-cn": "塞内加尔",
"phone_country_code": "221",
"lang": "en"
},
{
"code": "CY",
"text_en": "Cyprus(Κύπρος)",
"text_zh-cn": "塞浦路斯",
"phone_country_code": "357",
"lang": "en"
},
{
"code": "SC",
"text_en": "Seychelles",
"text_zh-cn": "塞舌尔",
"phone_country_code": "248",
"lang": "en"
},
{
"code": "SA",
"text_en": "SaudiArabia(‫المملكةالعربيةالسعودية‬‎)",
"text_zh-cn": "沙特阿拉伯",
"phone_country_code": "966",
"lang": "en"
},
{
"code": "CX",
"text_en": "ChristmasIsland",
"text_zh-cn": "圣诞岛",
"phone_country_code": "61",
"lang": "en"
},
{
"code": "ST",
"text_en": "SãoTomé & Príncipe(SãoToméePríncipe)",
"text_zh-cn": "圣多美和普林西比",
"phone_country_code": "239",
"lang": "en"
},
{
"code": "SH",
"text_en": "St.Helena",
"text_zh-cn": "圣赫勒拿-阿森松-特里斯坦达库尼亚",
"phone_country_code": "290",
"lang": "en"
},
{
"code": "KN",
"text_en": "St.Kitts & Nevis",
"text_zh-cn": "圣基茨和尼维斯",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "LC",
"text_en": "St.Lucia",
"text_zh-cn": "圣卢西亚",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "SM",
"text_en": "SanMarino",
"text_zh-cn": "圣马力诺",
"phone_country_code": "378",
"lang": "en"
},
{
"code": "PM",
"text_en": "St.Pierre & Miquelon(Saint-Pierre-et-Miquelon)",
"text_zh-cn": "圣皮埃尔岛和密克隆岛",
"phone_country_code": "508",
"lang": "en"
},
{
"code": "VC",
"text_en": "St.Vincent & Grenadines",
"text_zh-cn": "圣文森特和格林纳丁斯",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "VA",
"text_en": "VaticanCity(CittàdelVaticano)",
"text_zh-cn": "圣座(梵蒂冈)",
"phone_country_code": "379",
"lang": "en"
},
{
"code": "LK",
"text_en": "SriLanka(ශ්‍රීලංකාව)",
"text_zh-cn": "斯里兰卡",
"phone_country_code": "94",
"lang": "en"
},
{
"code": "SK",
"text_en": "Slovakia(Slovensko)",
"text_zh-cn": "斯洛伐克",
"phone_country_code": "421",
"lang": "en"
},
{
"code": "SI",
"text_en": "Slovenia(Slovenija)",
"text_zh-cn": "斯洛文尼亚",
"phone_country_code": "386",
"lang": "en"
},
{
"code": "SZ",
"text_en": "Swaziland",
"text_zh-cn": "斯威士兰",
"phone_country_code": "268",
"lang": "en"
},
{
"code": "SD",
"text_en": "Sudan(‫السودان‬‎)",
"text_zh-cn": "苏丹",
"phone_country_code": "249",
"lang": "en"
},
{
"code": "SR",
"text_en": "Suriname",
"text_zh-cn": "苏里南",
"phone_country_code": "597",
"lang": "en"
},
{
"code": "SB",
"text_en": "SolomonIslands",
"text_zh-cn": "所罗门群岛",
"phone_country_code": "677",
"lang": "en"
},
{
"code": "SO",
"text_en": "Somalia(Soomaaliya)",
"text_zh-cn": "索马里",
"phone_country_code": "252",
"lang": "en"
},
{
"code": "TJ",
"text_en": "Tajikistan",
"text_zh-cn": "塔吉克斯坦",
"phone_country_code": "992",
"lang": "en"
},
{
"code": "TW",
"text_en": "Taiwan(台灣)",
"text_zh-cn": "台湾",
"phone_country_code": "886",
"lang": "en"
},
{
"code": "TH",
"text_en": "Thailand(ไทย)",
"text_zh-cn": "泰国",
"phone_country_code": "66",
"lang": "en"
},
{
"code": "TZ",
"text_en": "Tanzania",
"text_zh-cn": "坦桑尼亚",
"phone_country_code": "255",
"lang": "en"
},
{
"code": "TO",
"text_en": "Tonga",
"text_zh-cn": "汤加",
"phone_country_code": "676",
"lang": "en"
},
{
"code": "TC",
"text_en": "Turks & CaicosIslands",
"text_zh-cn": "特克斯和凯科斯群岛",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "TA",
"text_en": "TristandaCunha",
"text_zh-cn": "特里斯坦达昆哈",
"phone_country_code": "290",
"lang": "en"
},
{
"code": "TT",
"text_en": "Trinidad & Tobago",
"text_zh-cn": "特立尼达和多巴哥",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "TN",
"text_en": "Tunisia",
"text_zh-cn": "突尼斯",
"phone_country_code": "216",
"lang": "en"
},
{
"code": "TV",
"text_en": "Tuvalu",
"text_zh-cn": "图瓦卢",
"phone_country_code": "688",
"lang": "en"
},
{
"code": "TR",
"text_en": "Turkey(Türkiye)",
"text_zh-cn": "土耳其",
"phone_country_code": "90",
"lang": "en"
},
{
"code": "TM",
"text_en": "Turkmenistan",
"text_zh-cn": "土库曼斯坦",
"phone_country_code": "993",
"lang": "en"
},
{
"code": "TK",
"text_en": "Tokelau",
"text_zh-cn": "托克劳",
"phone_country_code": "690",
"lang": "en"
},
{
"code": "WF",
"text_en": "Wallis & Futuna",
"text_zh-cn": "瓦利斯和富图纳",
"phone_country_code": "681",
"lang": "en"
},
{
"code": "VU",
"text_en": "Vanuatu",
"text_zh-cn": "瓦努阿图",
"phone_country_code": "678",
"lang": "en"
},
{
"code": "GT",
"text_en": "Guatemala",
"text_zh-cn": "危地马拉",
"phone_country_code": "502",
"lang": "en"
},
{
"code": "VG",
"text_en": "BritishVirginIslands",
"text_zh-cn": "维尔京群岛(英属)",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "VE",
"text_en": "Venezuela",
"text_zh-cn": "委内瑞拉",
"phone_country_code": "58",
"lang": "en"
},
{
"code": "BN",
"text_en": "Brunei",
"text_zh-cn": "文莱",
"phone_country_code": "673",
"lang": "en"
},
{
"code": "UG",
"text_en": "Uganda",
"text_zh-cn": "乌干达",
"phone_country_code": "256",
"lang": "en"
},
{
"code": "UA",
"text_en": "Ukraine(Україна)",
"text_zh-cn": "乌克兰",
"phone_country_code": "380",
"lang": "en"
},
{
"code": "UY",
"text_en": "Uruguay",
"text_zh-cn": "乌拉圭",
"phone_country_code": "598",
"lang": "en"
},
{
"code": "UZ",
"text_en": "Uzbekistan(Oʻzbekiston)",
"text_zh-cn": "乌兹别克斯坦",
"phone_country_code": "998",
"lang": "en"
},
{
"code": "ES",
"text_en": "Spain(España)",
"text_zh-cn": "西班牙",
"phone_country_code": "34",
"lang": "en"
},
{
"code": "GR",
"text_en": "Greece(Ελλάδα)",
"text_zh-cn": "希腊",
"phone_country_code": "30",
"lang": "en"
},
{
"code": "HK",
"text_en": "HongKong(香港)",
"text_zh-cn": "香港特别行政区",
"phone_country_code": "852",
"lang": "en"
},
{
"code": "SG",
"text_en": "Singapore",
"text_zh-cn": "新加坡",
"phone_country_code": "65",
"lang": "en"
},
{
"code": "NC",
"text_en": "NewCaledonia(Nouvelle-Calédonie)",
"text_zh-cn": "新喀里多尼亚",
"phone_country_code": "687",
"lang": "en"
},
{
"code": "NZ",
"text_en": "NewZealand",
"text_zh-cn": "新西兰",
"phone_country_code": "64",
"lang": "en"
},
{
"code": "HU",
"text_en": "Hungary(Magyarország)",
"text_zh-cn": "匈牙利",
"phone_country_code": "36",
"lang": "en"
},
{
"code": "SY",
"text_en": "Syria(‫سوريا‬‎)",
"text_zh-cn": "叙利亚",
"phone_country_code": "963",
"lang": "en"
},
{
"code": "JM",
"text_en": "Jamaica",
"text_zh-cn": "牙买加",
"phone_country_code": "1",
"lang": "en"
},
{
"code": "AM",
"text_en": "Armenia(Հայաստան)",
"text_zh-cn": "亚美尼亚",
"phone_country_code": "374",
"lang": "en"
},
{
"code": "SJ",
"text_en": "Svalbard & JanMayen(SvalbardogJanMayen)",
"text_zh-cn": "扬马延岛",
"phone_country_code": "47",
"lang": "en"
},
{
"code": "YE",
"text_en": "Yemen(‫اليمن‬‎)",
"text_zh-cn": "也门",
"phone_country_code": "967",
"lang": "en"
},
{
"code": "IQ",
"text_en": "Iraq(‫العراق‬‎)",
"text_zh-cn": "伊拉克",
"phone_country_code": "964",
"lang": "en"
},
{
"code": "IR",
"text_en": "Iran(‫ایران‬‎)",
"text_zh-cn": "伊朗",
"phone_country_code": "98",
"lang": "en"
},
{
"code": "IL",
"text_en": "Israel(‫ישראל‬‎)",
"text_zh-cn": "以色列",
"phone_country_code": "972",
"lang": "en"
},
{
"code": "IT",
"text_en": "Italy(Italia)",
"text_zh-cn": "意大利",
"phone_country_code": "39",
"lang": "en"
},
{
"code": "IN",
"text_en": "India(भारत)",
"text_zh-cn": "印度",
"phone_country_code": "91",
"lang": "en"
},
{
"code": "ID",
"text_en": "Indonesia",
"text_zh-cn": "印度尼西亚",
"phone_country_code": "62",
"lang": "en"
},
{
"code": "UK",
"text_en": "UK",
"text_zh-cn": "英国",
"phone_country_code": "44",
"lang": "en"
},
{
"code": "IO",
"text_en": "BritishIndianOceanTerritory",
"text_zh-cn": "英属印度洋领地",
"phone_country_code": "44",
"lang": "en"
},
{
"code": "JO",
"text_en": "Jordan(‫الأردن‬‎)",
"text_zh-cn": "约旦",
"phone_country_code": "962",
"lang": "en"
},
{
"code": "VN",
"text_en": "Vietnam(ViệtNam)",
"text_zh-cn": "越南",
"phone_country_code": "84",
"lang": "en"
},
{
"code": "ZM",
"text_en": "Zambia",
"text_zh-cn": "赞比亚",
"phone_country_code": "260",
"lang": "en"
},
{
"code": "JE",
"text_en": "Jersey",
"text_zh-cn": "泽西",
"phone_country_code": "44",
"lang": "en"
},
{
"code": "TD",
"text_en": "Chad(Tchad)",
"text_zh-cn": "乍得",
"phone_country_code": "235",
"lang": "en"
},
{
"code": "GI",
"text_en": "Gibraltar",
"text_zh-cn": "直布罗陀",
"phone_country_code": "350",
"lang": "en"
},
{
"code": "CL",
"text_en": "Chile",
"text_zh-cn": "智利",
"phone_country_code": "56",
"lang": "en"
},
{
"code": "CF",
"text_en": "CentralAfricanRepublic(Républiquecentrafricaine)",
"text_zh-cn": "中非共和国",
"phone_country_code": "236",
"lang": "en"
},
{
"code": "CN",
"text_en": "China(中国)",
"text_zh-cn": "中国",
"phone_country_code": "86",
"lang": "zh-cn"
}
]
}
\ No newline at end of file
import axios from 'axios';
// import conf from './../config';
// let helpers = {};
// const domainUrl = conf.domain_url;
// export const getBus = (apiName, params, apiParams = {}) => {
// let url = conf.api[apiName];
// if ( ! url ) { // 如果取不到
// throw new Error('get DataBus not match url');
// }
// for (let _key in apiParams) {
// let value = apiParams[_key];
// let regArr = ['\{', _key, '\}'];
// // let regExp = new RegExp(regArr.join(''), 'igm');
// let regExp = new RegExp('\{'+_key+'\}', 'igm');
// url = url.replace(regExp, value);
// }
// // 获取token
// let access_token = localStorage.getItem('access_token');
// return new Promise((resolve, reject) => {
// axios.get(domainUrl+url, {
// params: params,
// headers: {
// // Authorization: 'Bearer ' + access_token
// }
// // withCredentials: true
// }).then( (response) => {
// resolve(response.data);
// }).catch( (error) => { // 该error是个json。
// let errorMsg = 'Network Error';
// if (error.response) {
// let errorStatus = error.response.status;
// switch (errorStatus) {
// case 401: // 未登录
// errorMsg = 'Please Login';
// break;
// case 500:
// default:
// if (error.response.data.message) {
// errorMsg = error.response.data.message;
// }
// break;
// }
// // console.log(error.response);
// } else {
// // console.log(error.message);
// }
// lolpool && lolpool.$message && lolpool.$message.error(errorMsg, 5);
// });
// });
// };
// export const postBus = (apiName, params, apiParams) => {
// let url = conf.api[apiName];
// if ( ! url ) { // 如果取不到url
// throw new Error('post DataBus not match url');
// }
// for (let _key in apiParams) {
// let value = apiParams[_key];
// let regArr = ['\{', _key, '\}'];
// let regExp = new RegExp('\{'+_key+'\}', 'igm');
// url = url.replace(regExp, value);
// }
// // 获取token
// let access_token = localStorage.getItem('access_token');
// return new Promise((resolve, reject) => {
// axios.post(domainUrl+url, params, {
// headers: {
// // 'Content-Type': 'application/x-www-form-urlencoded',
// // Authorization: 'Bearer ' + access_token
// }
// // withCredentials: true
// }).then( (response) => {
// resolve(response.data);
// }).catch( (error) => {
// let errorMsg = 'Network Error';
// if (error.response) {
// let errorStatus = error.response.status;
// switch (errorStatus) {
// case 401: // 未登录
// errorMsg = 'Please Login';
// break;
// case 500:
// default:
// if (error.response.data.message) {
// errorMsg = error.response.data.message;
// }
// break;
// }
// }
// lolpool && lolpool.$message && lolpool.$message.error(errorMsg, 5);
// });
// });
// }
// export const renderFullUrl = (api, apiParams) => {
// for (let _key in apiParams) {
// let value = apiParams[_key];
// let regArr = ['\{', _key, '\}'];
// // let regExp = new RegExp(regArr.join(''), 'igm');
// let regExp = new RegExp('\{'+_key+'\}', 'igm');
// api = api.replace(regExp, value);
// }
// return api;
// }
export const apiErrMap = (errNo, errMsg) => {
if (errNo == 0) {
return {
errNo: 0,
errMsg: ''
};
}
if (errNo == -1) {
return {
errNo: -1,
errMsg
};
}
// todo: 翻译
const errMap = new Map()
.set(100, '步骤不正确')
.set(1000, '请输入验证码')
.set(1001, '验证码错误')
.set(1010, '用户已存在')
.set(1011, '用户不存在')
.set(1012, '用户被锁定')
.set(1013, '登录次数过多')
.set(1014, '密码错误')
.set(1015, 'invalid totp code')
.set(1020, '验证码过多')
.set(1021, '无效手机号')
.set(1022, '邮箱地址无效')
.set(1023, '电话号码不支持')
.set(1024, 'sms rate limited');
errMsg = errMap.get(errNo);
if (errMsg) {
return {
errNo,
errMsg
}
}
return {
errNo,
errMsg: '网络错误'
}
}
export const isEmailAddress = (str) => {
return new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$').test(str);
}
export const isVerifyCode = (str) => {
return new RegExp('^[a-z0-9A-Z]{4}$').test(str);
}
export const api = {
// 邮箱注册api
'post-register-email-start': '/register/email/start',
'post-register-email-verify-code': '/register/email/verify-code',
'post-register-email-password': '/register/email/password',
// 手机注册api
'post-register-mobile-start': '/register/mobile/start',
'post-register-mobile-verify-code': '/register/mobile/verify-code',
'post-register-mobile-password': '/register/mobile/password',
// 登录
'post-login-start': '/login/start',
'post-login-mobile': '/login/start/mobile',
'post-login-password': '/login/password',
'post-login-totp': '/login/totp',
'post-login-code': '/login/code',
// 重置密码
'post-reset-start': '/reset/start',
'post-reset-send-code': '/reset/send-code',
'post-reset-verify': '/reset/verify',
'post-reset-password': '/reset/password',
// 登出
'get-logout-do': '/logout/do',
// 获取用户信息
'get-userinfo': '/userinfo',
}
// export const getServices = (serviceName) => {
// }
<template>
<div class="page">
<div class="page-header">
<div class="l" @click="goBack"><span class="icon-back"><i class="iconfont icon-fanhui"></i></span></div>
<div class="c">登录</div>
<div class="r"><span class="txt abs-right">注册</span></div>
</div>
<div class="page-content uc-login">
<!-- 邮箱登录 -->
<div class="login-emial" v-if="useMail">
<input type="email" ref="emailActIpt" v-model="form.email" placeholder="mail@example.com" />
<div v-show="showEmailCaptcha">
<captcha ref="emailCaptcha" :captcha="form.captcha" @dispatchCaptcha="getCaptchaValue"></captcha>
</div>
<input type="password" ref="emailPwd" v-model="form.password" placeholder="请输入密码">
</div>
<!-- 手机登录 -->
<div class="login-mobile" v-else>
<select class="mobile-country" v-model="form.country" aria-label="国家/地区代码">
<option v-for="(item, index) in countryInfo" :key="index" :value="item.phone_country_code">
<!-- todo: 电话号码语言联动 -->
{{ item['text_zh-cn'] + ' +' + item['phone_country_code'] }}
</option>
</select>
<input type="text" ref="mobileActIpt" v-model="form.email" placeholder="请输入手机号码" />
<div v-show="showMobileCaptcha">
<captcha ref="mobileCaptcha" :captcha="form.captcha" @dispatchCaptcha="getCaptchaValue"></captcha>
</div>
<input type="password" ref="mobilePwd" v-model="form.password" placeholder="请输入密码">
</div>
<div class="error-tip" v-show="errTipMsg != ''">{{errTipMsg}}</div>
<button @click="goLogin" :disabled="showLoading" :isLoading="showLoading">{{ showLoading ? '' : '登录' }}</button>
<div class="clearfix">
<a class="left" @click="switchLogin">{{ useMail ? '使用手机号登录' : '使用邮箱登录' }}</a>
<router-link class="right" v-show="!useMail" to="/sign-up-mobile">注册</router-link>
<router-link class="right" v-show="useMail" to="/sign-up-email">注册</router-link>
</div>
</div>
</div>
</template>
<script>
window.config = { appName: "Blockin Account", baseUrl: "https://ucdev1212.blockin.com", locale: "zh-cn", user: null };
import { mapState } from 'vuex'
import countryInfo from './country_info.json'
import captcha from './captcha.vue'
import { apiErrMap, isEmailAddress, isVerifyCode, api } from './helpers.js';
export default {
components: {
captcha
},
beforeMount() {
this.useMail = localStorage.getItem('login-type') == 'email';
this.form.country = '86';
// 渲染上次登录
let accountInfo = localStorage.getItem('account-info');
if (accountInfo) {
accountInfo = JSON.parse(accountInfo);
if (accountInfo.account) { // 有账号信息
if (accountInfo.type == 'mobile') {
let phoneNumber = accountInfo.account.split('|');
this.form.country = phoneNumber[0] ? phoneNumber[0] : '';
this.form.email = phoneNumber[1] ? phoneNumber[1] : '';
} else {
this.form.email = accountInfo.account ? accountInfo.account : '';
}
}
this.useMail = accountInfo.type == 'email';
}
},
mounted() {},
computed: {
...mapState(["txt", 'UC_BASEURL']),
},
data() {
return {
countryInfo: countryInfo.data,
errTipMsg: '',
form: { "country": "86", "captcha": "", "email": "", "password": "" },
showEmailCaptcha: false,
showLoading: false,
showMobileCaptcha: false,
step: 1,
useMail: false
}
},
methods: {
async goLogin() {
if (this.showLoading) {
return '';
}
this.errTipMsg = '';
let email = ''; // 用于浏览器端保存用户账号信息
this.showLoading = true;
if (this.useMail) { // 邮箱登录
// 检测参数是否存在
if (!isEmailAddress(this.form.email)) {
this.showErrorTip(-1, '请输入正确的邮箱地址');
return;
}
if (this.showEmailCaptcha && !isVerifyCode(this.form.captcha)) {
this.showErrorTip(-1, '请输入正确的验证码');
return;
}
if (this.form.password == '') {
this.showErrorTip(-1, '请输入密码');
return;
}
email = this.form.email;
const { data: accountResponse } = await this.$axios
.post(this.UC_BASEURL + '/auth/api' + api['post-login-start'], {
captcha: this.showEmailCaptcha ? this.form.captcha : '', // todo: 登录验证码
email,
type: 'email'
});
if (accountResponse.err_no) {
if (accountResponse.err_no == 1000 && !this.showEmailCaptcha) { // 需要验证码
this.showErrorTip(-1, '');
this.showEmailCaptcha = true;
this.form.password = '';
this.$refs.emailCaptcha.focusCaptchaInput();
return;
}
this.showErrorTip(accountResponse.err_no, accountResponse.err_msg);
return;
}
const { data: passwordResponse } = await this.$axios
.post(this.UC_BASEURL + "/auth/api" + api['post-login-password'], {
password: this.form.password
});
// 登录失败
if (passwordResponse.err_no) {
this.showErrorTip(passwordResponse.err_no, passwordResponse.err_msg);
return;
}
} else { // 手机登录
// 检测参数是否存在
if (this.form.email == '' || this.form.country == '') {
this.showErrorTip(-1, '请输入手机号码');
return;
}
if (this.showMobileCaptcha && !isVerifyCode(this.form.captcha)) {
this.showErrorTip(-1, '请输入正确的验证码');
return;
}
if (this.form.password == '') {
this.showErrorTip(-1, '请输入密码');
return;
}
email = this.form.country + '|' + this.form.email;
const { data: accountResponse } = await this.$axios
.post(this.UC_BASEURL + '/auth/api' + api['post-login-start'], {
captcha: this.showMobileCaptcha ? this.form.captcha : '', // todo: 登录验证码
email,
type: 'mobile'
});
// 增加错误id提示
if (accountResponse.err_no) {
if (accountResponse.err_no == 1000 && !this.showMobileCaptcha) { // 需要验证码
this.showErrorTip(-1, '');
this.showMobileCaptcha = true;
this.form.password = '';
this.$refs.mobileCaptcha.focusCaptchaInput();
return;
}
this.showErrorTip(accountResponse.err_no, accountResponse.err_msg);
return;
}
const { data: passwordResponse } = await this.$axios
.post(this.UC_BASEURL + '/auth/api' + api['post-login-password'], {
password: this.form.password
});
// 登录失败
if (passwordResponse.err_no) {
this.showErrorTip(passwordResponse.err_no, passwordResponse.err_msg);
return;
}
}
// 获取用户信息
const userinfo = await this.$store.dispatch("fetchUser");
this.showLoading = false;
// 跳转用户中心
this.$router.push({
name: 'home'
});
// 记录登录信息
localStorage.setItem('account-info', JSON.stringify({
'account': email,
'type': this.useMail ? 'email' : 'mobile'
}));
},
showErrorTip(errNo, errMsg) {
this.showLoading = false;
this.errTipMsg = apiErrMap(errNo, errMsg).errMsg;
},
goBack() {
this.$router.go(-1)
},
getCaptchaValue(captcha) {
this.form.captcha = captcha;
},
switchLogin() {
this.useMail = !this.useMail;
this.form.email = '';
this.form.password = '';
if (this.useMail) {
localStorage.setItem('login-type', 'email');
this.showEmailCaptcha = false;
this.$refs.mobileActIpt.focus();
} else {
localStorage.setItem('login-type', 'mobile');
this.showMobileCaptcha = false;
this.$refs.emailActIpt.focus();
}
},
},
}
</script>
<template>
<div class="page reg">
<div class="page-header">
<div class="l" @click="goBack"><span class="icon-back"><i class="iconfont icon-fanhui"></i></span></div>
<div class="c">注册</div>
<div class="r" @click="goLogin"><span class="txt abs-right">登录</span></div>
</div>
<div class="page-content">
<div v-if="step===1">
<h2 class="f-tac c-blue2 fs36 pt80 pb60">使用邮箱地址注册</h2>
<div class="form-content">
<el-form :model="regForm" ref="regForm" label-width="0px">
<el-form-item prop="email" label="" :rules="[{ required: true, message: '请输入邮箱地址', trigger: 'blur' },{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur,change' }]">
<el-input v-model="regForm.email" placeholder="输入邮箱"><i slot="prefix" class="iconfont icon-email"></i></el-input>
</el-form-item>
<captcha v-show="showEmailCaptcha" :captcha="regForm.captcha" ref="captchaEmail" @dispatchCaptcha="getCaptchaValue"></captcha>
<el-form-item>
<div class="btn-group full mt100">
<el-button type="primary" round @click="submitForm('regForm')">提交</el-button>
</div>
<!-- <div class="f-tac">
<router-link to="" class="c-blue1">使用手机号注册>></router-link>
</div> -->
</el-form-item>
</el-form>
</div>
</div>
<div v-if="step===2">123123</div>
</div>
</div>
</template>
<script>
import captcha from '@/components/ucenter/captcha'
export default {
name: 'rega',
data() {
return {
regForm: {
email: ''
},
step: 1
}
},
components:{
captcha,
},
mounted() {
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$router.replace('/jump')
} else {
console.log('error submit!!');
return false;
}
});
},
goBack() {
this.$router.go(-1)
},
goLogin() {
this.$router.replace("/login")
}
},
}
</script>
<style>
</style>
<template>
<div>手机注册页</div>
</template>
<script>
export default{
data(){
return {}
}
}
</script>
\ No newline at end of file
......@@ -112,21 +112,21 @@ const router = new Router({
title: 'settings.vue'
}
}]
},{
}, {
path: '/address',
name: 'modifyAddress',
component: resolve => require(['@/components/settings/address.vue'], resolve),
meta: {
title: 'address.vue'
}
},{
}, {
path: '/search',
name: 'search',
component: resolve => require(['@/components/miners/search.vue'], resolve),
meta: {
title: 'search.vue'
}
},{
}, {
path: '/defaultCoin',
name: 'defaultCoin',
component: resolve => require(['@/components/settings/defaultCoin'], resolve),
......@@ -175,6 +175,24 @@ const router = new Router({
meta: {
title: 'moban.vue'
}
}, {
path: '/ucenter',
component: resolve => require(['@/components/ucenter'], resolve),
meta: {
title: 'userCenter/index.vue'
}
}, {
path: '/sign-up-mobile',
component: resolve => require(['@/components/ucenter/signUpMobile'], resolve),
meta: {
title: '手机注册'
}
}, {
path: '/sign-up-email',
component: resolve => require(['@/components/ucenter/signUpEmail'], resolve),
meta: {
title: '邮箱注册'
}
}
]
})
......
import Vue from 'vue';
import Vuex from 'vuex';
import axios from 'axios';
import { api } from '@/components/ucenter/helpers.js';
Vue.use(Vuex);
import dictionaries from '@/utils/dictionaries.js'; //字典
......@@ -12,7 +14,7 @@ const state = {
txt: dictionaries.txt, //字典
language: 'zh-cn', //en/zh-cn切换语言,从localStorage中取;
coin_type_show: false, //是否显示币种切换
enter_panel:false,//是否从子账户面板进来的
enter_panel: false, //是否从子账户面板进来的
base_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1/url", //初始接口
common_url: "http://ltc-bj-dev.c6396418dd7954b228d8b967c8a929103.cn-beijing.alicontainer.com/api/public/v1", //币种切换对应的baseUrl
......@@ -23,16 +25,19 @@ const state = {
puid: '', //初始用户id为空,与localStorage同步
coin_type: '', //默认币种类型
region_id: '', //默认节点
refresh:'',
tab_bar:0
refresh: '',
tab_bar: 0,
UC_BASEURL: 'https://ucdev1212.blockin.com',
user: null,
}
const mutations = {
setEnterPannel(state,v){
state.enter_panel=v;
setEnterPannel(state, v) {
state.enter_panel = v;
localStorage.setItem("enter_panel", v);
},
setRefresh(state){
state.refresh=new Date().getTime();
setRefresh(state) {
state.refresh = new Date().getTime();
},
setInitUrl(state, v) {
state.init_url = v;
......@@ -52,21 +57,69 @@ const mutations = {
state.puid = v
localStorage.setItem("puid", v);
},
setLanguage(state,v){
setLanguage(state, v) {
state.language = v
localStorage.setItem("language", v);
},
FETCH_USER_SUCCESS(state, { user }) {
// window.config.user = user;
state.user = user;
},
FETCH_USER_FAILURE(state) {},
LOGOUT(state) {
state.user = null
},
UPDATE_USER(state, { user }) {
state.user = user
}
}
const getters = {
// count: function(state) {
// return state.count += 100;
user: state => {
return state.user
},
// check: state => {
// let hasLogged = state.user && Boolean(state.user.uid);
// if (!hasLogged) {
// hasLogged = Boolean(JSON.parse(window.config.register));
// }
// return hasLogged;
// }
}
const actions = {
// addAction(context) {
// context.commit('add', 10)
// }
async fetchUser({ commit }) {
try {
const { data } = await axios
.get(state.UC_BASEURL + '/auth/api' + api['get-userinfo']);
if (data.err_no) {
throw new Error('get userinfo fail');
}
commit('FETCH_USER_SUCCESS', {
user: data.data.userinfo
});
return data.data.userinfo;
} catch (e) {
commit('FETCH_USER_FAILURE')
return null;
}
},
updateUser({ commit }, payload) {
commit('UPDATE_USER', payload)
},
async logout({ commit }) {
try {
await axios.get('/logout')
} catch (e) {}
commit('LOGOUT')
}
}
export default new Vuex.Store({
state,
......
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>
\ No newline at end of file
<svg fill="#000000" height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg">
<path d="M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z"/>
<path d="M0-.75h24v24H0z" fill="none"/>
</svg>
\ No newline at end of file
<svg class="lds-spinner" width="200px" height="200px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="background: none;"><g transform="rotate(0 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-1.0083333333333335s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(30 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.9166666666666666s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(60 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.8250000000000001s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(90 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.7333333333333334s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(120 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.6416666666666667s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(150 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.55s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(180 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.4583333333333333s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(210 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.3666666666666667s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(240 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.275s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(270 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.18333333333333335s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(300 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="-0.09166666666666667s" repeatCount="indefinite"></animate>
</rect>
</g><g transform="rotate(330 50 50)">
<rect x="47" y="22" rx="15.51" ry="7.26" width="6" height="10" fill="#18a8ea">
<animate attributeName="opacity" values="1;0" times="0;1" dur="1.1s" begin="0s" repeatCount="indefinite"></animate>
</rect>
</g></svg>
\ No newline at end of file
<svg class="lds-default" width="100px" height="100px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="background: none;"><circle cx="75" cy="50" fill="undefined" r="3.6">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-1.98s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-1.98s"></animate>
</circle><circle cx="70.225" cy="64.695" fill="undefined" r="3.6">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-1.76s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-1.76s"></animate>
</circle><circle cx="57.725" cy="73.776" fill="undefined" r="4.15273">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-1.54s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-1.54s"></animate>
</circle><circle cx="42.275" cy="73.776" fill="undefined" r="5.11273">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-1.32s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-1.32s"></animate>
</circle><circle cx="29.775" cy="64.695" fill="undefined" r="5.92727">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-1.1s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-1.1s"></animate>
</circle><circle cx="25" cy="50" fill="undefined" r="4.96727">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-0.88s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-0.88s"></animate>
</circle><circle cx="29.775" cy="35.305" fill="undefined" r="4.00727">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-0.66s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-0.66s"></animate>
</circle><circle cx="42.275" cy="26.224" fill="undefined" r="3.6">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-0.44s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-0.44s"></animate>
</circle><circle cx="57.725" cy="26.224" fill="undefined" r="3.6">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="-0.22s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="-0.22s"></animate>
</circle><circle cx="70.225" cy="35.305" fill="undefined" r="3.6">
<animate attributeName="r" values="3.5999999999999996;3.5999999999999996;6;3.5999999999999996;3.5999999999999996" times="0;0.1;0.2;0.3;1" dur="2.2s" repeatCount="indefinite" begin="0s"></animate>
<animate attributeName="fill" values="#3d7d9a;#3d7d9a;#45a6d2;#3d7d9a;#3d7d9a" repeatCount="indefinite" times="0;0.1;0.2;0.3;1" dur="2.2s" begin="0s"></animate>
</circle></svg>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment