Browse Source

增加参数以及MD5加密

huangb 6 years ago
parent
commit
19447e9d29

+ 3 - 1
components/mobile/registerEnterprise/index.vue

@@ -100,6 +100,7 @@
 </template>
 
 <script>
+  import md5 from 'js-md5'
   export default {
     name: 'registerEnterprise',
     data () {
@@ -223,6 +224,7 @@
       },
       // 获取验证码
       getCheckCode () {
+        let md5Code = md5(`{mobile=${this.step1.mobile},code=${this.code},salt=sso}`)
         if (this.tokenTime > 0 && this.tokenTime < 60) {
           this.downToast('请稍后再点击,我在倒计时')
         } else if (this.code === '') {
@@ -232,7 +234,7 @@
           if (this.state.mobile === 'success') {
             this.$indicator.open('获取中...')
             let _this = this
-            this.$http.get('/sso/personal/register/checkCode', {params: {mobile: this.step1.mobile, timestamp: new Date().getTime() + '', code: this.code}})
+            this.$http.get('/sso/personal/register/checkCode', {params: {mobile: this.step1.mobile, timestamp: new Date().getTime() + '', code: this.code, sign: md5Code}})
               .then(response => {
                 this.$indicator.close()
                 if (response.data.errMsg) {

+ 3 - 1
components/mobile/registerPersonal/index.vue

@@ -59,6 +59,7 @@
 </template>
 
 <script>
+  import md5 from 'js-md5'
   export default {
     name: 'registerPerson',
     data () {
@@ -231,6 +232,7 @@
       },
       // 获取验证码
       loadCheckCode () {
+        let md5Code = md5(`{mobile=${this.mobile},code=${this.code},salt=sso}`)
         if (this.state.mobile !== 'success') {
           this.codeMobile()
         } else if (this.code === '') {
@@ -238,7 +240,7 @@
         } else {
           this.$indicator.open('获取中...')
           let _this = this
-          this.$http.get('/sso/personal/register/checkCode', {params: {code: this.code, mobile: this.mobile, timestamp: new Date().getTime() + ''}})
+          this.$http.get('/sso/personal/register/checkCode', {params: {sign: md5Code, code: this.code, mobile: this.mobile, timestamp: new Date().getTime() + ''}})
             .then(response => {
               this.$indicator.close()
               if (response.data.errMsg) {

+ 3 - 1
components/register/EnterpriseRegistration.vue

@@ -130,6 +130,7 @@
 
 <script>
   import Loading from '~components/common/loading/Loading.vue'
+  import md5 from 'js-md5'
   export default {
     name: 'EnterpriseRegistration',
     components: {
@@ -606,8 +607,9 @@
       },
 //      获取校验码
       getCheckCode () {
+        let md5Code = md5(`{mobile=${this.enterprise.mobile},code=${this.ImgCode},salt=sso}`)
         this.isShowLoading = true
-        this.$http.get(`/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile, timestamp: new Date().getTime() + '', code: this.ImgCode}})
+        this.$http.get(`/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile, timestamp: new Date().getTime() + '', code: this.ImgCode, sign: md5Code}})
           .then(response => {
             this.isShowLoading = false
             if (response.data) {

+ 3 - 2
components/register/PersonalRegistration.vue

@@ -76,6 +76,7 @@
 </template>
 
 <script>
+  import md5 from 'js-md5'
   import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'PersonalRegistration',
@@ -651,9 +652,9 @@
         imgSrc.setAttribute('src', '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf())
       },
       getCheckCode () {
+        let md5Code = md5(`{mobile=${this.item.mobile},code=${this.ImgCode},salt=sso}`)
         this.isShowLoading = true
-//        this.getCode()
-        this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile, timestamp: new Date().getTime() + '', code: this.ImgCode}})
+        this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile, timestamp: new Date().getTime() + '', code: this.ImgCode, sign: md5Code}})
           .then(response => {
             this.isShowLoading = false
             if (response.data) {

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
     "express": "^4.14.1",
     "font-awesome": "^4.7.0",
     "http-proxy-middleware": "^0.17.4",
+    "js-md5": "^0.7.3",
     "jsonp": "^0.2.1",
     "mint-ui": "^2.2.13",
     "nuxt": "0.10.6",

+ 4 - 0
yarn.lock

@@ -3368,6 +3368,10 @@ js-beautify@^1.6.3:
     mkdirp "~0.5.0"
     nopt "~3.0.1"
 
+js-md5@^0.7.3:
+  version "0.7.3"
+  resolved "https://registry.yarnpkg.com/js-md5/-/js-md5-0.7.3.tgz#b4f2fbb0b327455f598d6727e38ec272cd09c3f2"
+
 js-tokens@^3.0.0:
   version "3.0.2"
   resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"