shish 4 лет назад
Родитель
Сommit
cc82197163

+ 31 - 44
ghsApp/src/admin/home/login.vue

@@ -39,50 +39,44 @@ export default {
 							let openid = res.authResult.openid
 							let access_token = res.authResult.access_token
 							phoneLogin({openid,access_token}).then(subRes=>{
-								let currentShopId = subRes.data.admin.currentShopId || 0
-								if(Number(currentShopId) > 0){
-									//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
-									if(subRes.code == 1){
-										if (that.$util.isEmpty(subRes)) {
+								let token = subRes.data.token || ''
+								uni.hideLoading()
+								if (that.$util.isEmpty(token)) {
+									that.$msg('请先注册')
+									return false
+								}
+								//有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+								if(subRes.code == 1){
+									if (that.$util.isEmpty(subRes)) {
+										return false
+									}
+									uni.setStorageSync('token', subRes.data.token)
+									uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
+									getDictionaries({ token: subRes.data.token }).then(res => {
+										if (that.$util.isEmpty(res)) {
 											return false
 										}
-										uni.setStorageSync('token', subRes.data.token)
-										uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
-										getDictionaries({ token: subRes.data.token }).then(res => {
-											if (that.$util.isEmpty(res)) {
-												return false
-											}
-											that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
-											that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
-										})
-										that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-
-										that.show_login_model = false
-
-										getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+										that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+										that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+									})
+									that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
 
-										//#ifdef APP-PLUS
-										that.skCustomId = subRes.data.skCustomId
-										that.listenPDAkd()
-										// #endif
+									getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
 
-										that.setUserShopAll()
-										that.init()
+									that.setUserShopAll()
+									that.init()
 
-										// #ifdef APP-PLUS
-										//保存安卓的clientId
-										let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
-										const clientInfo = plus.push.getClientInfo()
-										let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
-										if(hasClientId == '' || hasClientId != currentClientId){
-											replaceClientId({id:currentClientId}).then(res=>{ })
-										}
-										// #endif
+									// #ifdef APP-PLUS
+									//保存安卓的clientId
+									let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+									const clientInfo = plus.push.getClientInfo()
+									let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+									if(hasClientId == '' || hasClientId != currentClientId){
+										replaceClientId({id:currentClientId}).then(res=>{ })
 									}
-									uni.hideLoading()
-								}else{
-									that.$msg('您还没有注册')
+									// #endif
 								}
+								
 							})
 						},
 						fail(res){  
@@ -126,15 +120,8 @@ export default {
 					})
 					that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
 
-					that.show_login_model = false
-
 					getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
 
-					//#ifdef APP-PLUS
-					that.skCustomId = subRes.data.skCustomId
-					that.listenPDAkd()
-					// #endif
-
 					that.setUserShopAll()
 					that.init()
 					uni.hideLoading()

+ 7 - 3
ghsApp/src/admin/home/me.vue

@@ -18,14 +18,18 @@
         <view class="me-shop_content content_box">
           <view class="me-shop_top">
             <view class="shop-top_left">
-              <image :src="shopInfo.shopImg" style="width:110upx;border-radius:100upx;" mode="widthFix"></image>
+
+              <image :src="shopInfo.shopImg" style="width:110upx;border-radius:100upx;" mode="widthFix" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
+              </image>
+              <image :src="shopInfo.shopImg" style="width:110upx;border-radius:100upx;" mode="widthFix" @click="pageTo({url:'/admin/home/login'})" v-else>
+              </image>
 
               <view class="top-info_box" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
                 <view> {{ shopInfo.shopName }} </view>
                 <view> <text>{{ shopInfo.sjName }} | SID {{shopInfo.shopId}}</text> </view>
               </view>
-              <view class="top-info_box" style="font-size:38upx;" @click="pageTo({url:'/admin/home/login'})" v-else>
-                <view> 登录/注册 </view>
+              <view class="top-info_box" @click="pageTo({url:'/admin/home/login'})" v-else>
+                <view style="font-size:40upx;"> 登录/注册 </view>
               </view>
 
             </view>

+ 0 - 9
ghsApp/src/admin/item/components/htz-image-upload/htz-image-upload.vue

@@ -334,10 +334,8 @@
 						this.imgUpload(filePaths);
 					} else {
 						if (this.compress) { //设置了需要压缩
-						console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1')
 							this.imgCompress(filePaths);
 						} else {
-							console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2')
 							this.imgUpload(filePaths);
 						}
 					}
@@ -386,7 +384,6 @@
 					.then((results) => {
 						uni.hideLoading();
 						console.log('imgUpload', results)
-						console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3')
 						this.imgUpload(results);
 					})
 					.catch((res, object) => {
@@ -418,20 +415,14 @@
 							formData: this.formData,
 							header: this.headers,
 							success: (uploadFileRes) => {
-								//uni.hideLoading();
-								//console.log(typeof this.uploadSuccess)
-								//console.log('')
-								console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4')
 								if (typeof this.uploadSuccess == 'function') {
 									if (this.uploadSuccess(uploadFileRes).success) {
 										this.value.push(this.uploadSuccess(uploadFileRes)
 											.url)
-											console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5')
 										this.$emit("input", this.uploadLists);
 									}
 								}
 								resolve(uploadFileRes);
-								console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6')
 								this.$emit("uploadSuccess", uploadFileRes);
 							},
 							fail: (err) => {

+ 2 - 1
ghsApp/src/mixins/globalMixins.js

@@ -58,7 +58,8 @@ export default {
       //微信小程序第一次打开小程序时尝试登录一次
       var pages = getCurrentPages()
 			let currentRoute  = pages[pages.length-1].route;
-      if(currentRoute == 'admin/home/workbench'){
+      let token = uni.getStorageSync('token')
+      if(currentRoute == 'admin/home/workbench' && this.$util.isEmpty(token)){
         wxMiniLogin(true).then(res => {
           let token = res.token || ''
           if (!this.$util.isEmpty(token)) {

+ 0 - 9
ghsApp/src/pagesClient/components/htz-image-upload/htz-image-upload.vue

@@ -335,10 +335,8 @@
 						this.imgUpload(filePaths);
 					} else {
 						if (this.compress) { //设置了需要压缩
-						console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1')
 							this.imgCompress(filePaths);
 						} else {
-							console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2')
 							this.imgUpload(filePaths);
 						}
 					}
@@ -387,7 +385,6 @@
 					.then((results) => {
 						uni.hideLoading();
 						console.log('imgUpload', results)
-						console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3')
 						this.imgUpload(results);
 					})
 					.catch((res, object) => {
@@ -419,20 +416,14 @@
 							formData: this.formData,
 							header: this.headers,
 							success: (uploadFileRes) => {
-								//uni.hideLoading();
-								//console.log(typeof this.uploadSuccess)
-								//console.log('')
-								console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4')
 								if (typeof this.uploadSuccess == 'function') {
 									if (this.uploadSuccess(uploadFileRes).success) {
 										this.value.push(this.uploadSuccess(uploadFileRes)
 											.url)
-											console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5')
 										this.$emit("input", this.uploadLists);
 									}
 								}
 								resolve(uploadFileRes);
-								console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6')
 								this.$emit("uploadSuccess", uploadFileRes);
 							},
 							fail: (err) => {

+ 1 - 1
ghsApp/src/pagesClient/official/apply.vue

@@ -46,7 +46,7 @@
 
           <tui-list-cell class="line-cell" :hover="false">
               <div class="tui-title required">验证码</div>
-              <input v-model="form.authCode" style="width:330upx;" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="authCode" placeholder="请填写验证码" />
+              <input v-model="form.authCode" type="number" style="width:330upx;" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="authCode" placeholder="请填写验证码" />
               <button v-if="hasGet == false" class="admin-button-com blue middle" @click="requestAuthCode()">获取</button>
               <button v-else class="admin-button-com default middle" >{{count}}</button>
           </tui-list-cell>