Browse Source

fix:订阅设置推送设置显示推送时间

tsz 2 years ago
parent
commit
794656d8b0
3 changed files with 52 additions and 9 deletions
  1. 7 3
      public/js/common.js
  2. 34 1
      public/js/sub_entrance.js
  3. 11 5
      vue.config.js

+ 7 - 3
public/js/common.js

@@ -89,10 +89,14 @@ var vTools = {
                 break
             }
         }
-        if (inRedirectUriArr) {
-            this.baseUrl = '/entbase'
+        if (options.baseUrl) {
+          this.baseUrl = options.baseUrl
         } else {
-            this.baseUrl = '/entnicheNew'
+          if (inRedirectUriArr) {
+              this.baseUrl = '/entbase'
+          } else {
+              this.baseUrl = '/entnicheNew'
+          }
         }
 
         // 执行请求

+ 34 - 1
public/js/sub_entrance.js

@@ -418,7 +418,8 @@ $(function () {
                     // 信息类型
                     infotype(res)
                     // 推送设置
-                    setPush(res)
+                    setNewPush()
+                    // setPush(res)
                     //项目匹配
                     if (res.subscribe.projectmatch === 1 || JSON.stringify(res.subscribe) == "{}") {
                         $('#edit .pro-switch').prop("checked", "true");
@@ -436,6 +437,23 @@ $(function () {
         })
     }
 
+    function setNewPush () {
+      // 推送设置回显
+      vTools.ajax({
+        url: '/jybx/subscribe/getPushSet',
+        type: 'POST',
+        baseUrl: '/jyapi',
+        contentType: 'application/x-www-form-urlencoded',
+        loading: {},
+        success: function (res) {
+          console.log(res)
+          if (res.error_code === 0) {
+            setPushShow(res.data)
+          }
+        }
+      })
+    }
+
     function keywordType(res) {
       if(JSON.stringify(res.subscribe) == "{}") {
         return
@@ -524,6 +542,21 @@ $(function () {
         }
     }
 
+    function setPushShow (res) {
+      var ratemodeMap = {
+          1: '实时推送',
+          2: '每日推送',
+          3: '每周推送',
+          4: '每月推送',
+      }
+      var ratemode = 2
+      if (Object.keys(res).length !== 0) {
+          ratemode = res.o_subset.i_ratemode
+      }
+
+      $('.setpush').html(ratemodeMap[ratemode])
+    }
+
     function setPush(res) {
         var ratemodeMap = {
             1: '实时推送',

+ 11 - 5
vue.config.js

@@ -48,13 +48,19 @@ module.exports = {
     proxy: {
       '^/entbase': {
         // target: 'http://127.0.0.1:815',
-        target: 'https://app5-jytest.jydev.jianyu360.com/',
+        target: 'https://jybx-webtest.jydev.jianyu360.com',
+        changeOrigin: true,
+        logLevel: 'debug'
+      },
+      '^/jyapi': {
+        // target: 'http://127.0.0.1:815',
+        target: 'https://jybx-webtest.jydev.jianyu360.com',
         changeOrigin: true,
         logLevel: 'debug'
       },
       '^/entniche': {
         // target: 'http://127.0.0.1:812',
-        target: 'https://app5-jytest.jydev.jianyu360.com/',
+        target: 'https://jybx-webtest.jydev.jianyu360.com',
         changeOrigin: true,
         logLevel: 'debug'
       },
@@ -64,7 +70,7 @@ module.exports = {
         logLevel: 'debug'
       },
       '^/testServer': {
-        target: 'https://app5-jytest.jydev.jianyu360.com/',
+        target: 'https://jybx-webtest.jydev.jianyu360.com',
         changeOrigin: true,
         logLevel: 'debug',
         pathRewrite: {
@@ -72,7 +78,7 @@ module.exports = {
         }
       },
       '^/jypay': {
-        target: 'https://app5-jytest.jydev.jianyu360.com/',
+        target: 'https://jybx-webtest.jydev.jianyu360.com',
         changeOrigin: true,
         logLevel: 'debug',
         pathRewrite: {
@@ -80,7 +86,7 @@ module.exports = {
         }
       },
       '^/bigmember': {
-        target: 'https://app5-jytest.jydev.jianyu360.com/',
+        target: 'https://jybx-webtest.jydev.jianyu360.com',
         changeOrigin: true,
         logLevel: 'debug',
         pathRewrite: {