更换接口跟路径对接登录
parent
e1cd9590dd
commit
c97abae226
4
main.js
4
main.js
|
|
@ -9,8 +9,8 @@ import {
|
|||
|
||||
Vue.config.productionTip = false
|
||||
uni.$http = $http
|
||||
$http.baseUrl = 'http://36.139.207.50:18083'
|
||||
// $http.baseUrl = 'http://223.75.53.124:8002/chibirsvr/sys'
|
||||
// $http.baseUrl = 'http://36.139.207.50:18083'
|
||||
$http.baseUrl = 'http://223.75.53.124:8002/chibirsvr/sys'
|
||||
// 请求拦截器
|
||||
$http.beforeRequest = function(options) {
|
||||
// uni.showLoading({
|
||||
|
|
|
|||
|
|
@ -47,8 +47,9 @@ export default {
|
|||
methods: {
|
||||
async getSwiperList() {
|
||||
try {
|
||||
const res = await uni.$http.get("/gunshiApp/xfflood/getLoginInfo");
|
||||
const res = await uni.$http.get("/getLoginInfo");
|
||||
console.log("--c-", res.data);
|
||||
|
||||
this.userList = res.data;
|
||||
|
||||
console.log("--cb-", this.userList);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ export default {
|
|||
methods: {
|
||||
async getSwiperList() {
|
||||
try {
|
||||
const res = await uni.$http.get("/gunshiApp/xfflood/getLoginInfo");
|
||||
const res = await uni.$http.get("/getLoginInfo");
|
||||
console.log("--1-", res.data);
|
||||
this.userList = res.data;
|
||||
|
||||
|
|
|
|||
|
|
@ -156,14 +156,14 @@ export default {
|
|||
|
||||
//提交表单
|
||||
|
||||
uni.$http.post('/gunshiApp/xfflood/doLogin', postForm).then(res => {
|
||||
uni.$http.post('/doLogin', postForm).then(res => {
|
||||
uni.showLoading({ title: '努力登录中...', mask: true })
|
||||
|
||||
if (res.data.code === 200) {
|
||||
//localStorage保存token
|
||||
if (res.data.data) {
|
||||
uni.setStorageSync('Gs-Token', res.data.data)
|
||||
uni.$http.get('/gunshiApp/xfflood/getLoginInfo').then(res => {
|
||||
uni.$http.get('/getLoginInfo').then(res => {
|
||||
console.log('sss', res.data.data)
|
||||
uni.setStorageSync('value', res.data.data)
|
||||
console.log('-----value------', res.data.data)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
new_params.userId = uni.getStorageSync('value').userId
|
||||
// console.log(formData)
|
||||
|
||||
uni.$http.post('/gunshiApp/xfflood/user/updateSecretKey',new_params).then(res=>{
|
||||
uni.$http.post('/user/updateSecretKey',new_params).then(res=>{
|
||||
console.log(res);
|
||||
if (res.data.code === 200) {
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -89,19 +89,19 @@
|
|||
})
|
||||
// console.log('click',index,func[index].url)
|
||||
},
|
||||
async setInsert () {
|
||||
try {
|
||||
const params = {
|
||||
createId: uni.getStorageSync('value').userId,
|
||||
loginType:1,
|
||||
menu1:'我的',
|
||||
menu2:'我的',
|
||||
}
|
||||
// async setInsert () {
|
||||
// try {
|
||||
// const params = {
|
||||
// createId: uni.getStorageSync('value').userId,
|
||||
// loginType:1,
|
||||
// menu1:'我的',
|
||||
// menu2:'我的',
|
||||
// }
|
||||
|
||||
const { data } = await uni.$http.post('/gunshiApp/xfflood/visitMenuLog/insert',params)
|
||||
console.log('用户行为',params,data)
|
||||
} catch (error) {}
|
||||
},
|
||||
// const { data } = await uni.$http.post('/gunshiApp/xfflood/visitMenuLog/insert',params)
|
||||
// console.log('用户行为',params,data)
|
||||
// } catch (error) {}
|
||||
// },
|
||||
logout(){
|
||||
if(uni.getStorageSync('loginChecked')===true){
|
||||
uni.redirectTo({
|
||||
|
|
|
|||
Loading…
Reference in New Issue