| | |
| | | trigger: ['blur', 'change']
|
| | | },
|
| | | },
|
| | | |
| | |
|
| | | };
|
| | | },
|
| | | onLoad() {
|
| | |
| | | if (account) {
|
| | | this.model = account
|
| | | }
|
| | | let _that = this
|
| | | // uni-app客户端获取push客户端标记
|
| | | // uni.getPushClientId({
|
| | | // success: (res) => {
|
| | | // let push_clientid = res.cid
|
| | | // _that.model.username = push_clientid
|
| | | // console.log('客户端推送标识:', push_clientid)
|
| | | // },
|
| | | // fail(err) {
|
| | | // _that.model.username = err
|
| | | // console.log(err)
|
| | | // }
|
| | | // })
|
| | |
|
| | | // uni.onPushMessage((res) => {
|
| | | // _that.model.username = JSON.stringify(res)
|
| | | // console.log("收到推送消息:", res) //监听推送消息
|
| | | // })
|
| | |
|
| | |
|
| | |
|
| | | },
|
| | | computed: {
|
| | | cid() {
|
| | | return this.$store.getters.getCid; // 使用 getter 获取 cid
|
| | | },
|
| | | },
|
| | | methods: {
|
| | |
|
| | | methods: { |
| | | |
| | | forget() {
|
| | | uni.navigateTo({
|
| | | url: "/pages/tabBar/demo"
|
| | | })
|
| | | },
|
| | | submit() { |
| | | submit() {
|
| | | if (this.model.username.startsWith("http")) {
|
| | | uni.setStorageSync('baseurl', this.model.username);
|
| | | this.model.username = null
|
| | |
| | | },
|
| | | login() {
|
| | | this.$api.login(this.model).then((res) => {
|
| | | if (res.success) { |
| | | |
| | | if (res.success) {
|
| | |
|
| | |
|
| | | console.log('request success', res)
|
| | | uni.showToast({
|
| | |
| | |
|
| | | uni.setStorageSync('account', this.model);
|
| | | uni.setStorageSync('userinfo', res.result.userInfo);
|
| | | uni.setStorageSync('token', res.result.token); |
| | | |
| | | uni.setStorageSync('token', res.result.token);
|
| | |
|
| | |
|
| | |
|
| | | uni.switchTab({
|
| | | url: '/pages/tabBar/general'
|