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