|
@@ -2,14 +2,13 @@
|
|
<view class="body2">
|
|
<view class="body2">
|
|
<u-navbar title="湖里区不可移动文物数字化监管平台" bgColor="#071d4f" :leftIconSize="0" titleStyle=" font-weight:bold;color:#25d7f2"></u-navbar>
|
|
<u-navbar title="湖里区不可移动文物数字化监管平台" bgColor="#071d4f" :leftIconSize="0" titleStyle=" font-weight:bold;color:#25d7f2"></u-navbar>
|
|
<block>
|
|
<block>
|
|
- <!-- #ifndef MP-WEIXIN -->
|
|
|
|
<view class="login-bg">
|
|
<view class="login-bg">
|
|
<view class="login-card">
|
|
<view class="login-card">
|
|
<view class="login-head">
|
|
<view class="login-head">
|
|
<image class="logoimg" src="@/static/img/safe.png" mode="widthFix"></image>
|
|
<image class="logoimg" src="@/static/img/safe.png" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
<view class="login-input login-margin-b">
|
|
<view class="login-input login-margin-b">
|
|
- <input v-model="username" placeholder="请输入手机号" />
|
|
|
|
|
|
+ <input v-model="username" placeholder="请输入账号" />
|
|
</view>
|
|
</view>
|
|
<view class="login-input">
|
|
<view class="login-input">
|
|
<!-- <input :password="true" v-model="password" placeholder="请输入密码(6-16位)" /> -->
|
|
<!-- <input :password="true" v-model="password" placeholder="请输入密码(6-16位)" /> -->
|
|
@@ -25,14 +24,12 @@
|
|
</view> -->
|
|
</view> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <!-- #endif -->
|
|
|
|
-
|
|
|
|
- <!-- #ifdef MP-WEIXIN -->
|
|
|
|
</block>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { registerRuntimeCompiler } from 'vue';
|
|
var _this;
|
|
var _this;
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -51,21 +48,25 @@ export default {
|
|
userAgent: navigator.userAgent
|
|
userAgent: navigator.userAgent
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
- _this = this;
|
|
|
|
- },
|
|
|
|
|
|
+ mounted() {},
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
- console.log(e);
|
|
|
|
- if (e.redirect) {
|
|
|
|
- this.redirect = e.redirect;
|
|
|
|
|
|
+ _this = this;
|
|
|
|
+ console.log(e, 88888);
|
|
|
|
+ if (e.sign && e.time && e.username) {
|
|
|
|
+ _this.autoLogin(e.username, e.time, e.sign);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
this.user = this.$common.userInfo();
|
|
this.user = this.$common.userInfo();
|
|
console.log('this.user: ', this.user);
|
|
console.log('this.user: ', this.user);
|
|
- if (typeof this.user == 'undefined' || this.user == '' || this.user == null) {
|
|
|
|
|
|
+ if (this.user == 'undefined' || this.user == '' || this.user == null) {
|
|
|
|
+ console.log('login');
|
|
} else {
|
|
} else {
|
|
- this.$common.navigateTo('index');
|
|
|
|
|
|
+ console.log('/pages/index/index');
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/index/index'
|
|
|
|
+ });
|
|
}
|
|
}
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
this.wxLogin();
|
|
this.wxLogin();
|
|
@@ -73,6 +74,44 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 自动登录
|
|
|
|
+ autoLogin(username, time, sign) {
|
|
|
|
+ _this.$api.autoLogin(
|
|
|
|
+ {
|
|
|
|
+ username,
|
|
|
|
+ time,
|
|
|
|
+ sign
|
|
|
|
+ },
|
|
|
|
+ (data) => {
|
|
|
|
+ console.log(data, 11);
|
|
|
|
+ if (data.code == 1) {
|
|
|
|
+ try {
|
|
|
|
+ _this.$db.set('upload', 1);
|
|
|
|
+ _this.$db.set('login', 1);
|
|
|
|
+ _this.$db.set('token', data.data.userinfo.token);
|
|
|
|
+ _this.$db.set('user', data.data.userinfo);
|
|
|
|
+ _this.$db.set('auth', data.data.userinfo);
|
|
|
|
+ _this.$store.commit('setAccessToken', data.data.userinfo.token);
|
|
|
|
+ _this.$store.commit('setActivityId', 0);
|
|
|
|
+ } catch (e) {}
|
|
|
|
+ _this.loading = false;
|
|
|
|
+ _this.$common.successToShow(data.msg, function () {
|
|
|
|
+ _this.$common.navigateTo('index');
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/index/index'
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ _this.loading = false;
|
|
|
|
+ uni.showToast({
|
|
|
|
+ duration: 1500,
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: data.msg
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
changePassword: function () {
|
|
changePassword: function () {
|
|
this.showPassword = !this.showPassword;
|
|
this.showPassword = !this.showPassword;
|
|
},
|
|
},
|
|
@@ -92,14 +131,14 @@ export default {
|
|
},
|
|
},
|
|
login() {
|
|
login() {
|
|
_this.loading = true;
|
|
_this.loading = true;
|
|
- // if (_this.username == '' || _this.username.length < 11) {
|
|
|
|
- // uni.showToast({
|
|
|
|
- // icon: 'none',
|
|
|
|
- // title: '请输入正确的手机号'
|
|
|
|
- // });
|
|
|
|
- // _this.loading = false;
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
|
|
+ if (_this.username == '') {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '请输入账号'
|
|
|
|
+ });
|
|
|
|
+ _this.loading = false;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (_this.password == '') {
|
|
if (_this.password == '') {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|