接口环境设置
This commit is contained in:
@@ -27,8 +27,7 @@
|
||||
<input class="login-box-input-main" v-model="pwdForm.account" placeholder="请输入账号" />
|
||||
</view>
|
||||
<view class="login-box-input mt40">
|
||||
<input type="password" class="login-box-input-main" v-model="pwdForm.pwd"
|
||||
placeholder="请输入密码" />
|
||||
<input type="password" class="login-box-input-main" v-model="pwdForm.pwd" placeholder="请输入密码" />
|
||||
</view>
|
||||
<!-- <view class="login-box-input mt40">
|
||||
<view class="login-box-input-icon"></view>
|
||||
@@ -56,6 +55,7 @@
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import { apiGetYms, apiLogin } from '@/common/api/user'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
@@ -79,7 +79,15 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
getCode () {
|
||||
async getCode () {
|
||||
if (!this.yzmForm.phone) {
|
||||
return this.$util.toast('请输入手机号!')
|
||||
}
|
||||
const res = await apiGetYms({
|
||||
phone: this.yzmForm.phone,
|
||||
type: 0,
|
||||
})
|
||||
console.log(res);
|
||||
this.waitTime = 60
|
||||
this.inter = setInterval(() => {
|
||||
if (this.waitTime == 0) {
|
||||
@@ -90,6 +98,7 @@ export default {
|
||||
}, 1000)
|
||||
},
|
||||
login () {
|
||||
console.log(this.loginType);
|
||||
if (this.loginType == 'pwd') {
|
||||
this.pwdLogin()
|
||||
} else {
|
||||
@@ -97,24 +106,44 @@ export default {
|
||||
}
|
||||
},
|
||||
pwdLogin () {
|
||||
console.log({
|
||||
phone: this.yzmForm.phone,
|
||||
key: this.yzmForm.pwd,
|
||||
type: 1,
|
||||
})
|
||||
if (!this.pwdForm.account && !this.pwdForm.pwd) {
|
||||
return this.$util.toast('请填写登录信息!')
|
||||
}
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
apiLogin({
|
||||
phone: this.yzmForm.phone,
|
||||
key: this.yzmForm.pwd,
|
||||
type: 1,
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
uni.setStorageSync('userInfo', res.data)
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
})
|
||||
},
|
||||
yzmLogin () {
|
||||
if (!this.yzmForm.phone && !this.yzmForm.code) {
|
||||
return this.$util.toast('请填写登录信息!')
|
||||
}
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
apiLogin({
|
||||
phone: this.yzmForm.phone,
|
||||
key: this.yzmForm.code,
|
||||
type: 0,
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
uni.setStorageSync('userInfo', res.data)
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
onLoad (o) {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user