123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- import http from '@/http/api.js'
- // 获取token
- const token = (tenantId, username, password, type) => {
- return http.request({
- url: '/api/blade-auth/oauth/token',
- method: 'POST',
- header: {
- 'Tenant-Id': tenantId
- },
- params: {
- tenantId,
- username,
- password,
- grant_type: "password",
- scope: "all",
- type
- }
- })
- }
- export const getXqgk = () => {
- return http.request({
- url: '/blade-system/user/getXqgk',
- method: 'get',
- })
- }
- const refreshToken = (refresh_token, tenantId) => {
- return http.request({
- url: '/api/blade-auth/oauth/token',
- method: 'post',
- headers: {
- 'Tenant-Id': tenantId
- },
- params: {
- tenantId,
- refresh_token,
- grant_type: "refresh_token",
- scope: "all",
- }
- })
- }
- // 获取用户信息
- export const userInfo = () => {
- return http.request({
- url: '/api/blade-system/user/getUserInfo',
- method: 'GET',
- })
- }
- // 获取用户信息
- export const getUser = (id) => {
- return http.request({
- url: '/api/blade-system/user/detail',
- method: 'GET',
- params: { id }
- })
- }
- // 获取用户信息
- export const wxlogin = (row) => {
- return http.request({
- url: '/api/blade-system/user/wxlogi_qs',
- method: 'POST',
- header: {
- // 'Content-Type': 'application/x-www-form-urlencoded'
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- data: row
- })
- }
- //blade-auth/oauth/token
- export const weblogin = (row) => {
- return http.request({
- url: '/api/blade-auth/oauth/token',
- method: 'POST',
- header: {
- // 'Content-Type': 'application/x-www-form-urlencoded'
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- data: row
- })
- }
- // 获取帐户信息
- export const getzhxx = (yhbh) => {
-
- return http.request({
- url: '/api/miaos/zhxx/detail',
- method: 'GET',
- params: { yhbh }
- })
- }
- //blade-system/user/registerUser
- // 用户注册
- export const registerUser = (row) => {
- return wx.cloud.callContainer({
- "path": "/blade-system/user/registerUser_qs",
- "header": {
- "X-WX-SERVICE": "msserver",
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- "method": "POST",
- "data":row
- })
- // return http.request({
- // url: '/api/blade-system/user/registerUser_qs',
- // method: 'POST',
- // header: {
- // // 'Content-Type': 'application/x-www-form-urlencoded'
- // 'Content-Type': 'application/x-www-form-urlencoded'
- // },
- // data: row
- // })
- }
- // 用户手机号码
- export const getPhoneNumbers = (row) => {
- return http.request({
- url: '/api/blade-system/user/getPhoneNumber_qs',
- method: 'POST',
- header: {
- // 'Content-Type': 'application/x-www-form-urlencoded'
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- data: row
- })
- }
- export const updateinfo = (row) => {
- return http.request({
- url: '/api/blade-system/user/update-info',
- method: 'POST',
- data: row
- })
- }
- //个人信息
- export const updateinfos = (row) => {
- return http.request({
- url: '/api/blade-system/user/update',
- method: 'POST',
- data: row
- })
- }
- // 部门
- //1、学校列表
- export const university_list = () => {
- return wx.cloud.callContainer({
- "path": "/blade-system/dept/university-list",
- "header": {
- "X-WX-SERVICE": "msserver"
- },
- "method": "GET",
- "data":{}
- })
- // return http.request({
- // url: '/api/blade-system/dept/university-list',
- // method: 'GET'
- // })
- }
- export const college_list = (deptId) => {
- return wx.cloud.callContainer({
- "path": "/blade-system/dept/college-list",
- "header": {
- "X-WX-SERVICE": "msserver"
- },
- "method": "GET",
- "data":{deptId}
- })
-
- // return http.request({
- // url: '/api/blade-system/dept/college-list',
- // method: 'GET',
- // params:{
- // deptId
- // }
- // })
- }
- export const specialty_list = (deptId) => {
- return wx.cloud.callContainer({
- "path": "/blade-system/dept/specialty-list",
- "header": {
- "X-WX-SERVICE": "msserver"
- },
- "method": "GET",
- "data":{deptId}
- })
- // return http.request({
- // url: '/api/blade-system/dept/specialty-list',
- // method: 'GET',
- // params:{
- // deptId
- // }
- // })
- }
- export const grade_list = (deptId) => {
- return wx.cloud.callContainer({
- "path": "/blade-system/dept/grade-list",
- "header": {
- "X-WX-SERVICE": "msserver"
- },
- "method": "GET",
- "data":{deptId}
- })
- // return http.request({
- // url: '/api/blade-system/dept/grade-list',
- // method: 'GET',
- // params:{
- // deptId
- // }
- // })
- }
- export default {
- token,
- wxlogin,
- userInfo,
- updateinfos,
- refreshToken
- }
|