{"remainingRequest":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/admin.ws.baibaodun.com.cn/src/views/onePass/smsConfig/components/register.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/src/views/onePass/smsConfig/components/register.vue","mtime":1701741776318},{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":1701741929501},{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":1701741918737},{"path":"/data/jenkins/workspace/admin.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":1701741928146}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n// +---------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]\n// +---------------------------------------------------------------------\n// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.\n// +---------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权\n// +---------------------------------------------------------------------\n// | Author: CRMEB Team \n// +---------------------------------------------------------------------\nimport { captchaApi, registerApi } from '@/api/sms';\nexport default {\n name: 'Register',\n data() {\n const validatePhone = (rule, value, callback) => {\n if (!value) {\n return callback(new Error('请填写手机号'));\n } else if (!/^1[3456789]\\d{9}$/.test(value)) {\n callback(new Error('手机号格式不正确!'));\n } else {\n callback();\n }\n };\n return {\n loading: false,\n passwordType: 'password',\n captchatImg: '',\n cutNUm: '获取验证码',\n canClick: true,\n formInline: {\n account: '',\n code: '',\n domain: '',\n phone: '',\n password: '',\n },\n ruleInline: {\n password: [{ required: true, message: '请输入短信平台密码/token', trigger: 'blur' }],\n domain: [{ required: true, message: '请输入网址域名', trigger: 'blur' }],\n phone: [{ required: true, validator: validatePhone, trigger: 'blur' }],\n code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],\n },\n };\n },\n methods: {\n showPwd() {\n if (this.passwordType === 'password') {\n this.passwordType = '';\n } else {\n this.passwordType = 'password';\n }\n this.$nextTick(() => {\n this.$refs.password.focus();\n });\n },\n // 短信验证码\n cutDown() {\n if (this.formInline.phone) {\n if (!this.canClick) return;\n this.canClick = false;\n this.cutNUm = 60;\n captchaApi({\n phone: this.formInline.phone,\n types: 0,\n }).then(async (res) => {\n this.$message.success('发送成功');\n });\n const time = setInterval(() => {\n this.cutNUm--;\n if (this.cutNUm === 0) {\n this.cutNUm = '获取验证码';\n this.canClick = true;\n clearInterval(time);\n }\n }, 1000);\n } else {\n this.$message.warning('请填写手机号!');\n }\n },\n // 注册\n handleSubmit(name) {\n this.formInline.account = this.formInline.phone;\n this.$refs[name].validate((valid) => {\n if (valid) {\n this.loading = true;\n registerApi(this.formInline)\n .then(async (res) => {\n this.$message.success('注册成功');\n setTimeout(() => {\n this.changelogo();\n }, 1000);\n this.loading = false;\n })\n .catch(() => {\n this.loading = false;\n });\n } else {\n return false;\n }\n });\n },\n // 立即登录\n changelogo() {\n this.$emit('on-change');\n },\n },\n};\n",null]}