From d8b41fff43a2cee6a8f714ffa807623b15803786 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Fri, 20 Oct 2023 15:21:35 +0800 Subject: [PATCH] fix:立行立改Uniapp小程序新建项目 --- App.vue | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 93 insertions(+), 0 deletions(-) diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..dd2c821 --- /dev/null +++ b/App.vue @@ -0,0 +1,93 @@ +<script> + import Vue from 'vue' + import { + getUserInfor, + getDic + } from '@/utils/login.js' // ������������ + import { + httpPost, + httpGet + } from '@/utils/http.js' + export default { + onLaunch: function() { + // ������������������ + this.getUserInfo() + }, + methods: { + /** + * ������������ + * ��������������������������������������������������������������������� + * + */ + getUserInfo() { + uni.login({ + provider: 'weixin', + success(res) { + if (res.code) { + // ������������������������code������������������������ + httpGet('/AppUser/wx/login', { + 'code': res.code + }).then(result => { + if (result.data.code === 0) { + // ������������ + uni.clearStorageSync() + uni.setStorageSync('token', result.data.token) + // setTimeout(() => { + // uni.reLaunch({ + // url: '/pages/actionChange/agencyPage/index', + // }) + // }, 3000) + getUserInfor(result.data.token) + getDic() + } else { + // ��������������� + uni.setStorageSync('openId', result.data.openId) + uni.showModal({ + title: '���������', + content: '������������������������������������������', + showCancel: false, + confirmText: '������', + success: res => { + if (res.confirm) { + uni.reLaunch({ + url: '/pages/login/login', + }) + } + }, + }) + } + }) + } else { + console.log(res.errMsg) + } + } + }) + }, + }, + } +</script> +<style lang="scss"> + /* ������������������������������������style������������lang="scss"������ */ + @import "@/uni_modules/uview-ui/index.scss"; + + html { + height: 100%; + } + + .formItemContent { + ::v-deep.u-form-item { + padding: 8px 0; + border-bottom: 1px dashed #bbb; + } + + ::v-deep.u-form-item__body, + /deep/.u-textarea { + padding: 0 !important; + } + + ::v-deep.u-form-item__body__left__content__label, + /deep/.u-radio__text { + font-size: 13px !important; + } + } +</style> \ No newline at end of file -- Gitblit v1.8.0