diff --git a/.env.development b/.env.development index 6f47003..600b1ac 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 若依管理系统 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api' +VUE_APP_BASE_API = https://dev-mssm-liaoning.imian.org.cn/ggfw-api # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/index.js b/src/api/index.js new file mode 100644 index 0000000..50aafd3 --- /dev/null +++ b/src/api/index.js @@ -0,0 +1,7 @@ +// 召回 +import login from "./myAPI/login.js"; + + +export default { + login +}; diff --git a/src/api/myAPI/login.js b/src/api/myAPI/login.js new file mode 100644 index 0000000..901e9d2 --- /dev/null +++ b/src/api/myAPI/login.js @@ -0,0 +1,29 @@ +import request from "@/utils/request"; +// 本地 +// let api = "API" +// 线上 + +let api = location.origin +export default { + + + frimLogin() { + return request({ + baseURL: process.env.VUE_APP_USER_LOGIN, + url: "/pharmaceuticals/login", + headers: { + "Content-Type": "application/json", + isToken: true, + repeatSubmit: false, + }, + method: "POST", + timeout: 60000, + data: { + pdma: "MTExMTEx", + urne: "2112042170015", + }, + }); + }, + + +}; diff --git a/src/main.js b/src/main.js index 6abd3d7..4e9e94f 100644 --- a/src/main.js +++ b/src/main.js @@ -39,6 +39,8 @@ import VueMeta from 'vue-meta' import DictData from '@/components/DictData' //计算rem基准 import '@/utils/rem.js' +// 引用api +import API from '@/api/index.js' // 全局方法挂载 @@ -51,6 +53,7 @@ Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree +Vue.prototype.$api = API // 全局组件挂载 Vue.component('DictTag', DictTag) @@ -66,6 +69,15 @@ Vue.use(plugins) Vue.use(VueMeta) DictData.install() + // 临时获取token + let token = async()=>{ + let Authentication = await API.login.frimLogin(); + localStorage.setItem( + "MSSM-LIAONING__TOKEN", + Authentication.data.result.userToken + ); + } + token() /** * If you don't want to use mock-server * you want to use MockJs for mock api