Browse Source

bug修改

1004749546@qq.com 4 years ago
parent
commit
c0b55f66fc
3 changed files with 34 additions and 9 deletions
  1. 3 1
      libs/tools.js
  2. 29 6
      pages/userCenter/changePwd.vue
  3. 2 2
      pages/userCenter/index.vue

+ 3 - 1
libs/tools.js

@@ -27,10 +27,12 @@ export function parseQueryString(url) {
 // 保存图片到阿里云
 export const saveImgToAliOss = function(src,callback){
 	console.log(src,getApp().globalData.baseUrl,'getApp().globalData.baseUrl')
+	const authorization = getApp().globalData.token
 	uni.uploadFile({
-		url: getApp().globalData.baseUrl + 'upload', //自行修改各自的对应的接口 
+		url: getApp().globalData.baseUrl + 'upload/', //自行修改各自的对应的接口 
 		filePath: src,
 		name: 'file',
+		header: {'X-AUTH-TOKEN':authorization},
 		success: (uploadFileRes) => {
 			if (uploadFileRes) {
 				let res = JSON.parse(uploadFileRes.data);

+ 29 - 6
pages/userCenter/changePwd.vue

@@ -5,15 +5,15 @@
 			<view class="input-group">
 				<view class="input-row border">
 					<text class="title">原密码:</text>
-					<m-input class="m-input" :maxlength="12"  type="password"  displayable v-model="formCustom.oldPwd" placeholder="请输入原密码"></m-input>
+					<m-input class="m-input" :maxlength="12" @input="getOldPwd" type="password"  displayable v-model="formCustom.oldPwd" placeholder="请输入原密码"></m-input>
 				</view>
 				<view class="input-row">
 					<text class="title">新密码:</text>
-					<m-input class="m-input" :maxlength="12" type="password" displayable v-model="formCustom.passwd" placeholder="请输入6-12位新密码"></m-input>
+					<m-input class="m-input" :maxlength="12" @input="getPasswd" type="password" displayable v-model="formCustom.passwd" placeholder="请输入6-12位新密码"></m-input>
 				</view>
 				<view class="input-row">
 					<text class="title">再次输入:</text>
-					<m-input class="m-input" :maxlength="12" type="password" displayable v-model="formCustom.passwdCheck" placeholder="请输入6-12位新密码"></m-input>
+					<m-input class="m-input" :maxlength="12" @input="getPasswdCheck" type="password" displayable v-model="formCustom.passwdCheck" placeholder="请输入6-12位新密码"></m-input>
 				</view>
 			</view>
 		</view>
@@ -56,6 +56,31 @@
 					title: info
 				})
 			},
+			// 不能输入汉字
+			getOldPwd(val) {
+				console.log(val,'vvvvvvv')
+				 if (/[\u4E00-\u9FA5]/g.test(val)) {
+					this.$nextTick(() => {
+						this.formCustom.oldPwd = ''
+					})
+				}
+			},
+			getPasswd(val) {
+				console.log(val,'vvvvvvv')
+				 if (/[\u4E00-\u9FA5]/g.test(val)) {
+					this.$nextTick(() => {
+						this.formCustom.passwd = ''
+					})
+				}
+			},
+			getPasswdCheck(val) {
+				console.log(val,'vvvvvvv')
+				 if (/[\u4E00-\u9FA5]/g.test(val)) {
+					this.$nextTick(() => {
+						this.formCustom.passwdCheck = ''
+					})
+				}
+			},
 			handleSubmit(){
 				let _this = this
 				//非空判断密码长度判断
@@ -154,10 +179,8 @@
 				line-height: 32px;
 				display: flex;
 				align-items: center;
+				justify-content: space-between;
 				.title{
-					width:140rpx;
-					display: inline-block;
-					text-align: left;
 					color:#808080;
 				}
 			}

+ 2 - 2
pages/userCenter/index.vue

@@ -7,8 +7,8 @@
 				<u-image v-show="!hasLogin" src="/static/logo.png" width="100" height="100"></u-image>
 			</view>
 			<view class="user-info">
-				<view v-if="hasLogin" class="user-info-item">{{userData.stationName}}</view>
-				<view v-if="hasLogin" class="user-info-item">{{userData.gatherName||''}} {{userData.gatherPhone}}</view>
+				<view v-if="hasLogin" class="user-info-item">{{userData.stationName || ''}}</view>
+				<view v-if="hasLogin" class="user-info-item">{{userData.gatherName||''}} {{userData.gatherPhone || ''}}</view>
 				<u-button v-else="!hasLogin" plain size="mini" shape="circle" @click="toLoginPage">立即登录</u-button>
 			</view>
 		</view>