Explorar el Código

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

MaiXinRong hace 1 mes
padre
commit
d4b60844e4

+ 1 - 0
app/controller/cost_controller.js

@@ -798,6 +798,7 @@ module.exports = app => {
                     const code = ctx.request.body.code;
                     const cacheKey = 'smsCode:' + ctx.session.sessionUser.accountId;
                     const cacheCode = await app.redis.get(cacheKey);
+                    const pa = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
                     if (cacheCode === null || code === undefined || cacheCode !== (code + pa.auth_mobile)) {
                         throw '验证码不正确!';
                     }

+ 1 - 1
app/public/js/shares/common_audit.js

@@ -203,7 +203,7 @@ $(document).ready(function () {
 
         const btn = $(this);
         $.ajax({
-            url: '/profile/code',
+            url: '/profile/code?_csrf_j=' + csrf,
             type: 'post',
             data: { mobile: authMobile, type: 'shenpi' },
             dataTye: 'json',

+ 3 - 1
app/view/cost/audit_modal.ejs

@@ -829,6 +829,8 @@
     const shenpiConst =  JSON.parse('<%- JSON.stringify(shenpiConst) %>');
     const createUserId = parseInt('<%= ctx.costStage.create_user_id %>');
     const auditType = JSON.parse(unescape('<%- escape(JSON.stringify(auditType)) %>'));
+    const csrf = '<%= ctx.csrf %>';
+    const authMobile = '<%= authMobile %>';
 </script>
 <script>
     $('[name=stage-start]').submit(function (e) {
@@ -895,4 +897,4 @@
         <% } %>
         $('#hide-all').hide();
     });
-</script>
+</script>