更新功能
23
App.vue
@ -2,6 +2,7 @@
|
|||||||
//#ifdef APP-PLUS
|
//#ifdef APP-PLUS
|
||||||
const jpushModule = uni.requireNativePlugin("JG-JPush");
|
const jpushModule = uni.requireNativePlugin("JG-JPush");
|
||||||
// #endif
|
// #endif
|
||||||
|
import { loginShopAccount } from "@/api/oaUser.js"
|
||||||
export default {
|
export default {
|
||||||
onLaunch: async function(info) {
|
onLaunch: async function(info) {
|
||||||
// let noticeArr = []
|
// let noticeArr = []
|
||||||
@ -20,8 +21,26 @@
|
|||||||
// uni.showModal({
|
// uni.showModal({
|
||||||
// content: info.referrerInfo.extraData
|
// content: info.referrerInfo.extraData
|
||||||
// })
|
// })
|
||||||
if(info.referrerInfo?.extraData?.uniMP) uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
|
|
||||||
if(info.referrerInfo?.extraData?.token) uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token);
|
if (info.referrerInfo?.extraData?.uniMP) {
|
||||||
|
uni.setStorageSync('uniMP', info.referrerInfo?.extraData?.uniMP);
|
||||||
|
uni.setStorageSync('APP_token', info.referrerInfo?.extraData?.token);
|
||||||
|
try{
|
||||||
|
let res = await loginShopAccount({
|
||||||
|
shop_token: info.referrerInfo?.extraData?.token
|
||||||
|
});
|
||||||
|
this.$store.commit('SET_USERINFO', {
|
||||||
|
user: data,
|
||||||
|
token: res.data.token
|
||||||
|
})
|
||||||
|
let {
|
||||||
|
data
|
||||||
|
} = await userInfo();
|
||||||
|
this.$store.commit('setUserInfo', data);
|
||||||
|
}catch(e){
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
console.log('App Launch')
|
console.log('App Launch')
|
||||||
this.$store.dispatch('initConfig');
|
this.$store.dispatch('initConfig');
|
||||||
try {
|
try {
|
||||||
|
@ -60,3 +60,8 @@ export const userPostsms = (data) => oahttp.post('/user/postsms', data)
|
|||||||
* 注销账号
|
* 注销账号
|
||||||
*/
|
*/
|
||||||
export const destroyAccount = (data) => oahttp.post('/user/destroy_account', data)
|
export const destroyAccount = (data) => oahttp.post('/user/destroy_account', data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商城登录
|
||||||
|
*/
|
||||||
|
export const loginShopAccount = (data) => oahttp.post('/login/shop_account', data)
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="title">欢迎进入里海供销平台!</view>
|
<view class="title">欢迎进入里海供销平台!</view>
|
||||||
<view>{{APP_token}}</view>
|
|
||||||
<view class="login-card">
|
<view class="login-card">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="text item">
|
<view class="text item">
|
||||||
@ -74,7 +73,8 @@
|
|||||||
code: '',
|
code: '',
|
||||||
terminal: 6, //6是APP端
|
terminal: 6, //6是APP端
|
||||||
scene: 1,
|
scene: 1,
|
||||||
register_id: ""
|
register_id: "",
|
||||||
|
shop_token: ""
|
||||||
},
|
},
|
||||||
tips: '获取验证码',
|
tips: '获取验证码',
|
||||||
// refCode: null,
|
// refCode: null,
|
||||||
@ -118,6 +118,7 @@
|
|||||||
if (!this.formData.account) return Toast('账号不能为空');
|
if (!this.formData.account) return Toast('账号不能为空');
|
||||||
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
|
if (this.formData.scene == 1 && !this.formData.password) return Toast('密码不能为空');
|
||||||
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
|
if (this.formData.scene == 2 && !this.formData.code) return Toast('验证码不能为空');
|
||||||
|
this.formData.shop_token = uni.getStorageSync('APP_token');
|
||||||
let that = this;
|
let that = this;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在登录中'
|
title: '正在登录中'
|
||||||
|
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 753 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 645 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 779 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 864 B |
Before Width: | Height: | Size: 785 B |