This commit is contained in:
PQZ 2024-08-29 12:44:18 +08:00
parent 204b0c1ab9
commit 655d45a160
3 changed files with 14 additions and 8 deletions

View File

@ -2,8 +2,8 @@
module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'https://www.nuoyunr.com/jx',
imagesUrl: 'https://www.nuoyunr.com/jx',
imagesUrl: 'http://localhost:48080/admin-api',
baseUrl: 'http://localhost:48080/admin-api',
// baseUrl: 'http://192.168.31.54:8016/jx',
// imagesUrl: 'http://192.168.31.54:8016/jx',
// 应用信息

View File

@ -55,6 +55,7 @@
<script>
import request from '../../utils/request';
import config from '@/config'
import {
setToken
} from '@/utils/auth.js'
@ -160,6 +161,8 @@
},
getPhone(e) {
console.log('执行了');
config.header = config.header || {}
config.header['Tenant-Id'] = '1'
if (this.privacyPolicyChecked == false) {
uni.showToast({
icon: "none",
@ -171,8 +174,9 @@
uni.checkSession({
success: () => {
uni.request({
url: this.baseUrl + "/wxLoginJc",
url: this.baseUrl + "/rescue/wxLogin",
method: "POST",
header: config.header,
data: {
code: uni.getStorageSync('c1'),
encryptedIv: e.detail.iv,
@ -182,11 +186,12 @@
},
success: (rex) => {
console.log('yongdao返回', rex)
if (rex.data.code == 200) {
if (this.loginStatus) {
clearInterval(this.loginStatus)
}
if (rex.data.code == 0) {
// if (this.loginStatus) {
// clearInterval(this.loginStatus)
// }
uni.setStorageSync('App-Token', rex.data.token);
debugger
if (this.returnUrl) {
uni.navigateBack()
} else {
@ -229,7 +234,7 @@
userinfo() {
console.log('执行了');
request({
url: '/getAppInfo',
url: '/jx/auth/getAppInfo',
method: 'get',
}).then((res) => {

View File

@ -17,6 +17,7 @@ const request = config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
config.header['Tenant-Id'] = '1'
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
}