对部分影响追剧页面展示的请求进行额外处理
This commit is contained in:
@@ -1,8 +1,13 @@
|
|||||||
import configdata from './config'
|
import configdata from './config'
|
||||||
import cache from './cache'
|
import cache from './cache'
|
||||||
import {
|
import {
|
||||||
cacheClearAll
|
cacheClearAll,cacheClear
|
||||||
} from '@/store/cashe.js'
|
} from '@/store/cashe.js'
|
||||||
|
function successCallBack(url){
|
||||||
|
if(url.includes('app/courseCollect/insertCourseCollect')){
|
||||||
|
cacheClear('chasingDrama')
|
||||||
|
}
|
||||||
|
}
|
||||||
module.exports = {
|
module.exports = {
|
||||||
config: function(name) {
|
config: function(name) {
|
||||||
var info = null;
|
var info = null;
|
||||||
@@ -24,7 +29,6 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(info);
|
|
||||||
return info;
|
return info;
|
||||||
},
|
},
|
||||||
logout: function() {
|
logout: function() {
|
||||||
@@ -152,7 +156,11 @@ module.exports = {
|
|||||||
success: function(result) {
|
success: function(result) {
|
||||||
if (result.data.code == 401) {
|
if (result.data.code == 401) {
|
||||||
that.logout();
|
that.logout();
|
||||||
|
}else{
|
||||||
|
successCallBack(url)
|
||||||
|
// cacheClear('chasingDrama')
|
||||||
}
|
}
|
||||||
|
|
||||||
succ.call(self, result.data)
|
succ.call(self, result.data)
|
||||||
},
|
},
|
||||||
fail: function(e) {
|
fail: function(e) {
|
||||||
@@ -186,7 +194,6 @@ module.exports = {
|
|||||||
let that = this;
|
let that = this;
|
||||||
header = header || "application/x-www-form-urlencoded";
|
header = header || "application/x-www-form-urlencoded";
|
||||||
url = that.config("APIHOST1") + url.replace(/^\//, "");
|
url = that.config("APIHOST1") + url.replace(/^\//, "");
|
||||||
console.log(url);
|
|
||||||
// let token = uni.getStorageSync("token");
|
// let token = uni.getStorageSync("token");
|
||||||
let token = uni.getStorageSync("token");
|
let token = uni.getStorageSync("token");
|
||||||
if (token) {
|
if (token) {
|
||||||
|
|||||||
Reference in New Issue
Block a user