XiaBx преди 3 години
родител
ревизия
3651db17fc
променени са 7 файла, в които са добавени 17 реда и са изтрити 10 реда
  1. 1 0
      src/api/axios.js
  2. 2 2
      src/api/config.js
  3. 6 4
      src/api/index.js
  4. 4 1
      src/main.js
  5. 1 2
      src/view/book-catalog.vue
  6. 1 1
      src/view/reader.vue
  7. 2 0
      src/view/yun.vue

+ 1 - 0
src/api/axios.js

@@ -5,6 +5,7 @@ import { undefinedCollect } from "./index.js";
 import { getToken, refreshToken } from "./config";
 import { addPendingRequest, removePendingRequest } from "./cancelRepeatRquest";
 import { Toast } from "mint-ui";
+
 // var instance = axios.create(
 //   process.env.NODE_ENV === "development"
 //     ? {

+ 2 - 2
src/api/config.js

@@ -1,6 +1,6 @@
 import { userLogin } from "./index";
 import Qs from "qs";
-
+import Vue from 'vue'
 export async function getToken(config) {
   return login();
 }
@@ -10,7 +10,7 @@ export async function login() {
   const timestamp = parseInt(new Date().valueOf() / 1000);
   let data = {
     timestamp,
-    send_order_id: localStorage.getItem("sendid") || ""
+    send_order_id: Vue.prototype.sendid || localStorage.getItem("sendid") || ''
   };
   let ret = await userLogin(data);
   if (ret) {

+ 6 - 4
src/api/index.js

@@ -226,6 +226,8 @@ export function getSignRecord(page = 1) {
   return axios(`/user/sign_record?page=${page}`);
 }
 
+
+const sendid = localStorage.getItem('sendid')
 //获取章节内容
 // 创建一个同款推荐的缓存池
 
@@ -252,10 +254,10 @@ let content = new cache({
 
 export function getContent(bid, cid, adStatus = 0, from, code = "") {
   let url = options.adTargetId
-    ? `/books/${bid}/chapters/${cid}?ad_status=${adStatus}&page_from=${from}&code=${encodeURIComponent(
+    ? `/books/${bid}/chapters/${cid}?ad_status=${adStatus}&page_from=${from}&send_oerder_id=${sendid}&code=${encodeURIComponent(
         code
       )}`
-    : `/books/${bid}/chapters/${cid}?page_from=${from}&code=${encodeURIComponent(
+    : `/books/${bid}/chapters/${cid}?page_from=${from}&send_oerder_id=${sendid}&code=${encodeURIComponent(
         code
       )}`;
   return content
@@ -630,6 +632,6 @@ export function uuidsGetTokens(uuid) {
 }
 
 //记录用户加桌状态
-export function setUserMode(status) {
-  return axios.post(`/setAddDeskStatus`, {  add_desk_status: status  });
+export function setUserMode(status,send_order_id) {
+  return axios.post(`/setAddDeskStatus`, {  add_desk_status: status,send_order_id  });
 }

+ 4 - 1
src/main.js

@@ -16,7 +16,7 @@ fundebug.apikey =
 // import './api'
 // import vconsole from 'vconsole'
 Vue.config.productionTip = false;
-
+Vue.prototype.sendid = '';
 if (process.env.NODE_ENV === "production") {  
   // fundebug.silentVideo = false
   // 事件过滤 过滤掉一些不必要的错误
@@ -40,6 +40,9 @@ if (process.env.NODE_ENV === "production") {
     );
   }
 
+
+
+
   Vue.config.errorHandler = function(err, vm, info) {
     var componentName = formatComponentName(vm);
     var propsData = vm.$options && vm.$options.propsData;

+ 1 - 2
src/view/book-catalog.vue

@@ -215,8 +215,7 @@ export default {
             bid,
             cid,
             uuids:this.uuids,
-            sendid:this.$route.query.sendid || localStorage.getItem('sendid'),
-            yun: this.$route.query.yun
+            sendid:this.$route.query.sendid || localStorage.getItem('sendid')
           },
         });
       }

+ 1 - 1
src/view/reader.vue

@@ -753,7 +753,7 @@ export default {
 
     const token = localStorage.getItem("token");
     if (token) {
-      setUserMode(Number(window.navigator.standalone) || 0).then(res => {});
+      setUserMode(Number(window.navigator.standalone) || 0,sendid).then(res => {});
     }
 
     if (

+ 2 - 0
src/view/yun.vue

@@ -5,6 +5,7 @@
 <script>
 import { Yun } from "./namespace";
 import { getYun } from "../api";
+import Vue from 'vue';
 export default {
   name: Yun.name,
   data() {
@@ -12,6 +13,7 @@ export default {
   },
   created() {
     if (this.$route.params.id) {
+      Vue.prototype.sendid = this.$route.params.id;
       localStorage.setItem("sendid", this.$route.params.id);
       this.getYun();