Преглед на файлове

wesmiler 报恩寺项目web提交

wesmiler преди 4 години
родител
ревизия
2e44872e6e

+ 5 - 2
App.vue

@@ -4,11 +4,14 @@
 		onLaunch: function() {
 			console.log('App Launch')
 			console.log(this.$store.state)
+			console.log(this.$router.history.current.path)
 			if(this.$store.state.token == '' && this.$router.history.current.path != '/pages/entry/auth'){
-				console.log(this.$store.state)
-				uni.navigateTo({
+				console.log(66)
+				/*uni.navigateTo({
 					url: '/pages/entry/auth?reback_url='+location.href
 				})
+				*/
+			
 			}
 		},
 		onShow: function() {

+ 1 - 1
pages.json

@@ -20,7 +20,7 @@
 			"path": "pages/entry/auth",//登录
 		    "style": {
 		        "navigationStyle":"custom",//添加自定义配置
-				"navigationBarTitleText":"授权"
+				"navigationBarTitleText":"微信授权"
 		    }
 		},
 		{

+ 6 - 4
pages/entry/auth.vue

@@ -13,7 +13,8 @@
 			uni.showLoading({
 				title: 'loading'
 			})
-			
+			sessionStorage.setItem('option', option)
+		
 			// 授权调用
 			if(typeof(option.code) != 'undefined' && option.code){
 				this.userAuth(option.code);
@@ -26,7 +27,7 @@
 		methods: {
 			// 获取授权地址
 			getAuthUrl() {
-				this.$request.api('/api/auth/url', {url: document.location.protocol+'://'+document.domain+'/page/entry/auth'}).then(res => {
+				this.$request.api('/api/auth/url', {url: document.location.protocol+'//'+document.location.host+'/pages/entry/auth'}).then(res => {
 					uni.hideLoading()
 					if(res.success == true){
 						location.href = res.data
@@ -44,14 +45,15 @@
 			userAuth(code) {
 				let _uni = this
 				let redirceUrl = sessionStorage.getItem('redirceUrl')
-				redirceUrl = typeof(redirceUrl)!= 'undefined'? redirceUrl : location.domain+'/pages/index/index';
+				redirceUrl = typeof(redirceUrl)!= 'undefined' && redirceUrl != 'undefined'? redirceUrl : document.location.host+'/pages/index/index';
+				
 				this.$request.api('/api/auth', {code: code}).then(res => {
 					console.log(res)
 					uni.hideLoading()
 					let accessToken = typeof(res.access_token)!= 'undefined'? res.access_token : ''
 					if(res.success == true && accessToken){
 							_uni.$store.commit('setToken', res);
-							location.href = redirceUrl
+							//location.href = redirceUrl
 					}else{
 						uni.showModal({
 						    title: '错误提示',

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
unpackage/dist/build/h5/index.html


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
unpackage/dist/build/h5/static/js/index.15250a0b.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 1
unpackage/dist/build/h5/static/js/index.f7aea8d1.js


Файловите разлики са ограничени, защото са твърде много
+ 1 - 0
unpackage/dist/build/h5/static/js/pages-entry-auth.6d8990fc.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 1
unpackage/dist/build/h5/static/js/pages-entry-auth.73b2c72e.js