|
@@ -54,117 +54,116 @@
|
54
|
54
|
|
55
|
55
|
|
56
|
56
|
<script>
|
57
|
|
- import {checkMobile,checkPassWord} from "@/utils/tools"
|
58
|
|
- import {getModifyPwdCode,submitModifyPwdAction } from "@/api/login/login"
|
|
57
|
+ import { checkMobile, checkPassWord } from '@/utils/tools'
|
|
58
|
+ import { getModifyPwdCode, submitModifyPwdAction } from '@/api/login/login'
|
59
|
59
|
import { hex_md5 } from '@/utils/md5'
|
60
|
60
|
export default {
|
61
|
|
- data() {
|
62
|
|
- var checkMobileRule = (rule, value, callback) => {
|
63
|
|
- if (!checkMobile(value)) {
|
64
|
|
- callback(new Error('请填写正确的手机号'));
|
65
|
|
- }else {
|
66
|
|
- callback();
|
67
|
|
- }
|
68
|
|
- };
|
69
|
|
- var checkPasswordRule = (rule,value,callback) =>{
|
70
|
|
- if(!checkPassWord(value)){
|
71
|
|
- callback(new Error('密码需在6-20位之间,且必须包含字母和数字'));
|
72
|
|
- }else{
|
73
|
|
- callback();
|
74
|
|
- }
|
|
61
|
+ data() {
|
|
62
|
+ var checkMobileRule = (rule, value, callback) => {
|
|
63
|
+ if (!checkMobile(value)) {
|
|
64
|
+ callback(new Error('请填写正确的手机号'))
|
|
65
|
+ } else {
|
|
66
|
+ callback()
|
|
67
|
+ }
|
|
68
|
+ }
|
|
69
|
+ var checkPasswordRule = (rule, value, callback) => {
|
|
70
|
+ if (!checkPassWord(value)) {
|
|
71
|
+ callback(new Error('密码需在6-20位之间,且必须包含字母和数字'))
|
|
72
|
+ }else {
|
|
73
|
+ callback()
|
|
74
|
+ }
|
|
75
|
+ }
|
|
76
|
+ return {
|
|
77
|
+ phone: '',
|
|
78
|
+ code: '',
|
|
79
|
+ psd: '',
|
|
80
|
+ contact: false,
|
|
81
|
+ count_downing: false,
|
|
82
|
+ count_down: 0,
|
|
83
|
+ modify_pwd_loading: false,
|
|
84
|
+ registerForm: {
|
|
85
|
+ phone: '',
|
|
86
|
+ code: '',
|
|
87
|
+ password: ''
|
|
88
|
+ },
|
|
89
|
+ rules: {
|
|
90
|
+ phone: [{ required: true, message: '手机号码不能为空' }, { validator: checkMobileRule }],
|
|
91
|
+ code: [{ required: true, message: '验证码不能为空' }],
|
|
92
|
+ password: [{ required: true, message: '密码不能为空' }, { validator: checkPasswordRule }]
|
|
93
|
+ },
|
|
94
|
+ loginshow: true,
|
|
95
|
+ loginshowtwo: false
|
75
|
96
|
}
|
76
|
|
- return {
|
77
|
|
- phone: "",
|
78
|
|
- code: "",
|
79
|
|
- psd: "",
|
80
|
|
- contact: false,
|
81
|
|
- count_downing: false,
|
82
|
|
- count_down: 0,
|
83
|
|
- modify_pwd_loading: false,
|
84
|
|
- registerForm:{
|
85
|
|
- phone:"",
|
86
|
|
- code:"",
|
87
|
|
- password:"",
|
88
|
|
- },
|
89
|
|
- rules:{
|
90
|
|
- phone:[{required:true,message: "手机号码不能为空"},{validator:checkMobileRule}],
|
91
|
|
- code:[{required:true,message:"验证码不能为空"}],
|
92
|
|
- password:[{required:true,message:"密码不能为空"},{validator:checkPasswordRule}],
|
93
|
|
- },
|
94
|
|
- loginshow:true,
|
95
|
|
- loginshowtwo:false,
|
96
|
|
- };
|
97
|
|
- },
|
98
|
|
- methods:{
|
|
97
|
+ },
|
|
98
|
+ methods: {
|
99
|
99
|
getCodeAction: function() {
|
100
|
|
- this.count_downing = true
|
101
|
|
- this.count_down = 61
|
102
|
|
- this.countDown()
|
103
|
|
- getModifyPwdCode(this.registerForm.phone).then(response=>{
|
104
|
|
- if(response.data.state == 1){
|
105
|
|
- var admin = response.data.data.admin;
|
106
|
|
- console.log("hhadmin是设么",admin)
|
107
|
|
- this.$message.error("修改成功")
|
108
|
|
- if(admin.mobile != ""){
|
109
|
|
- this.$message.error("该手机号已注册")
|
|
100
|
+ this.count_downing = true
|
|
101
|
+ this.count_down = 61
|
|
102
|
+ this.countDown()
|
|
103
|
+ getModifyPwdCode(this.registerForm.phone).then(response => {
|
|
104
|
+ if (response.data.state == 1) {
|
|
105
|
+ var admin = response.data.data.admin
|
|
106
|
+ console.log('hhadmin是设么', admin)
|
|
107
|
+ this.$message.error('修改成功')
|
|
108
|
+ if (admin.mobile != '') {
|
|
109
|
+ this.$message.error('该手机号已注册')
|
110
|
110
|
}
|
111
|
|
- }
|
112
|
|
- })
|
113
|
|
- },
|
114
|
|
- countDown: function() {
|
115
|
|
- this.count_down = this.count_down - 1
|
116
|
|
- if (this.count_down == 0) {
|
117
|
|
- this.count_downing = false
|
118
|
|
- return
|
119
|
|
- }
|
120
|
|
- var t = this
|
121
|
|
- setTimeout(() => {
|
122
|
|
- this.countDown()
|
123
|
|
- }, 1000)
|
124
|
|
- },
|
125
|
|
- watchNum(){
|
126
|
|
- if(this.registerForm.phone == "" || this.registerForm.code == ""){
|
127
|
|
- this.loginshow = false;
|
128
|
|
- this.loginshowtwo = true;
|
129
|
|
- }else{
|
130
|
|
- this.loginshow = true;
|
131
|
|
- this.loginshowtwo = false;
|
|
111
|
+ }
|
|
112
|
+ })
|
|
113
|
+ },
|
|
114
|
+ countDown: function() {
|
|
115
|
+ this.count_down = this.count_down - 1
|
|
116
|
+ if (this.count_down == 0) {
|
|
117
|
+ this.count_downing = false
|
|
118
|
+ return
|
132
|
119
|
}
|
133
|
|
-
|
134
|
|
- },
|
135
|
|
- submitModifyPwdAction(formName){
|
136
|
|
- this.$refs[formName].validate((valid)=>{
|
137
|
|
- if(valid){
|
138
|
|
- submitModifyPwdAction(this.registerForm.phone,hex_md5(this.registerForm.password),this.registerForm.code).then(response=>{
|
139
|
|
- if(response.data.state ==1){
|
140
|
|
- var admin = response.data.data.admin;
|
141
|
|
- console.log("admin",admin)
|
142
|
|
- this.$router.push("/orginfomation")
|
143
|
|
- }else{
|
144
|
|
- this.$message.error("手机号或验证码错误")
|
|
120
|
+ var t = this
|
|
121
|
+ setTimeout(() => {
|
|
122
|
+ this.countDown()
|
|
123
|
+ }, 1000)
|
|
124
|
+ },
|
|
125
|
+ watchNum() {
|
|
126
|
+ if (this.registerForm.phone == '' || this.registerForm.code == '') {
|
|
127
|
+ this.loginshow = false
|
|
128
|
+ this.loginshowtwo = true
|
|
129
|
+ }else {
|
|
130
|
+ this.loginshow = true
|
|
131
|
+ this.loginshowtwo = false
|
|
132
|
+ }
|
|
133
|
+ },
|
|
134
|
+ submitModifyPwdAction(formName) {
|
|
135
|
+ this.$refs[formName].validate((valid) => {
|
|
136
|
+ if (valid) {
|
|
137
|
+ submitModifyPwdAction(this.registerForm.phone, hex_md5(this.registerForm.password), this.registerForm.code).then(response => {
|
|
138
|
+ if (response.data.state == 1) {
|
|
139
|
+ var admin = response.data.data.admin
|
|
140
|
+ console.log('admin', admin)
|
|
141
|
+ this.$router.push('/orginfomation')
|
|
142
|
+ } else{
|
|
143
|
+ this.$message.error('手机号或验证码错误')
|
145
|
144
|
}
|
146
|
|
- })
|
|
145
|
+ })
|
147
|
146
|
}
|
148
|
147
|
})
|
149
|
|
- },
|
|
148
|
+ },
|
150
|
149
|
|
151
|
|
- callPhone(){
|
152
|
|
- window.location.href = 'tel://075586526342'
|
153
|
|
- }
|
154
|
|
- },
|
155
|
|
- created(){
|
|
150
|
+ callPhone() {
|
|
151
|
+ window.location.href = 'tel://075586526342'
|
|
152
|
+ }
|
|
153
|
+ },
|
|
154
|
+ created() {
|
156
|
155
|
|
157
|
|
- },
|
158
|
|
- computed:{
|
159
|
|
- code_btn_title: function() {
|
160
|
|
- if (this.count_down == 0) {
|
161
|
|
- return '获取验证码'
|
162
|
|
- } else {
|
163
|
|
- return '重新发送('+ this.count_down + ')'
|
164
|
|
- }
|
165
|
|
- },
|
166
|
|
- }
|
167
|
|
-};
|
|
156
|
+ },
|
|
157
|
+ computed: {
|
|
158
|
+ code_btn_title: function() {
|
|
159
|
+ if (this.count_down == 0) {
|
|
160
|
+ return '获取验证码'
|
|
161
|
+ } else {
|
|
162
|
+ return '重新发送(' + this.count_down + ')'
|
|
163
|
+ }
|
|
164
|
+ }
|
|
165
|
+ }
|
|
166
|
+}
|
168
|
167
|
</script>
|
169
|
168
|
|
170
|
169
|
<style lang="scss">
|