Ver Fonte

修复页面

hejie há 3 anos atrás
pai
commit
856ca5b216

+ 1 - 1
src/pages/about/index.vue

@@ -23,7 +23,7 @@ import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
 		methods:{
 			loadData(){
 				let data = {
-					type:1
+					type:7
 				}
 				post("/my/article",data).then(res => {
 				  if (res.code == 0) {

+ 1 - 1
src/pages/course/index.vue

@@ -23,7 +23,7 @@ import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
 		methods:{
 			loadData(){
 				let data = {
-					type:3
+					type:1
 				}
 				post("/my/article",data).then(res => {
 				  if (res.code == 0) {

+ 8 - 6
src/pages/my/index.vue

@@ -287,13 +287,17 @@
 			// }
 		},
 		onShow: function() {
+			let token = uni.getStorageSync("token");
+			
 			this.userinfo = uni.getStorageSync("userinfo");
 			this.isShiMing = this.userinfo.is_authentication == 0 ? true : false;
-			this.getuserInfo();
-			let token = uni.getStorageSync("token");
+			
 			if (!token) {
 				this.login();
 			}
+			if(token){
+				this.getuserInfo();
+			}
 		},
 		methods: {
 			login() {
@@ -312,10 +316,8 @@
 										that.getuserInfo();
 									} else {
 										that.unid = res.data.unid;
-										setTimeout(() => {
-											that.shopInfo = app.globalData.shopInfo;
-											that.showAuth = true;
-										}, 1000);
+										that.shopInfo = app.globalData.shopInfo;
+										that.showAuth = true;
 									}
 								}
 							});

+ 1 - 1
src/pages/notice/index.vue

@@ -23,7 +23,7 @@ import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
 		methods:{
 			loadData(){
 				let data = {
-					type:2
+					type:8
 				}
 				post("/my/article",data).then(res => {
 				  if (res.code == 0) {

+ 1 - 1
src/pages/tea-rule/index.vue

@@ -23,7 +23,7 @@ import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
 		methods:{
 			loadData(){
 				let data = {
-					type:4
+					type:24
 				}
 				post("/my/article",data).then(res => {
 				  if (res.code == 0) {

+ 16 - 16
src/request/request.js

@@ -1,7 +1,15 @@
 import host from "./config.js"
-import { goto } from '@/utils/myfun.js';
+import {
+	goto
+} from '@/utils/myfun.js';
 
-export default ({ url, method, params, header, baseURL }) => {
+export default ({
+	url,
+	method,
+	params,
+	header,
+	baseURL
+}) => {
 	baseURL = baseURL ? baseURL : host.Hhost;
 
 	return new Promise((resolve, reject) => {
@@ -19,7 +27,7 @@ export default ({ url, method, params, header, baseURL }) => {
 				reject(err);
 			},
 			complete() {
-				uni.hideLoading();
+				// uni.hideLoading();
 			}
 		});
 	});
@@ -29,18 +37,10 @@ uni.addInterceptor('request', {
 	invoke(args) {
 		// console.log('interceptor-invoke', args)		//请求前
 		let token = uni.getStorageSync('token');
-		if(token) args.header.token = token;
+		if (token) args.header.token = token;
 	},
 	success(args) { //请求成功
-		if (args.data.resultCode && args.data.resultCode != 1) {
-			uni.showToast({
-				title: args.data.errorMessage,
-				duration: 2000,
-				icon: "none",
-			});
-		}
-
-		if(args.data.code == 400){
+		if (args.data.code == 400) {
 			uni.removeStorageSync('token');
 			uni.showToast({
 				title: args.data.msg,
@@ -58,15 +58,15 @@ uni.addInterceptor('request', {
 				// #endif
 			}, 1500);
 		}
-		if(args.data.code === -1){
+		if (args.data.code == -1) {
 			uni.showToast({
 				title: args.data.msg,
-				duration: 2000,
+				duration: 3000,
 				icon: "none",
 			});
 		}
 
-		if(args.data.code === 301){
+		if (args.data.code === 301) {
 			uni.showToast({
 				title: args.data.msg,
 				duration: 2000,