sys 2 yıl önce
ebeveyn
işleme
053be85332
5 değiştirilmiş dosya ile 20 ekleme ve 13 silme
  1. 2 2
      .env.dev.js
  2. 2 2
      .env.prod.js
  3. 1 1
      api/login.js
  4. 2 2
      manifest.json
  5. 13 6
      service/ajax.js

+ 2 - 2
.env.dev.js

@@ -1,6 +1,6 @@
 const config = {
-	baseUrl: 'www.icoco.tech:9999/admin',
-	socketUrl: 'www.icoco.tech:9999/admin',
+	baseUrl: 'icoco.tech',
+	socketUrl: 'icoco.tech',
     appName:'开发环境'
 }
 module.exports = config;

+ 2 - 2
.env.prod.js

@@ -1,6 +1,6 @@
 const config = {
-    baseUrl: 'www.icoco.tech:9999/admin',
-    socketUrl: 'www.icoco.tech:9999/admin',
+    baseUrl: 'icoco.tech',
+    socketUrl: 'icoco.tech',
     appName:'正式环境'
 }
 module.exports = config;

+ 1 - 1
api/login.js

@@ -3,6 +3,6 @@ import {request} from '@/service/ajax'
 const newsUrl = '/utility/'
 // 登陆
 // export const login = (data) => request(newsUrl + 'one_click_login', 'post', { ...data },false)
-export const login = (data) => request('/auth/oauth2/token', 'get', { ...data },false)
+export const login = (data) => request('/auth/oauth2/token', 'post', { ...data },false)
 export const forgetPassword = (data) => request(newsUrl + 'forget_password', 'post', { ...data },false)
 export const register = (data) => request(newsUrl + 'register', 'post', { ...data },true)

+ 2 - 2
manifest.json

@@ -130,7 +130,7 @@
             "https" : false,
             "proxy" : {
                 "/utility" : {
-                    "target" : "http://www.icoco.tech:9999/admin",
+                    "target" : "https://icoco.tech/admin",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {
@@ -138,7 +138,7 @@
                     }
                 },
                 "/auth" : {
-                    "target" : "http://www.icoco.tech:9999/admin",
+                    "target" : "https://icoco.tech/",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {

+ 13 - 6
service/ajax.js

@@ -10,7 +10,19 @@ BASE_URL ='https://' + process.uniEnv.baseUrl;
  * post请求封装
  */
 export const request = (url, method, data, show = false) => {
+  console.log(url)
   let token=uni.getStorageSync('token')
+  let header={
+    'content-type': 'application/json',
+    'hversion': '1.0',
+    'Authorization': '',
+  }
+  if(url==='/auth/oauth2/token'){
+    token='YXBwOmFwcA=='
+    header['CLIENT-TOC']='Y'
+  }
+  header.Authorization= 'Bearer '+token
+  console.log(header)
   // data.token = token;
   // data.m_id = uni.getStorageSync('m_id')
   if (show) {
@@ -26,12 +38,7 @@ export const request = (url, method, data, show = false) => {
       url:BASE_URL+  url,
       data: data,
       method: method || 'post',
-      header: {
-        'content-type': 'application/json',
-        'hversion': '1.0',
-        'Authorization': 'Bearer cd58ee97-5700-45f3-ae1f-9bebef504fc1'
-        // 'Authorization': 'Bearer '+token
-      },
+      header: header,
       success: (res) => {
         if (res.statusCode === 200) {
           // console.log('应答信息-----------------------')