|
@@ -31,6 +31,19 @@
|
|
|
placeholder="请输入密码"
|
|
|
></uni-easyinput>
|
|
|
</view>
|
|
|
+ <view class="uni-flex uni-row">
|
|
|
+ <view class="flex-item login-bottom-info" style="-webkit-flex: 1;flex: 1;text-decoration: underline;" @click="ChangeApiAddress">
|
|
|
+ 修改后台API接口地址
|
|
|
+ </view>
|
|
|
+ <view style="font-size: 0.92em;color: #5555ff;-webkit-flex: 1;flex: 1;-webkit-justify-content: center;justify-content: center;-webkit-align-items: center;align-items: center;">
|
|
|
+ <checkbox-group @change="selfChanged">
|
|
|
+ <checkbox class="flex-item" style="transform:scale(0.75);" :checked="saveUserPswFlag" />记住用户和密码
|
|
|
+ </checkbox-group>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="login-bottom-info" @click="ChangeApiAddress">
|
|
|
+ 修改后台API接口地址
|
|
|
+ </view> -->
|
|
|
<view class="login-card-loginIn">
|
|
|
<view class="login-card-loginIn-btn" @click="BtnLoginClick">
|
|
|
登 录
|
|
@@ -39,9 +52,6 @@
|
|
|
退 出
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- <view class="login-bottom-info">
|
|
|
- 忘记密码
|
|
|
- </view> -->
|
|
|
</view>
|
|
|
<view class="bottom-message">
|
|
|
Copyright ©2023 NAURA 北京七星华创集成电路装备有限公司
|
|
@@ -52,6 +62,12 @@
|
|
|
<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
|
|
|
</uni-popup>
|
|
|
</view>
|
|
|
+ <view>
|
|
|
+ <!-- 输入框示例 -->
|
|
|
+ <uni-popup ref="inputDialog" type="dialog">
|
|
|
+ <uni-popup-dialog ref="inputClose" mode="input" title="修改后台API接口地址" :value="baseUrl" placeholder="请输入内容" @confirm="dialogInputConfirm"></uni-popup-dialog>
|
|
|
+ </uni-popup>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -59,133 +75,152 @@
|
|
|
<script>
|
|
|
import store from "@/store/index.js"
|
|
|
export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 输入框边框颜色默认值
|
|
|
- colorDefault:'#b4b4b4',
|
|
|
- // 输入框边框聚焦值
|
|
|
- colorFocusColor:'#3cb79a',
|
|
|
- // 输入框颜色配置
|
|
|
- inputColorConfigToUserName: {
|
|
|
- color: "#000000",
|
|
|
- disableColor: "#eee",
|
|
|
- borderColor: "#b4b4b4",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 输入框边框颜色默认值
|
|
|
+ colorDefault:'#b4b4b4',
|
|
|
+ // 输入框边框聚焦值
|
|
|
+ colorFocusColor:'#3cb79a',
|
|
|
+ // 输入框颜色配置
|
|
|
+ inputColorConfigToUserName: {
|
|
|
+ color: "#000000",
|
|
|
+ disableColor: "#eee",
|
|
|
+ borderColor: "#b4b4b4",
|
|
|
+ },
|
|
|
+ // 输入框颜色配置
|
|
|
+ inputColorConfigToPassWord: {
|
|
|
+ color: "#000000",
|
|
|
+ disableColor: "#eee",
|
|
|
+ borderColor: "#b4b4b4",
|
|
|
+ },
|
|
|
+ userNo: getApp().globalData.userName,
|
|
|
+ pswVal: getApp().globalData.password,
|
|
|
+ msgType: 'success',
|
|
|
+ messageText: '这是一条成功提示',
|
|
|
+ baseUrl: '',
|
|
|
+ saveUserPswFlag: true
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.baseUrl = uni.getStorageSync('BasrUrl');
|
|
|
+ this.userNo = uni.getStorageSync('UserNo');
|
|
|
+ this.pswVal = uni.getStorageSync('PswVal');
|
|
|
+ },
|
|
|
+ // onBackPress() {
|
|
|
+ // //console.log("111")
|
|
|
+ // return true
|
|
|
+ // },
|
|
|
+ methods: {
|
|
|
+ // 输入框聚焦变换边框样式
|
|
|
+ UserNamePassWrodFocusBorderStyle(){
|
|
|
+ this.inputColorConfigToUserName.borderColor
|
|
|
+ = this.colorFocusColor;
|
|
|
},
|
|
|
- // 输入框颜色配置
|
|
|
- inputColorConfigToPassWord: {
|
|
|
- color: "#000000",
|
|
|
- disableColor: "#eee",
|
|
|
- borderColor: "#b4b4b4",
|
|
|
+ PassWordFocusBorderStyle(){
|
|
|
+ this.inputColorConfigToPassWord.borderColor
|
|
|
+ = this.colorFocusColor;
|
|
|
},
|
|
|
- userNo: getApp().globalData.userName,
|
|
|
- pswVal: getApp().globalData.password,
|
|
|
- msgType: 'success',
|
|
|
- messageText: '这是一条成功提示',
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 输入框聚焦变换边框样式
|
|
|
- UserNamePassWrodFocusBorderStyle(){
|
|
|
- this.inputColorConfigToUserName.borderColor
|
|
|
- = this.colorFocusColor;
|
|
|
- },
|
|
|
- PassWordFocusBorderStyle(){
|
|
|
- this.inputColorConfigToPassWord.borderColor
|
|
|
- = this.colorFocusColor;
|
|
|
- },
|
|
|
- // 输入框失去焦点变换边框样式
|
|
|
- UserNamePassWrodBlurBorderStyle(){
|
|
|
- this.inputColorConfigToUserName.borderColor
|
|
|
- = this.colorDefault;
|
|
|
- },
|
|
|
- PassWordBlurBorderStyle(){
|
|
|
- this.inputColorConfigToPassWord.borderColor
|
|
|
- = this.colorDefault;
|
|
|
- },
|
|
|
- async BtnLoginClick() {
|
|
|
- uni.showLoading({
|
|
|
- title: "正在登录中......",
|
|
|
- mask: true,
|
|
|
- })
|
|
|
- let parm = {
|
|
|
- url : '/login',
|
|
|
- data: {
|
|
|
- username: this.userNo,
|
|
|
- password: this.pswVal
|
|
|
- },
|
|
|
- method: 'POST',
|
|
|
- isHaveToken : false
|
|
|
- }
|
|
|
- await getApp().RequestData(parm).then(
|
|
|
- value => {
|
|
|
- let retData = value
|
|
|
- if(retData.isSuccess) {
|
|
|
- if(retData.data.code == 200) {
|
|
|
- uni.hideLoading()
|
|
|
- uni.setStorage({
|
|
|
- key: 'userInfo',
|
|
|
- data: {username : "admin", tokenStr : retData.data.data},
|
|
|
- })
|
|
|
- uni.switchTab({
|
|
|
- url:"/pages/tabBar/inspect/inspect",
|
|
|
- })
|
|
|
+ // 输入框失去焦点变换边框样式
|
|
|
+ UserNamePassWrodBlurBorderStyle(){
|
|
|
+ this.inputColorConfigToUserName.borderColor
|
|
|
+ = this.colorDefault;
|
|
|
+ },
|
|
|
+ PassWordBlurBorderStyle(){
|
|
|
+ this.inputColorConfigToPassWord.borderColor
|
|
|
+ = this.colorDefault;
|
|
|
+ },
|
|
|
+ async BtnLoginClick() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "正在登录中......",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ let parm = {
|
|
|
+ url : '/login',
|
|
|
+ data: {
|
|
|
+ username: this.userNo,
|
|
|
+ password: this.pswVal
|
|
|
+ },
|
|
|
+ method: 'POST',
|
|
|
+ isHaveToken : false
|
|
|
+ }
|
|
|
+ let that = this;
|
|
|
+ await getApp().RequestData(parm).then(
|
|
|
+ value => {
|
|
|
+ let retData = value
|
|
|
+ if(retData.isSuccess) {
|
|
|
+ if(retData.data.code == 200) {
|
|
|
+ uni.hideLoading()
|
|
|
+ if(that.saveUserPswFlag) {
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'UserNo',
|
|
|
+ data: that.userNo,
|
|
|
+ })
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'PswVal',
|
|
|
+ data: that.pswVal,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ uni.removeStorage({
|
|
|
+ key: 'UserNo'
|
|
|
+ })
|
|
|
+ uni.removeStorage({
|
|
|
+ key: 'PswVal'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'userInfo',
|
|
|
+ data: {username : that.userNo, tokenStr : retData.data.data},
|
|
|
+ })
|
|
|
+ uni.switchTab({
|
|
|
+ url:"/pages/tabBar/inspect/inspect",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ uni.hideLoading()
|
|
|
+ let type = "登录失败!" + retData.data.msg + "!"
|
|
|
+ this.msgType = 'error'
|
|
|
+ this.messageText = `${type}`
|
|
|
+ this.$refs.message.open()
|
|
|
+ }
|
|
|
}
|
|
|
else {
|
|
|
uni.hideLoading()
|
|
|
- let type = "登录失败!" + retData.data.msg + "!"
|
|
|
+ let type = "登录失败!" + retData.retMsg + "!"
|
|
|
this.msgType = 'error'
|
|
|
this.messageText = `${type}`
|
|
|
this.$refs.message.open()
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ let retData = err
|
|
|
uni.hideLoading()
|
|
|
let type = "登录失败!" + retData.retMsg + "!"
|
|
|
this.msgType = 'error'
|
|
|
this.messageText = `${type}`
|
|
|
this.$refs.message.open()
|
|
|
}
|
|
|
- },
|
|
|
- err => {
|
|
|
- let retData = err
|
|
|
- uni.hideLoading()
|
|
|
- let type = "登录失败!" + retData.retMsg + "!"
|
|
|
- this.msgType = 'error'
|
|
|
- this.messageText = `${type}`
|
|
|
- this.$refs.message.open()
|
|
|
- }
|
|
|
- );
|
|
|
- // console.log(retData)
|
|
|
- // if(retData.isSuccess) {
|
|
|
- // if(retData.data.code == 200) {
|
|
|
- // uni.setStorage({
|
|
|
- // key: 'userInfo',
|
|
|
- // data: {username : "admin", tokenStr : retData.data.data},
|
|
|
- // })
|
|
|
- // uni.switchTab({
|
|
|
- // url:"/pages/tabBar/inspect/inspect",
|
|
|
- // })
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // let type = "登录失败!" + retData.data.msg + "!"
|
|
|
- // this.msgType = 'error'
|
|
|
- // this.messageText = `${type}`
|
|
|
- // this.$refs.message.open()
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // console.log(11)
|
|
|
- // let type = "登录失败!" + retData.retMsg + "!"
|
|
|
- // this.msgType = 'error'
|
|
|
- // this.messageText = `${type}`
|
|
|
- // this.$refs.message.open()
|
|
|
- // }
|
|
|
- },
|
|
|
- BtnExitClick() {
|
|
|
- let app = getApp()
|
|
|
- app.AppExit()
|
|
|
+ );
|
|
|
+ },
|
|
|
+ BtnExitClick() {
|
|
|
+ let app = getApp()
|
|
|
+ app.AppExit()
|
|
|
+ },
|
|
|
+ ChangeApiAddress() {
|
|
|
+ this.$refs.inputDialog.open()
|
|
|
+ },
|
|
|
+ dialogInputConfirm(e) {
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'BasrUrl',
|
|
|
+ data: e
|
|
|
+ });
|
|
|
+ getApp().globalData.baseUrl = e
|
|
|
+ this.baseUrl = e
|
|
|
+ },
|
|
|
+ selfChanged(e) {
|
|
|
+ this.saveUserPswFlag = !this.saveUserPswFlag;
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
@@ -242,7 +277,7 @@ export default {
|
|
|
.login-card-input {
|
|
|
// background-color: violet;
|
|
|
height: 50%;
|
|
|
- padding: 5rpx;
|
|
|
+ padding: 1rpx;
|
|
|
}
|
|
|
.login-card-title {
|
|
|
height: 20%;
|
|
@@ -275,12 +310,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.login-bottom-info{
|
|
|
- height: 5%;
|
|
|
- display: flex;
|
|
|
- font-size: 0.7em;
|
|
|
- color: #3cb79a;
|
|
|
- justify-content: end;
|
|
|
-
|
|
|
+ // height: 5%;
|
|
|
+ // display: flex;
|
|
|
+ font-size: 0.9em;
|
|
|
+ color: #aa00ff;
|
|
|
+ // justify-content: center;
|
|
|
}
|
|
|
}
|
|
|
.bottom-message{
|