Selaa lähdekoodia

审批短信关掉和通知页更改

laiguoran 4 vuotta sitten
vanhempi
commit
c5ff1875f4
3 muutettua tiedostoa jossa 29 lisäystä ja 29 poistoa
  1. 24 24
      app/extend/helper.js
  2. 4 4
      app/view/profile/sms.ejs
  3. 1 1
      config/menu.js

+ 24 - 24
app/extend/helper.js

@@ -987,30 +987,30 @@ module.exports = {
     },
 
     async sendAliSms(userId, type, judge, code, data = {}) {
-        const mobiles = [];
-        if (!userId || (userId instanceof Array && userId.length === 0)) return;
-        const smsUser = await this.ctx.service.projectAccount.getAllDataByCondition({ where: { id: userId } });
-        for (const su of smsUser) {
-            if (!su.auth_mobile || su.auth_mobile === '') continue;
-            if (!su.sms_type || su.sms_type === '') continue;
-
-            const smsType = JSON.parse(su.sms_type);
-            if (smsType[type] && smsType[type].indexOf(judge) !== -1) {
-                mobiles.push(su.auth_mobile);
-            }
-        }
-
-        if (mobiles.length > 0) {
-            const sms = new SMS(this.ctx);
-            const tenderName = await sms.contentChange(this.ctx.tender.data.name);
-            const projectName = await sms.contentChange(this.ctx.tender.info.deal_info.buildName);
-            const param = {
-                project: projectName,
-                number: tenderName,
-            };
-            const postParam = Object.assign(param, data);
-            sms.aliSend(mobiles, postParam, code);
-        }
+        // const mobiles = [];
+        // if (!userId || (userId instanceof Array && userId.length === 0)) return;
+        // const smsUser = await this.ctx.service.projectAccount.getAllDataByCondition({ where: { id: userId } });
+        // for (const su of smsUser) {
+        //     if (!su.auth_mobile || su.auth_mobile === '') continue;
+        //     if (!su.sms_type || su.sms_type === '') continue;
+        //
+        //     const smsType = JSON.parse(su.sms_type);
+        //     if (smsType[type] && smsType[type].indexOf(judge) !== -1) {
+        //         mobiles.push(su.auth_mobile);
+        //     }
+        // }
+        //
+        // if (mobiles.length > 0) {
+        //     const sms = new SMS(this.ctx);
+        //     const tenderName = await sms.contentChange(this.ctx.tender.data.name);
+        //     const projectName = await sms.contentChange(this.ctx.tender.info.deal_info.buildName);
+        //     const param = {
+        //         project: projectName,
+        //         number: tenderName,
+        //     };
+        //     const postParam = Object.assign(param, data);
+        //     sms.aliSend(mobiles, postParam, code);
+        // }
     },
 
 

+ 4 - 4
app/view/profile/sms.ejs

@@ -2,7 +2,7 @@
 <div class="panel-content" id="app">
     <div class="panel-title">
         <div class="title-main">
-            <h2>短信通知</h2>
+            <h2>认证手机</h2>
         </div>
     </div>
     <div class="content-wrap">
@@ -13,7 +13,7 @@
                     <% if (accountData.auth_mobile !== '') { %>
                     <!--已绑定手机-->
                     <div class="form-group">
-                        <label>已认证手机(用于 找回密码、接收通知)</label>
+                        <label>已认证手机</label>
                         <div class="input-group mb-3">
                             <input class="form-control form-control-sm" readonly="" value="<%= accountData.auth_mobile %>">
                             <div class="input-group-append">
@@ -25,7 +25,7 @@
                     <!--绑定手机-->
                     <form id="mobile-form" <% if (accountData.auth_mobile !== '') { %>style="display: none" <% } %>>
                         <div class="form-group">
-                            <label>认证手机(用于 找回密码、接收通知)</label>
+                            <label>认证手机</label>
                             <div class="input-group mb-3">
                                 <input class="form-control form-control-sm" placeholder="输入11位手机号码" value="" name="auth_mobile" maxlength="11"/>
                                 <div class="input-group-append">
@@ -41,7 +41,7 @@
                         </div>
                         <button type="button" class="btn btn-secondary btn-sm disabled" id="bind-btn">确认绑定</button>
                     </form>
-                    <% if (accountData.auth_mobile !== '') { %>
+                    <% if (accountData.auth_mobile !== '' && false) { %>
                     <!--短信通知开关(已有认证手机后显示)-->
                     <div class="mt-5">
                         <h4>通知类型</h4>

+ 1 - 1
config/menu.js

@@ -282,7 +282,7 @@ const profileMenu = {
         url: '/profile/info',
     },
     sms: {
-        name: '短信通知',
+        name: '认证手机',
         display: false,
         url: '/profile/sms',
     },