1004749546@qq.com 4 anos atrás
pai
commit
e3fbe517a1
6 arquivos alterados com 5 adições e 20 exclusões
  1. 1 1
      App.vue
  2. 0 2
      libs/axios.js
  3. 1 0
      pages/login/login.vue
  4. 2 1
      pages/userCenter/index.vue
  5. 1 0
      pages/work/index/index.vue
  6. 0 16
      store/index.js

+ 1 - 1
App.vue

@@ -1,6 +1,6 @@
 <script>
 	// const uat_URL = 'http://md.test.zyucgj.com/saas/clz/' // 预发布
-	const uat_URL = 'http://192.168.16.105:8103/cw-wechat/' // 本地
+	const uat_URL = 'http://192.168.16.103:8103/cw-wechat/' // 本地
 	const pro_URL = 'https://car.zyucgj.com/saas/clz/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 0 - 2
libs/axios.js

@@ -2,7 +2,6 @@ const baseUrl = getApp().globalData.baseUrl
 //带Token请求
 const request = (opts, hasToken) => {
 	const authorization = getApp().globalData.token
-	// console.log(opts, 'opts')
 	// console.log(authorization,'authorization')
 	//  hasToken是否传入token,为true则不传token
 	const header = {
@@ -18,7 +17,6 @@ const request = (opts, hasToken) => {
 		method: opts.method,
 		header: opts.header ? opts.header : header
 	}
-	console.log(DefaultOpts, 'DefaultOpts')
 	let promise = new Promise(function(resolve, reject) {
 		uni.request(DefaultOpts).then(
 			(res) => {

+ 1 - 0
pages/login/login.vue

@@ -41,6 +41,7 @@
 				console.log(e.target.encryptedData,'eeeeeee')
 				if (e.target.errMsg === 'getPhoneNumber:ok') {
 					uni.login({
+						provider: 'weixin',
 						success(res) {
 							login({
 								code: res.code,

+ 2 - 1
pages/userCenter/index.vue

@@ -36,9 +36,10 @@
 				}
 			};
 		},
-		onLoad() {
+		onShow() {
 			let _this = this
 			uni.getUserInfo({
+				provider: 'weixin',
 				success(e) {
 					console.log(e)
 					_this.userInfo = e.userInfo

+ 1 - 0
pages/work/index/index.vue

@@ -141,6 +141,7 @@ export default {
 		startWashCar(){
 			this.step= 0;
 			this.showStart = true;
+			this.$store.commit("$sendWebsocket",'start')
 			// 启动成功
 			setTimeout(() => {
 				this.status = 'working';

+ 0 - 16
store/index.js

@@ -75,8 +75,6 @@ const store = new Vuex.Store({
 			    url: wsUrl, // ws 请求地址
 			    complete: ()=> {
 					console.log('连接complete回调!')
-					// 刷新未读消息数量
-					uni.$emit("updateUnreadcount",{msg:''})
 				}
 			});
 			// 打开连接
@@ -135,20 +133,6 @@ const store = new Vuex.Store({
 				}
 			})
 		},
-	},
-	actions: {
-		// 检测是否登录
-		checkLogin(context,data){
-			checkLogin().then(res => {
-				if(res.status == '200'){
-					context.commit('$uStore',{name:'vuex_hasLogin',value:true})
-					context.commit('$uStore',{name:'vuex_token',value: res.data.token})
-				}else{
-					context.commit('$uStore',{name:'vuex_hasLogin',value:false})
-					context.commit('$uStore',{name:'vuex_token',value: ''})
-				}
-			})
-		}
 	}
 })